Interface OCluster
- All Known Implementing Classes:
OClusterRemote,OOfflineCluster,OPaginatedCluster,OPaginatedClusterV0,OPaginatedClusterV1,OPaginatedClusterV2
public interface OCluster
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidAcquires exclusive lock in the active atomic operation running on the current thread for this cluster.allocatePosition(byte recordType, OAtomicOperation atomicOperation) Allocates a physical position pointer on the storage for generate an id without a content.ceilingPositions(OPhysicalPosition position) voidclose()voidclose(boolean flush) voidvoidconfigure(OStorage iStorage, OStorageClusterConfiguration iConfig) 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 atomicOperation, long clusterPosition) booleanexists()floorPositions(OPhysicalPosition position) intlonglongintgetId()longgetName()longgetPhysicalPosition(OPhysicalPosition iPPosition) 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.longhigherPositions(OPhysicalPosition position) booleanisDeleted(OPhysicalPosition iPPosition) 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) readRecord(long clusterPosition, boolean prefetchRecords) readRecordIfVersionIsNotLatest(long clusterPosition, int recordVersion) voidsetClusterName(String name) voidsetEncryption(String encryptionName, String encryptionKey) voidsetRecordConflictStrategy(String conflictStrategy) voidsynch()voidupdateRecord(long clusterPosition, byte[] content, int recordVersion, byte recordType, OAtomicOperation atomicOperation)
-
Method Details
-
configure
- Throws:
IOException
-
configure
- Throws:
IOException
-
create
- Throws:
IOException
-
open
- Throws:
IOException
-
close
- Throws:
IOException
-
close
- Throws:
IOException
-
delete
- Throws:
IOException
-
setClusterName
-
setRecordConflictStrategy
-
setEncryption
-
encryption
String encryption() -
getTombstonesCount
long getTombstonesCount() -
allocatePosition
OPhysicalPosition allocatePosition(byte recordType, OAtomicOperation atomicOperation) throws IOException Allocates 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.
- Throws:
IOException
-
createRecord
OPhysicalPosition createRecord(byte[] content, int recordVersion, byte recordType, OPhysicalPosition allocatedPosition, OAtomicOperation atomicOperation) Creates 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.
-
deleteRecord
-
updateRecord
void updateRecord(long clusterPosition, byte[] content, int recordVersion, byte recordType, OAtomicOperation atomicOperation) -
readRecord
- Throws:
IOException
-
readRecordIfVersionIsNotLatest
ORawBuffer readRecordIfVersionIsNotLatest(long clusterPosition, int recordVersion) throws IOException, ORecordNotFoundException - Throws:
IOExceptionORecordNotFoundException
-
exists
boolean exists() -
getPhysicalPosition
Fills and return the PhysicalPosition object received as parameter with the physical position of logical record iPosition- Throws:
IOException
-
isDeleted
Check if a rid is existent and deleted or not existent return true only if delete flag is set.- Throws:
IOException
-
getEntries
long getEntries() -
getFirstPosition
- Throws:
IOException
-
getLastPosition
- Throws:
IOException
-
getNextPosition
- Throws:
IOException
-
getFileName
String getFileName() -
getId
int getId() -
synch
- Throws:
IOException
-
getName
String getName() -
getRecordsSize
Returns the size of the records contained in the cluster in bytes.- Throws:
IOException
-
compression
String compression() -
isSystemCluster
boolean isSystemCluster() -
higherPositions
- Throws:
IOException
-
ceilingPositions
- Throws:
IOException
-
lowerPositions
- Throws:
IOException
-
floorPositions
- Throws:
IOException
-
getRecordConflictStrategy
ORecordConflictStrategy getRecordConflictStrategy() -
acquireAtomicExclusiveLock
void acquireAtomicExclusiveLock()Acquires exclusive lock in the active atomic operation running on the current thread for this cluster. -
nextPage
- Throws:
IOException
-
getBinaryVersion
int getBinaryVersion()
-