Class OPaginatedClusterV1
java.lang.Object
com.orientechnologies.common.concur.resource.OSharedResourceAbstract
com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent
com.orientechnologies.orient.core.storage.cluster.OPaginatedCluster
com.orientechnologies.orient.core.storage.cluster.v1.OPaginatedClusterV1
- All Implemented Interfaces:
OCluster
- Since:
- 10/7/13
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com)
-
Nested Class Summary
Nested classes/interfaces inherited from class com.orientechnologies.orient.core.storage.cluster.OPaginatedCluster
OPaginatedCluster.RECORD_STATUSNested classes/interfaces inherited from interface com.orientechnologies.orient.core.storage.OCluster
OCluster.ATTRIBUTES -
Field Summary
Fields inherited from class com.orientechnologies.orient.core.storage.cluster.OPaginatedCluster
DEF_EXTENSIONFields inherited from class com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent
atomicOperationsManager, readCache, storage, writeCacheFields inherited from class com.orientechnologies.common.concur.resource.OSharedResourceAbstract
lock -
Constructor Summary
ConstructorsConstructorDescriptionOPaginatedClusterV1(String name, OAbstractPaginatedStorage storage) OPaginatedClusterV1(String name, String dataExtension, String cpmExtension, OAbstractPaginatedStorage storage) -
Method Summary
Modifier and TypeMethodDescriptionvoidAcquires exclusive lock in the active atomic operation running on the current thread for this cluster.allocatePosition(byte recordType, OAtomicOperation operation) Allocates a physical position pointer on the storage for generate an id without a content.ceilingPositions(OPhysicalPosition position) voidclose()voidclose(boolean flush) voidvoidconfigure(OStorage storage, OStorageClusterConfiguration config) voidcreate(OAtomicOperation atomicOperation) createRecord(byte[] content, int recordVersion, byte recordType, OPhysicalPosition allocatedPosition, OAtomicOperation atomicOperation) Creates a new record in the cluster.voiddelete(OAtomicOperation atomicOperation) booleandeleteRecord(OAtomicOperation operation, long clusterPosition) booleanexists()floorPositions(OPhysicalPosition position) intlonglongReturns the fileId used in disk cache.longintgetId()longlonggetPhysicalPosition(OPhysicalPosition position) Fills and return the PhysicalPosition object received as parameter with the physical position of logical record iPositionlongReturns the size of the records contained in the cluster in bytes.getRecordStatus(long clusterPosition) longhigherPositions(OPhysicalPosition position) booleanisDeleted(OPhysicalPosition position) Check if a rid is existent and deleted or not existent return true only if delete flag is set.booleanlowerPositions(OPhysicalPosition position) nextPage(long lastPosition) voidopen(OAtomicOperation atomicOperation) readDebug(long clusterPosition) readRecord(long clusterPosition, boolean prefetchRecords) readRecordIfVersionIsNotLatest(long clusterPosition, int recordVersion) voidsetClusterName(String newName) voidsetEncryption(String method, String key) voidsetRecordConflictStrategy(String stringValue) voidsynch()toString()voidupdateRecord(long clusterPosition, byte[] content, int recordVersion, byte recordType, OAtomicOperation atomicOperation) Methods inherited from class com.orientechnologies.orient.core.storage.cluster.OPaginatedCluster
getLatestBinaryVersion, replaceClusterMapFile, replaceFileMethods inherited from class com.orientechnologies.orient.core.storage.impl.local.paginated.base.ODurableComponent
addFile, addPage, calculateInsideComponentOperation, deleteFile, executeInsideComponentOperation, getExtension, getFilledUpTo, getFullName, getLockName, getName, isFileExists, loadOrAddPageForWrite, loadPageForRead, loadPageForWrite, openFile, releasePageFromRead, releasePageFromWrite, setName, truncateFile, tryExecuteInsideComponentOperationMethods inherited from class com.orientechnologies.common.concur.resource.OSharedResourceAbstract
acquireExclusiveLock, acquireSharedLock, releaseExclusiveLock, releaseSharedLock
-
Constructor Details
-
OPaginatedClusterV1
-
OPaginatedClusterV1
public OPaginatedClusterV1(String name, String dataExtension, String cpmExtension, OAbstractPaginatedStorage storage)
-
-
Method Details
-
configure
- Throws:
IOException
-
exists
public boolean exists() -
getBinaryVersion
public int getBinaryVersion() -
generateClusterConfig
- Specified by:
generateClusterConfigin classOPaginatedCluster
-
configure
- Throws:
IOException
-
create
-
open
- Throws:
IOException
-
close
public void close() -
close
public void close(boolean flush) -
delete
-
isSystemCluster
public boolean isSystemCluster() -
compression
-
encryption
-
allocatePosition
Description copied from interface:OClusterAllocates a physical position pointer on the storage for generate an id without a content.- Parameters:
recordType- the type of record of which allocate the position.- Returns:
- the allocated position.
-
createRecord
public OPhysicalPosition createRecord(byte[] content, int recordVersion, byte recordType, OPhysicalPosition allocatedPosition, OAtomicOperation atomicOperation) Description copied from interface:OClusterCreates a new record in the cluster.- Parameters:
content- the content of the record.recordVersion- the current versionrecordType- the type of the recordallocatedPosition- the eventual allocated position or null if there is no allocated position.- Returns:
- the position where the record si created.
-
readRecord
- Throws:
IOException
-
readRecordIfVersionIsNotLatest
public ORawBuffer readRecordIfVersionIsNotLatest(long clusterPosition, int recordVersion) throws IOException, ORecordNotFoundException - Throws:
IOExceptionORecordNotFoundException
-
deleteRecord
-
updateRecord
public void updateRecord(long clusterPosition, byte[] content, int recordVersion, byte recordType, OAtomicOperation atomicOperation) -
getTombstonesCount
public long getTombstonesCount() -
getPhysicalPosition
Description copied from interface:OClusterFills and return the PhysicalPosition object received as parameter with the physical position of logical record iPosition- Throws:
IOException
-
isDeleted
Description copied from interface:OClusterCheck if a rid is existent and deleted or not existent return true only if delete flag is set.- Throws:
IOException
-
getEntries
public long getEntries() -
getFirstPosition
- Throws:
IOException
-
getLastPosition
- Throws:
IOException
-
getNextPosition
- Throws:
IOException
-
getFileName
-
getId
public int getId() -
getFileId
public long getFileId()Returns the fileId used in disk cache.- Specified by:
getFileIdin classOPaginatedCluster
-
synch
public void synch() -
getRecordsSize
Description copied from interface:OClusterReturns the size of the records contained in the cluster in bytes.- Throws:
IOException
-
higherPositions
- Throws:
IOException
-
ceilingPositions
- Throws:
IOException
-
lowerPositions
- Throws:
IOException
-
floorPositions
- Throws:
IOException
-
getRecordConflictStrategy
-
setRecordConflictStrategy
-
setEncryption
-
setClusterName
-
readDebug
- Specified by:
readDebugin classOPaginatedCluster- Throws:
IOException
-
getRecordStatus
- Specified by:
getRecordStatusin classOPaginatedCluster- Throws:
IOException
-
acquireAtomicExclusiveLock
public void acquireAtomicExclusiveLock()Description copied from interface:OClusterAcquires exclusive lock in the active atomic operation running on the current thread for this cluster. -
toString
-
nextPage
- Throws:
IOException
-