Class ODurableComponent
java.lang.Object
com.orientechnologies.common.concur.resource.OSharedResourceAbstract
com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent
- Direct Known Subclasses:
BTree,CellBTreeMultiValueV2,CellBTreeSingleValueV1,CellBTreeSingleValueV3,FreeSpaceMap,HashTableDirectory,LocalHashTableV2,NormalizedKeyBTreeValue,OClusterPositionMap,OHashTableDirectory,OLocalHashTableV3,OPaginatedCluster,OSBTreeBonsaiLocal,OSBTreeV1,OSBTreeV2,OVersionPositionMap
Base class for all durable data structures, that is data structures state of which can be
consistently restored after system crash but results of last operations in small interval before
crash may be lost.
- Since:
- 8/27/13
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final OAtomicOperationsManagerprotected final OReadCacheprotected final OAbstractPaginatedStorageprotected final OWriteCacheFields inherited from class com.orientechnologies.common.concur.resource.OSharedResourceAbstract
lock -
Constructor Summary
ConstructorsConstructorDescriptionODurableComponent(OAbstractPaginatedStorage storage, String name, String extension, String lockName) -
Method Summary
Modifier and TypeMethodDescriptionprotected longaddFile(OAtomicOperation atomicOperation, String fileName) protected OCacheEntryaddPage(OAtomicOperation atomicOperation, long fileId) protected <T> TcalculateInsideComponentOperation(OAtomicOperation atomicOperation, TxFunction<T> function) protected voiddeleteFile(OAtomicOperation atomicOperation, long fileId) protected voidexecuteInsideComponentOperation(OAtomicOperation operation, TxConsumer consumer) protected longgetFilledUpTo(OAtomicOperation atomicOperation, long fileId) getName()protected booleanisFileExists(OAtomicOperation atomicOperation, String fileName) protected OCacheEntryloadOrAddPageForWrite(OAtomicOperation atomicOperation, long fileId, long pageIndex, boolean verifyCheckSum) protected OCacheEntryloadPageForRead(OAtomicOperation atomicOperation, long fileId, long pageIndex) protected static OCacheEntryloadPageForWrite(OAtomicOperation atomicOperation, long fileId, long pageIndex, boolean verifyCheckSum) protected longopenFile(OAtomicOperation atomicOperation, String fileName) protected voidreleasePageFromRead(OAtomicOperation atomicOperation, OCacheEntry cacheEntry) protected voidreleasePageFromWrite(OAtomicOperation atomicOperation, OCacheEntry cacheEntry) voidprotected voidtruncateFile(OAtomicOperation atomicOperation, long filedId) protected booleantryExecuteInsideComponentOperation(OAtomicOperation operation, TxConsumer consumer) Methods inherited from class com.orientechnologies.common.concur.resource.OSharedResourceAbstract
acquireExclusiveLock, acquireSharedLock, releaseExclusiveLock, releaseSharedLock
-
Field Details
-
atomicOperationsManager
-
storage
-
readCache
-
writeCache
-
-
Constructor Details
-
ODurableComponent
public ODurableComponent(OAbstractPaginatedStorage storage, String name, String extension, String lockName)
-
-
Method Details
-
getLockName
-
getName
-
setName
-
getFullName
-
getExtension
-
calculateInsideComponentOperation
protected <T> T calculateInsideComponentOperation(OAtomicOperation atomicOperation, TxFunction<T> function) -
executeInsideComponentOperation
-
tryExecuteInsideComponentOperation
protected boolean tryExecuteInsideComponentOperation(OAtomicOperation operation, TxConsumer consumer) -
getFilledUpTo
-
loadPageForWrite
protected static OCacheEntry loadPageForWrite(OAtomicOperation atomicOperation, long fileId, long pageIndex, boolean verifyCheckSum) throws IOException - Throws:
IOException
-
loadOrAddPageForWrite
protected OCacheEntry loadOrAddPageForWrite(OAtomicOperation atomicOperation, long fileId, long pageIndex, boolean verifyCheckSum) throws IOException - Throws:
IOException
-
loadPageForRead
protected OCacheEntry loadPageForRead(OAtomicOperation atomicOperation, long fileId, long pageIndex) throws IOException - Throws:
IOException
-
addPage
- Throws:
IOException
-
releasePageFromWrite
protected void releasePageFromWrite(OAtomicOperation atomicOperation, OCacheEntry cacheEntry) throws IOException - Throws:
IOException
-
releasePageFromRead
-
addFile
- Throws:
IOException
-
openFile
- Throws:
IOException
-
deleteFile
- Throws:
IOException
-
isFileExists
-
truncateFile
- Throws:
IOException
-