Class OAbstractPaginatedStorage
java.lang.Object
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage
- All Implemented Interfaces:
OBackgroundExceptionListener,OCheckpointRequestListener,OFreezableStorageComponent,OPageIsBrokenListener,OIdentifiableStorage,OStorage,OStorageInfo,OBackupable
- Direct Known Subclasses:
ODirectMemoryStorage,OLocalPaginatedStorage
public abstract class OAbstractPaginatedStorage
extends Object
implements OCheckpointRequestListener, OIdentifiableStorage, OBackgroundExceptionListener, OFreezableStorageComponent, OPageIsBrokenListener, OStorage
- Since:
- 28.03.13
- Author:
- Andrey Lomakin (a.lomakin-at-orientdb.com)
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.orientechnologies.orient.core.storage.OStorage
OStorage.LOCKING_STRATEGY, OStorage.STATUS -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OAtomicOperationsManagerprotected AtomicOperationsTableprotected OCurrentStorageComponentsFactoryprotected OStorageConfigurationprotected OrientDBInternalprotected static final Stringprotected AtomicReference<Throwable>protected static final ScheduledExecutorServiceprotected Stringprotected OReadCacheprotected OSBTreeCollectionManagerSharedprotected final ReentrantReadWriteLockprotected OStorage.STATUSstatic final ThreadGroupprotected final Stringprotected OWriteAheadLogprotected OWriteCacheFields inherited from interface com.orientechnologies.orient.core.storage.OStorage
CLUSTER_DEFAULT_NAME -
Constructor Summary
ConstructorsConstructorDescriptionOAbstractPaginatedStorage(String name, String filePath, int id, OrientDBInternal context) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidacquireReadLock(ORID rid) voidacquireReadLock(ORID rid, long timeout) final voidacquireWriteLock(ORID rid) voidacquireWriteLock(ORID rid, long timeout) final intaddCluster(String clusterName, int requestedId) Add a new cluster into the storage.final intaddCluster(String clusterName, Object... parameters) Add a new cluster into the storage.protected abstract voidaddFileToDirectory(String name, InputStream stream, File directory) intaddIndexEngine(OIndexMetadata indexMetadata, Map<String, String> engineProperties) browseCluster(int clusterId) <T> TcallIndexEngine(boolean readOperation, int indexId, OIndexEngineCallback<T> callback) final OPhysicalPosition[]ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) booleancheck(boolean verbose, OCommandOutputListener listener) protected abstract voidprotected voidcheckDatabaseInstanceId(UUID backupUUID) voidfinal booleanprotected OStartupMetadatastatic Stringprotected final voidChecks if the storage is open.final booleancleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback) voidclearIndex(int indexId) final voidprotected voidvoidclose()final voidclose(boolean force, boolean onDelete) protected voidcloseClusters(boolean onDelete) protected voidcloseIndexes(OAtomicOperation atomicOperation, boolean onDelete) final Objectcommand(OCommandRequestText iCommand) Executes the command request and return the result back.commit(OTransactionInternal clientTx) Traditional commit that support already temporary rid and already assigned ridsprotected List<ORecordOperation>commit(OTransactionInternal transaction, boolean allocated) The commit operation can be run in 3 different conditions, embedded commit, pre-allocated commit, other node commit.commitPreAllocated(OTransactionInternal clientTx) Commit a transaction where the rid where pre-allocated in a previous phaseprotected abstract OLogSequenceNumbercopyWALToIncrementalBackup(ZipOutputStream zipOutputStream, long startSegment) final longcount(int iClusterId) final longcount(int[] iClusterIds) final longcount(int[] iClusterIds, boolean countTombstones) final longcount(int clusterId, boolean countTombstones) longReturns the total number of records.voidcreate(OContextConfiguration contextConfiguration) createRecord(ORecordId rid, byte[] content, int recordVersion, byte recordType, ORecordCallback<Long> callback) protected abstract OWriteAheadLogcreateWalFromIBUFiles(File directory, OContextConfiguration contextConfiguration, Locale locale, byte[] iv) protected abstract Filefinal voiddelete()voiddeleteIndexEngine(int indexId) final OStorageOperationResult<Boolean>deleteRecord(ORecordId rid, int version, int mode, ORecordCallback<Boolean> callback) voiddeleteTreeRidBag(OSBTreeRidBag ridBag) final booleandropCluster(int clusterId) Drops a cluster.booleandropCluster(String iClusterName) voidendDDL()final ObjectexecuteCommand(OCommandRequestText iCommand, OCommandExecutor executor) static intextractEngineAPIVersion(int externalId) extractTransactionsFromWal(List<OTransactionId> transactionsMetadata) voidfinal OPhysicalPosition[]floorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) protected voidfinal voidfreeze(boolean throwException) After this method finished it's execution, all threads that are going to perform data modifications in storage should wait tillOFreezableStorageComponent.release()method will be called.voidfullIncrementalBackup(OutputStream stream) protected voidgenerateDatabaseInstanceId(OAtomicOperation atomicOperation) final OAtomicOperationsManagerfinal long[]getClusterDataRange(int iClusterId) Returns a pair of long values telling the begin and end positions of data in the requested cluster.getClusterEncryption(int clusterId) final intgetClusterIdByName(String clusterName) getClusterName(int clusterId) getClusterNameById(int clusterId) longgetClusterNextPosition(int clusterId) getClusterRecordConflictStrategy(int clusterId) longgetClusterRecordsSizeById(int clusterId) longgetClusterRecordsSizeByName(String clusterName) final intint[]getClustersIds(Set<String> filterClusters) final OStorageConfigurationfinal Stringfinal intfinal intgetId()getIdGen()getIndexDescStream(int indexId, IndexEngineValuesTransformer valuesTransformer) getIndexEngine(int indexId) getIndexKeyStream(int indexId) longgetIndexSize(int indexId, IndexEngineValuesTransformer transformer) getIndexStream(int indexId, IndexEngineValuesTransformer valuesTransformer) getIndexValue(int indexId, Object key) getIndexValues(int indexId, Object key) protected abstract byte[]getIv()longlonggetLastClusterPosition(int clusterId) Optional<byte[]>getLSN()getMode()getName()protected Stringfinal StringgetPhysicalClusterNameById(int iClusterId) final ORecordConflictStrategyfinal ORecordMetadatagetRecordMetadata(ORID rid) longgetRecordStatus(ORID rid) final OSBTreeCollectionManagerintfinal longgetSize()Returns the size of the database.Returns the current storage's statusDeprecated.getURL()getUuid()longintgetVersionForKey(String indexName, Object key) booleanhasIndexRangeQuerySupport(int indexId) final OPhysicalPosition[]higherPhysicalPositions(int currentClusterId, OPhysicalPosition physicalPosition) voidincrementalBackup(String backupDirectory, OCallable<Void, Void> started) protected voidinitConfiguration(OAtomicOperation atomicOperation, OContextConfiguration contextConfiguration) protected abstract voidinitIv()protected abstract voidinitWalAndDiskCache(OContextConfiguration contextConfiguration) booleanfinal booleanisClosed()booleanprotected booleanisDirty()booleanDeprecated.protected booleanbooleanisMemory()final booleanisRemote()booleanisSystemCluster(int clusterId) protected abstract booleaniterateIndexEntriesBetween(int indexId, Object rangeFrom, boolean fromInclusive, Object rangeTo, boolean toInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) iterateIndexEntriesMajor(int indexId, Object fromKey, boolean isInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) iterateIndexEntriesMinor(int indexId, Object toKey, boolean isInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) static OEncryptionloadEncryption(String cfgEncryption, String cfgEncryptionKey) intloadExternalIndexEngine(OIndexMetadata indexMetadata, Map<String, String> engineProperties) intloadIndexEngine(String name) protected final ErrorlogAndPrepareForRethrow(Error error) protected ErrorlogAndPrepareForRethrow(Error error, boolean putInReadOnlyMode) protected final RuntimeExceptionlogAndPrepareForRethrow(RuntimeException runtimeException) protected RuntimeExceptionlogAndPrepareForRethrow(RuntimeException runtimeException, boolean putInReadOnlyMode) protected final RuntimeExceptionlogAndPrepareForRethrow(Throwable throwable) protected RuntimeExceptionlogAndPrepareForRethrow(Throwable throwable, boolean putInReadOnlyMode) final OPhysicalPosition[]lowerPhysicalPositions(int currentClusterId, OPhysicalPosition physicalPosition) final voidprotected voidvoidmetadataOnly(byte[] metadata) voidprotected static StringnormalizeName(String name) final voidfinal voidopen(OContextConfiguration contextConfiguration) final voidopen(String iUserName, String iUserPassword, OContextConfiguration contextConfiguration) protected final voidopenClusters(OAtomicOperation atomicOperation) protected final voidfinal voidpageIsBroken(String fileName, long pageIndex) Method is called by write cache when it is detected that data page in file is broken.voidprotected abstract voidpostCloseSteps(boolean onDelete, boolean internalError, long lastTxId) protected voidpostCloseStepsAfterLock(Map<String, Object> params) protected final voidprotected voidvoidpreallocateRids(OTransactionInternal clientTx) Scan the given transaction for new record and allocate a record id for them, the relative record id is inserted inside the transaction for future use.protected voidvoidputIndexValue(int indexId, Object key, Object value) voidputRidIndexEntry(int indexId, Object key, ORID value) protected UUIDprotected abstract voidreadIv()readRecord(ORecordId rid, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords, ORecordCallback<ORawBuffer> iCallback) readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) voidregisterRecoverListener(OStorageRecoverListener recoverListener) final voidrelease()After this method finished execution all threads that are waiting to perform data modifications in storage will be awaken and will be allowed to continue their execution.final voidreleaseReadLock(ORID rid) final voidreleaseWriteLock(ORID rid) final voidreload()booleanremoveKeyFromIndex(int indexId, Object key) final voidremoveProperty(String property) booleanremoveRidIndexEntry(int indexId, Object key, ORID value) final voidresolveObjectSerializer(byte serializerId) protected final booleanrestoreAtomicUnit(List<OWALRecord> atomicUnit, OModifiableBoolean atLeastOnePageUpdate) protected OLogSequenceNumberrestoreFrom(OWriteAheadLog writeAheadLog, OLogSequenceNumber lsn) voidrestoreFromIncrementalBackup(String filePath) voidfinal voidsetCharset(String charset) booleansetClusterAttribute(int id, OCluster.ATTRIBUTES attribute, Object value) final voidsetClusterSelection(String clusterSelection) final voidsetConflictStrategy(ORecordConflictStrategy conflictResolver) final voidsetDateFormat(String dateFormat) final voidsetDateTimeFormat(String dateTimeFormat) final voidsetDefaultClusterId(int defaultClusterId) final voidsetIndexMgrRecordId(String indexMgrRecordId) final voidsetLocaleCountry(String localeCountry) final voidsetLocaleLanguage(String locale) final voidsetMinimumClusters(int minimumClusters) final voidsetProperty(String property, String value) final voidsetRecordSerializer(String recordSerializer, int version) final voidsetSchemaRecordId(String schemaRecordId) voidsetStorageConfigurationUpdateListener(OStorageConfigurationUpdateListener storageConfigurationUpdateListener) final voidsetTimeZone(TimeZone timeZoneValue) final voidsetValidation(boolean validation) voidshutdown()This method is called inOrient.shutdown()method.voidstartDDL()booleanfinal voidsynch()toString()voidunregisterRecoverListener(OStorageRecoverListener recoverListener) voidupdateIndexEntry(int indexId, Object key, OIndexKeyUpdater<Object> valueCreator) final OStorageOperationResult<Integer>updateRecord(ORecordId rid, boolean updateContent, byte[] content, int version, byte recordType, int mode, ORecordCallback<Integer> callback) booleanvalidatedPutIndexValue(int indexId, Object key, ORID value, IndexEngineValidator<Object, ORID> validator) Puts the given value under the given key into this storage for the index with the given index id.booleanbooleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.orientechnologies.orient.core.util.OBackupable
backup, restoreMethods inherited from interface com.orientechnologies.orient.core.storage.OStorage
exists, getType, isIcrementalBackupRunning
-
Field Details
-
storageThreadGroup
-
fuzzyCheckpointExecutor
-
sbTreeCollectionManager
-
writeAheadLog
-
readCache
-
writeCache
-
atomicOperationsManager
-
DATABASE_INSTANCE_ID
- See Also:
-
atomicOperationsTable
-
url
-
stateLock
-
configuration
-
componentsFactory
-
name
-
status
-
error
-
context
-
-
Constructor Details
-
OAbstractPaginatedStorage
-
-
Method Details
-
normalizeName
-
checkName
-
getUnderlying
Deprecated.- Specified by:
getUnderlyingin interfaceOStorage
-
getName
- Specified by:
getNamein interfaceOStorage- Specified by:
getNamein interfaceOStorageInfo
-
getURL
- Specified by:
getURLin interfaceOStorageInfo
-
close
public void close() -
dropCluster
- Specified by:
dropClusterin interfaceOStorage
-
countRecords
public long countRecords()Description copied from interface:OStorageReturns the total number of records.- Specified by:
countRecordsin interfaceOStorage
-
toString
-
getStatus
Description copied from interface:OStorageReturns the current storage's status -
isDistributed
Deprecated.- Specified by:
isDistributedin interfaceOStorage
-
isAssigningClusterIds
public boolean isAssigningClusterIds()- Specified by:
isAssigningClusterIdsin interfaceOStorage- Specified by:
isAssigningClusterIdsin interfaceOStorageInfo
-
getComponentsFactory
- Specified by:
getComponentsFactoryin interfaceOStorage
-
getVersion
public long getVersion()- Specified by:
getVersionin interfaceOStorage
-
shutdown
public void shutdown()Description copied from interface:OStorageThis method is called inOrient.shutdown()method. For most of the storages it means that storage will be merely closed, but sometimes additional operations are need to be taken in account. -
open
public final void open(String iUserName, String iUserPassword, OContextConfiguration contextConfiguration) -
open
-
readIv
- Throws:
IOException
-
getIv
protected abstract byte[] getIv() -
getCreatedAtVersion
- Specified by:
getCreatedAtVersionin interfaceOStorage- Returns:
- Version of product release under which storage was created.
-
openIndexes
protected final void openIndexes() -
openClusters
- Throws:
IOException
-
create
-
generateDatabaseInstanceId
-
readDatabaseInstanceId
-
checkDatabaseInstanceId
-
initIv
- Throws:
IOException
-
isClosed
public final boolean isClosed() -
close
public final void close(boolean force, boolean onDelete) -
delete
public final void delete() -
check
-
addCluster
Description copied from interface:OStorageAdd a new cluster into the storage.- Specified by:
addClusterin interfaceOStorage- Parameters:
clusterName- name of the cluster
-
addCluster
Description copied from interface:OStorageAdd a new cluster into the storage.- Specified by:
addClusterin interfaceOStorage- Parameters:
clusterName- name of the clusterrequestedId- requested id of the cluster
-
dropCluster
public final boolean dropCluster(int clusterId) Description copied from interface:OStorageDrops a cluster.- Specified by:
dropClusterin interfaceOStorage- Parameters:
clusterId- id of the cluster to delete- Returns:
- true if has been removed, otherwise false
-
getClusterNameById
- Specified by:
getClusterNameByIdin interfaceOStorage
-
getClusterRecordsSizeById
public long getClusterRecordsSizeById(int clusterId) - Specified by:
getClusterRecordsSizeByIdin interfaceOStorage
-
getClusterRecordsSizeByName
- Specified by:
getClusterRecordsSizeByNamein interfaceOStorage
-
getClusterRecordConflictStrategy
- Specified by:
getClusterRecordConflictStrategyin interfaceOStorage
-
getClusterEncryption
- Specified by:
getClusterEncryptionin interfaceOStorage
-
isSystemCluster
public boolean isSystemCluster(int clusterId) - Specified by:
isSystemClusterin interfaceOStorage
-
getLastClusterPosition
public long getLastClusterPosition(int clusterId) - Specified by:
getLastClusterPositionin interfaceOStorage
-
getClusterNextPosition
public long getClusterNextPosition(int clusterId) - Specified by:
getClusterNextPositionin interfaceOStorage
-
getRecordStatus
- Specified by:
getRecordStatusin interfaceOStorage
-
getId
public final int getId()- Specified by:
getIdin interfaceOIdentifiableStorage
-
getUuid
-
getSBtreeCollectionManager
- Specified by:
getSBtreeCollectionManagerin interfaceOStorage
-
getReadCache
-
getWriteCache
-
count
public final long count(int iClusterId) -
count
public final long count(int clusterId, boolean countTombstones) -
getClusterDataRange
public final long[] getClusterDataRange(int iClusterId) Description copied from interface:OStorageReturns a pair of long values telling the begin and end positions of data in the requested cluster. Useful to know the range of the records.- Specified by:
getClusterDataRangein interfaceOStorage- Parameters:
iClusterId- Cluster id
-
getLSN
-
count
public final long count(int[] iClusterIds) -
onException
- Specified by:
onExceptionin interfaceOBackgroundExceptionListener
-
extractTransactionsFromWal
public Optional<OBackgroundNewDelta> extractTransactionsFromWal(List<OTransactionId> transactionsMetadata) -
count
public final long count(int[] iClusterIds, boolean countTombstones) -
createRecord
public final OStorageOperationResult<OPhysicalPosition> createRecord(ORecordId rid, byte[] content, int recordVersion, byte recordType, ORecordCallback<Long> callback) -
getRecordMetadata
- Specified by:
getRecordMetadatain interfaceOStorage
-
isDeleted
-
browseCluster
-
readRecord
public OStorageOperationResult<ORawBuffer> readRecord(ORecordId rid, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords, ORecordCallback<ORawBuffer> iCallback) - Specified by:
readRecordin interfaceOStorage
-
readRecordIfVersionIsNotLatest
public final OStorageOperationResult<ORawBuffer> readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) throws ORecordNotFoundException - Specified by:
readRecordIfVersionIsNotLatestin interfaceOStorage- Throws:
ORecordNotFoundException
-
updateRecord
public final OStorageOperationResult<Integer> updateRecord(ORecordId rid, boolean updateContent, byte[] content, int version, byte recordType, int mode, ORecordCallback<Integer> callback) -
getAtomicOperationsManager
-
getWALInstance
-
getIdGen
-
deleteRecord
public final OStorageOperationResult<Boolean> deleteRecord(ORecordId rid, int version, int mode, ORecordCallback<Boolean> callback) - Specified by:
deleteRecordin interfaceOStorage
-
getClusterNames
- Specified by:
getClusterNamesin interfaceOStorage- Specified by:
getClusterNamesin interfaceOStorageInfo
-
getClusterIdByName
- Specified by:
getClusterIdByNamein interfaceOStorage- Specified by:
getClusterIdByNamein interfaceOStorageInfo
-
preallocateRids
Scan the given transaction for new record and allocate a record id for them, the relative record id is inserted inside the transaction for future use.- Parameters:
clientTx- the transaction of witch allocate rids
-
commit
Traditional commit that support already temporary rid and already assigned rids -
commitPreAllocated
Commit a transaction where the rid where pre-allocated in a previous phase- Parameters:
clientTx- the pre-allocated transaction to commit- Returns:
- The list of operations applied by the transaction
-
commit
The commit operation can be run in 3 different conditions, embedded commit, pre-allocated commit, other node commit.Embedded commit is the basic commit where the operation is run in embedded or server side, the transaction arrive with invalid rids that get allocated and committed.pre-allocated commit is the commit that happen after an preAllocateRids call is done, this is usually run by the coordinator of a tx in distributed.other node commit is the commit that happen when a node execute a transaction of another node where all the rids are already allocated in the other node.- Parameters:
transaction- the transaction to commitallocated- true if the operation is pre-allocated commit- Returns:
- The list of operations applied by the transaction
-
loadIndexEngine
-
loadExternalIndexEngine
public int loadExternalIndexEngine(OIndexMetadata indexMetadata, Map<String, String> engineProperties) -
addIndexEngine
-
resolveObjectSerializer
-
loadEncryption
-
extractEngineAPIVersion
public static int extractEngineAPIVersion(int externalId) -
deleteIndexEngine
- Throws:
OInvalidIndexEngineIdException
-
removeKeyFromIndex
- Throws:
OInvalidIndexEngineIdException
-
clearIndex
- Throws:
OInvalidIndexEngineIdException
-
getIndexValue
- Throws:
OInvalidIndexEngineIdException
-
getIndexValues
- Throws:
OInvalidIndexEngineIdException
-
getIndexEngine
- Throws:
OInvalidIndexEngineIdException
-
updateIndexEntry
public void updateIndexEntry(int indexId, Object key, OIndexKeyUpdater<Object> valueCreator) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
callIndexEngine
public <T> T callIndexEngine(boolean readOperation, int indexId, OIndexEngineCallback<T> callback) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
putRidIndexEntry
public void putRidIndexEntry(int indexId, Object key, ORID value) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
removeRidIndexEntry
public boolean removeRidIndexEntry(int indexId, Object key, ORID value) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
putIndexValue
public void putIndexValue(int indexId, Object key, Object value) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
validatedPutIndexValue
public boolean validatedPutIndexValue(int indexId, Object key, ORID value, IndexEngineValidator<Object, ORID> validator) throws OInvalidIndexEngineIdExceptionPuts the given value under the given key into this storage for the index with the given index id. Validates the operation using the provided validator.- Parameters:
indexId- the index id of the index to put the value into.key- the key to put the value under.value- the value to put.validator- the operation validator.- Returns:
trueif the validator allowed the put,falseotherwise.- Throws:
OInvalidIndexEngineIdException- See Also:
-
iterateIndexEntriesBetween
public Stream<ORawPair<Object,ORID>> iterateIndexEntriesBetween(int indexId, Object rangeFrom, boolean fromInclusive, Object rangeTo, boolean toInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
iterateIndexEntriesMajor
public Stream<ORawPair<Object,ORID>> iterateIndexEntriesMajor(int indexId, Object fromKey, boolean isInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
iterateIndexEntriesMinor
public Stream<ORawPair<Object,ORID>> iterateIndexEntriesMinor(int indexId, Object toKey, boolean isInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
getIndexStream
public Stream<ORawPair<Object,ORID>> getIndexStream(int indexId, IndexEngineValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
getIndexDescStream
public Stream<ORawPair<Object,ORID>> getIndexDescStream(int indexId, IndexEngineValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
getIndexKeyStream
- Throws:
OInvalidIndexEngineIdException
-
getIndexSize
public long getIndexSize(int indexId, IndexEngineValuesTransformer transformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
hasIndexRangeQuerySupport
- Throws:
OInvalidIndexEngineIdException
-
moveToErrorStateIfNeeded
-
checkForRecordValidity
- Specified by:
checkForRecordValidityin interfaceOStorage
-
synch
public final void synch() -
getPhysicalClusterNameById
- Specified by:
getPhysicalClusterNameByIdin interfaceOStorage- Specified by:
getPhysicalClusterNameByIdin interfaceOStorageInfo
-
getDefaultClusterId
public final int getDefaultClusterId()- Specified by:
getDefaultClusterIdin interfaceOStorageInfo
-
setDefaultClusterId
public final void setDefaultClusterId(int defaultClusterId) - Specified by:
setDefaultClusterIdin interfaceOStorage
-
getClusterName
- Specified by:
getClusterNamein interfaceOStorage
-
getSize
public final long getSize()Description copied from interface:OStorageReturns the size of the database. -
getClusters
public final int getClusters()- Specified by:
getClustersin interfaceOStorageInfo
-
getClusterInstances
- Specified by:
getClusterInstancesin interfaceOStorage
-
cleanOutRecord
public final boolean cleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback) - Specified by:
cleanOutRecordin interfaceOStorage
-
freeze
public final void freeze(boolean throwException) Description copied from interface:OFreezableStorageComponentAfter this method finished it's execution, all threads that are going to perform data modifications in storage should wait tillOFreezableStorageComponent.release()method will be called. This method will wait till all ongoing modifications will be finished.- Specified by:
freezein interfaceOFreezableStorageComponent- Parameters:
throwException- IftrueOModificationOperationProhibitedExceptionexception will be thrown on call of methods that requires storage modification. Otherwise other threads will wait forOFreezableStorageComponent.release()method call.
-
release
public final void release()Description copied from interface:OFreezableStorageComponentAfter this method finished execution all threads that are waiting to perform data modifications in storage will be awaken and will be allowed to continue their execution.- Specified by:
releasein interfaceOFreezableStorageComponent
-
isRemote
public final boolean isRemote() -
wereDataRestoredAfterOpen
public boolean wereDataRestoredAfterOpen() -
wereNonTxOperationsPerformedInPreviousOpen
public boolean wereNonTxOperationsPerformedInPreviousOpen() -
reload
public final void reload() -
getMode
-
pageIsBroken
Description copied from interface:OPageIsBrokenListenerMethod is called by write cache when it is detected that data page in file is broken.- Specified by:
pageIsBrokenin interfaceOPageIsBrokenListener- Parameters:
fileName- Name of broken file.pageIndex- Index of page which is broken in file.
-
requestCheckpoint
public final void requestCheckpoint()- Specified by:
requestCheckpointin interfaceOCheckpointRequestListener
-
command
Executes the command request and return the result back. -
executeCommand
-
higherPhysicalPositions
public final OPhysicalPosition[] higherPhysicalPositions(int currentClusterId, OPhysicalPosition physicalPosition) - Specified by:
higherPhysicalPositionsin interfaceOStorage
-
ceilingPhysicalPositions
public final OPhysicalPosition[] ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) - Specified by:
ceilingPhysicalPositionsin interfaceOStorage
-
lowerPhysicalPositions
public final OPhysicalPosition[] lowerPhysicalPositions(int currentClusterId, OPhysicalPosition physicalPosition) - Specified by:
lowerPhysicalPositionsin interfaceOStorage
-
floorPhysicalPositions
public final OPhysicalPosition[] floorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) - Specified by:
floorPhysicalPositionsin interfaceOStorage
-
acquireWriteLock
-
acquireWriteLock
-
releaseWriteLock
-
acquireReadLock
-
acquireReadLock
-
releaseReadLock
-
getRecordConflictStrategy
- Specified by:
getRecordConflictStrategyin interfaceOStorage- Specified by:
getRecordConflictStrategyin interfaceOStorageInfo
-
setConflictStrategy
- Specified by:
setConflictStrategyin interfaceOStorage
-
getRecordScanned
public long getRecordScanned() -
copyWALToIncrementalBackup
protected abstract OLogSequenceNumber copyWALToIncrementalBackup(ZipOutputStream zipOutputStream, long startSegment) throws IOException - Throws:
IOException
-
isWriteAllowedDuringIncrementalBackup
protected abstract boolean isWriteAllowedDuringIncrementalBackup() -
getRecoverListener
-
registerRecoverListener
-
unregisterRecoverListener
-
createWalTempDirectory
-
addFileToDirectory
protected abstract void addFileToDirectory(String name, InputStream stream, File directory) throws IOException - Throws:
IOException
-
createWalFromIBUFiles
protected abstract OWriteAheadLog createWalFromIBUFiles(File directory, OContextConfiguration contextConfiguration, Locale locale, byte[] iv) throws IOException - Throws:
IOException
-
checkOpennessAndMigration
protected final void checkOpennessAndMigration()Checks if the storage is open. If it's closed an exception is raised. -
isInError
protected boolean isInError() -
checkErrorState
public void checkErrorState() -
makeFuzzyCheckpoint
public final void makeFuzzyCheckpoint() -
deleteTreeRidBag
-
flushAllData
protected void flushAllData() -
checkIfStorageDirty
- Throws:
IOException
-
initConfiguration
protected void initConfiguration(OAtomicOperation atomicOperation, OContextConfiguration contextConfiguration) throws IOException - Throws:
IOException
-
postCreateSteps
protected final void postCreateSteps() -
preCreateSteps
- Throws:
IOException
-
initWalAndDiskCache
protected abstract void initWalAndDiskCache(OContextConfiguration contextConfiguration) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
postCloseSteps
protected abstract void postCloseSteps(boolean onDelete, boolean internalError, long lastTxId) throws IOException - Throws:
IOException
-
postCloseStepsAfterLock
-
preCloseSteps
-
postDeleteSteps
protected void postDeleteSteps() -
makeStorageDirty
- Throws:
IOException
-
clearStorageDirty
- Throws:
IOException
-
isDirty
protected boolean isDirty() -
getOpenedAtVersion
-
metadataOnly
public void metadataOnly(byte[] metadata) -
setClusterAttribute
- Specified by:
setClusterAttributein interfaceOStorage
-
closeClusters
- Throws:
IOException
-
closeIndexes
-
incrementalBackup
public String incrementalBackup(String backupDirectory, OCallable<Void, Void> started) throws UnsupportedOperationException- Specified by:
incrementalBackupin interfaceOStorage- Returns:
- Backup file name
- Throws:
UnsupportedOperationException
-
supportIncremental
public boolean supportIncremental()- Specified by:
supportIncrementalin interfaceOStorage
-
fullIncrementalBackup
- Specified by:
fullIncrementalBackupin interfaceOStorage- Throws:
UnsupportedOperationException
-
restoreFromIncrementalBackup
- Specified by:
restoreFromIncrementalBackupin interfaceOStorage
-
restoreFullIncrementalBackup
- Specified by:
restoreFullIncrementalBackupin interfaceOStorage- Throws:
UnsupportedOperationException
-
restoreFrom
protected OLogSequenceNumber restoreFrom(OWriteAheadLog writeAheadLog, OLogSequenceNumber lsn) throws IOException - Throws:
IOException
-
restoreAtomicUnit
protected final boolean restoreAtomicUnit(List<OWALRecord> atomicUnit, OModifiableBoolean atLeastOnePageUpdate) throws IOException - Throws:
IOException
-
setStorageConfigurationUpdateListener
public void setStorageConfigurationUpdateListener(OStorageConfigurationUpdateListener storageConfigurationUpdateListener) -
pauseConfigurationUpdateNotifications
public void pauseConfigurationUpdateNotifications() -
fireConfigurationUpdateNotifications
public void fireConfigurationUpdateNotifications() -
getRidsGroupedByCluster
-
logAndPrepareForRethrow
-
logAndPrepareForRethrow
protected RuntimeException logAndPrepareForRethrow(RuntimeException runtimeException, boolean putInReadOnlyMode) -
logAndPrepareForRethrow
-
logAndPrepareForRethrow
-
logAndPrepareForRethrow
-
logAndPrepareForRethrow
-
getConfiguration
- Specified by:
getConfigurationin interfaceOStorageInfo
-
setSchemaRecordId
- Specified by:
setSchemaRecordIdin interfaceOStorage
-
setDateFormat
- Specified by:
setDateFormatin interfaceOStorage
-
setTimeZone
- Specified by:
setTimeZonein interfaceOStorage
-
setLocaleLanguage
- Specified by:
setLocaleLanguagein interfaceOStorage
-
setCharset
- Specified by:
setCharsetin interfaceOStorage
-
setIndexMgrRecordId
- Specified by:
setIndexMgrRecordIdin interfaceOStorage
-
setDateTimeFormat
- Specified by:
setDateTimeFormatin interfaceOStorage
-
setLocaleCountry
- Specified by:
setLocaleCountryin interfaceOStorage
-
setClusterSelection
- Specified by:
setClusterSelectionin interfaceOStorage
-
setMinimumClusters
public final void setMinimumClusters(int minimumClusters) - Specified by:
setMinimumClustersin interfaceOStorage
-
setValidation
public final void setValidation(boolean validation) - Specified by:
setValidationin interfaceOStorage
-
removeProperty
- Specified by:
removePropertyin interfaceOStorage
-
setProperty
- Specified by:
setPropertyin interfaceOStorage
-
setRecordSerializer
- Specified by:
setRecordSerializerin interfaceOStorage
-
clearProperties
public final void clearProperties()- Specified by:
clearPropertiesin interfaceOStorage
-
getLastMetadata
-
incOnOpen
public void incOnOpen() -
getSessionCount
public int getSessionCount() -
getLastCloseTime
public long getLastCloseTime() -
getVersionForKey
-
getClustersIds
- Specified by:
getClustersIdsin interfaceOStorage
-
checkBackupRunning
protected abstract void checkBackupRunning() -
startDDL
public void startDDL() -
endDDL
public void endDDL() -
getContext
- Specified by:
getContextin interfaceOStorage
-
isMemory
public boolean isMemory()
-