
public abstract class OAbstractPaginatedStorage extends OStorageAbstract implements OCheckpointRequestListener, OIdentifiableStorage, OBackgroundExceptionListener, OFreezableStorageComponent, OPageIsBrokenListener
| Modifier and Type | Class and Description |
|---|---|
protected static class |
OAbstractPaginatedStorage.StartupMetadata |
OStorage.LOCKING_STRATEGY, OStorage.STATUS| Modifier and Type | Field and Description |
|---|---|
protected OAtomicOperationsManager |
atomicOperationsManager |
protected AtomicOperationsTable |
atomicOperationsTable |
protected static String |
DATABASE_INSTANCE_ID |
protected static ScheduledExecutorService |
fuzzyCheckpointExecutor |
protected OReadCache |
readCache |
protected OSBTreeCollectionManagerShared |
sbTreeCollectionManager |
protected OWriteAheadLog |
writeAheadLog |
protected OWriteCache |
writeCache |
componentsFactory, configuration, error, errorLock, inError, mode, name, sharedContainer, stateLock, status, storageThreadGroup, urlCLUSTER_DEFAULT_NAME| Constructor and Description |
|---|
OAbstractPaginatedStorage(String name,
String filePath,
String mode,
int id) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquireIndexEngineExclusiveLock(int indexId,
Object key) |
void |
acquireReadLock(ORID rid) |
void |
acquireReadLock(ORID rid,
long timeout) |
void |
acquireWriteLock(ORID rid) |
void |
acquireWriteLock(ORID rid,
long timeout) |
int |
addCluster(String clusterName,
int requestedId)
Add a new cluster into the storage.
|
int |
addCluster(String clusterName,
Object... parameters)
Add a new cluster into the storage.
|
protected abstract void |
addFileToDirectory(String name,
InputStream stream,
File directory) |
int |
addIndexEngine(String engineName,
String algorithm,
String indexType,
OIndexDefinition indexDefinition,
OBinarySerializer<?> valueSerializer,
boolean isAutomatic,
Boolean durableInNonTxMode,
int version,
int apiVersion,
boolean multivalue,
Map<String,String> engineProperties,
Set<String> clustersToIndex,
ODocument metadata) |
Iterator<OClusterBrowsePage> |
browseCluster(int clusterId) |
<T> T |
callIndexEngine(boolean readOperation,
int indexId,
OIndexEngineCallback<T> callback) |
OPhysicalPosition[] |
ceilingPhysicalPositions(int clusterId,
OPhysicalPosition physicalPosition) |
boolean |
check(boolean verbose,
OCommandOutputListener listener) |
protected void |
checkDatabaseInstanceId(UUID backupUUID) |
void |
checkErrorState() |
boolean |
checkForRecordValidity(OPhysicalPosition ppos) |
protected OAbstractPaginatedStorage.StartupMetadata |
checkIfStorageDirty() |
protected void |
checkOpenness()
Checks if the storage is open.
|
boolean |
cleanOutRecord(ORecordId recordId,
int recordVersion,
int iMode,
ORecordCallback<Boolean> callback) |
void |
clearIndex(int indexId) |
void |
clearProperties() |
protected void |
clearStorageDirty() |
void |
close(boolean force,
boolean onDelete) |
protected void |
closeClusters(boolean onDelete) |
protected void |
closeIndexes(OAtomicOperation atomicOperation,
boolean onDelete) |
Object |
command(OCommandRequestText iCommand)
Executes the command request and return the result back.
|
List<ORecordOperation> |
commit(OTransactionInternal clientTx)
Traditional commit that support already temporary rid and already assigned rids
|
protected 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.
|
List<ORecordOperation> |
commitPreAllocated(OTransactionInternal clientTx)
Commit a transaction where the rid where pre-allocated in a previous phase
|
protected abstract OLogSequenceNumber |
copyWALToIncrementalBackup(ZipOutputStream zipOutputStream,
long startSegment) |
long |
count(int iClusterId) |
long |
count(int[] iClusterIds) |
long |
count(int[] iClusterIds,
boolean countTombstones) |
long |
count(int clusterId,
boolean countTombstones) |
void |
create(OContextConfiguration contextConfiguration) |
OStorageOperationResult<OPhysicalPosition> |
createRecord(ORecordId rid,
byte[] content,
int recordVersion,
byte recordType,
ORecordCallback<Long> callback) |
protected abstract OWriteAheadLog |
createWalFromIBUFiles(File directory,
OContextConfiguration contextConfiguration,
Locale locale,
byte[] iv) |
protected abstract File |
createWalTempDirectory() |
void |
delete() |
void |
deleteIndexEngine(int indexId) |
OStorageOperationResult<Boolean> |
deleteRecord(ORecordId rid,
int version,
int mode,
ORecordCallback<Boolean> callback) |
boolean |
dropCluster(int clusterId)
Drops a cluster.
|
Object |
executeCommand(OCommandRequestText iCommand,
OCommandExecutor executor) |
static int |
extractEngineAPIVersion(int externalId) |
Optional<OBackgroundNewDelta> |
extractTransactionsFromWal(List<OTransactionId> transactionsMetadata) |
void |
fireConfigurationUpdateNotifications() |
OPhysicalPosition[] |
floorPhysicalPositions(int clusterId,
OPhysicalPosition physicalPosition) |
protected void |
flushAllData() |
void |
freeze(boolean throwException)
After this method finished it's execution, all threads that are going to perform data
modifications in storage should wait till
OFreezableStorageComponent.release() method will be called. |
void |
fullIncrementalBackup(OutputStream stream) |
protected void |
generateDatabaseInstanceId(OAtomicOperation atomicOperation) |
OAtomicOperationsManager |
getAtomicOperationsManager() |
long[] |
getClusterDataRange(int iClusterId)
Returns a pair of long values telling the begin and end positions of data in the requested
cluster.
|
String |
getClusterEncryption(int clusterId) |
int |
getClusterIdByName(String clusterName) |
Set<OCluster> |
getClusterInstances() |
String |
getClusterName(int clusterId) |
String |
getClusterNameById(int clusterId) |
Set<String> |
getClusterNames() |
long |
getClusterNextPosition(int clusterId) |
String |
getClusterRecordConflictStrategy(int clusterId) |
long |
getClusterRecordsSizeById(int clusterId) |
long |
getClusterRecordsSizeByName(String clusterName) |
int |
getClusters() |
OStorageConfiguration |
getConfiguration() |
String |
getCreatedAtVersion() |
int |
getDefaultClusterId() |
int |
getId() |
AtomicOperationIdGen |
getIdGen() |
Stream<ORawPair<Object,ORID>> |
getIndexDescStream(int indexId,
OBaseIndexEngine.ValuesTransformer valuesTransformer) |
Stream<Object> |
getIndexKeyStream(int indexId) |
String |
getIndexNameByKey(int indexId,
Object key) |
long |
getIndexSize(int indexId,
OBaseIndexEngine.ValuesTransformer transformer) |
Stream<ORawPair<Object,ORID>> |
getIndexStream(int indexId,
OBaseIndexEngine.ValuesTransformer valuesTransformer) |
Object |
getIndexValue(int indexId,
Object key) |
Stream<ORID> |
getIndexValues(int indexId,
Object key) |
protected abstract byte[] |
getIv() |
long |
getLastCloseTime() |
long |
getLastClusterPosition(int clusterId) |
Optional<byte[]> |
getLastMetadata() |
OLogSequenceNumber |
getLSN() |
String |
getMode() |
protected String |
getOpenedAtVersion() |
String |
getPhysicalClusterNameById(int iClusterId) |
OReadCache |
getReadCache() |
ORecordConflictStrategy |
getRecordConflictStrategy() |
ORecordMetadata |
getRecordMetadata(ORID rid) |
long |
getRecordScanned() |
OPaginatedCluster.RECORD_STATUS |
getRecordStatus(ORID rid) |
OStorageRecoverListener |
getRecoverListener() |
protected static Map<Integer,List<ORecordId>> |
getRidsGroupedByCluster(Collection<ORecordId> rids) |
OSBTreeCollectionManager |
getSBtreeCollectionManager() |
int |
getSessionCount() |
long |
getSize()
Returns the size of the database.
|
OStorageTransaction |
getStorageTransaction() |
UUID |
getUuid() |
OWriteAheadLog |
getWALInstance() |
OWriteCache |
getWriteCache() |
boolean |
hasIndexRangeQuerySupport(int indexId) |
OPhysicalPosition[] |
higherPhysicalPositions(int currentClusterId,
OPhysicalPosition physicalPosition) |
void |
incOnOpen() |
String |
incrementalBackup(String backupDirectory,
OCallable<Void,Void> started) |
protected void |
initConfiguration(OAtomicOperation atomicOperation,
OContextConfiguration contextConfiguration) |
protected abstract void |
initIv() |
protected abstract void |
initWalAndDiskCache(OContextConfiguration contextConfiguration) |
boolean |
isClosed() |
boolean |
isDeleted(ORID rid) |
protected boolean |
isDirty() |
protected boolean |
isInError() |
boolean |
isRemote() |
boolean |
isSystemCluster(int clusterId) |
protected abstract boolean |
isWriteAllowedDuringIncrementalBackup() |
Stream<ORawPair<Object,ORID>> |
iterateIndexEntriesBetween(int indexId,
Object rangeFrom,
boolean fromInclusive,
Object rangeTo,
boolean toInclusive,
boolean ascSortOrder,
OBaseIndexEngine.ValuesTransformer transformer) |
Stream<ORawPair<Object,ORID>> |
iterateIndexEntriesMajor(int indexId,
Object fromKey,
boolean isInclusive,
boolean ascSortOrder,
OBaseIndexEngine.ValuesTransformer transformer) |
Stream<ORawPair<Object,ORID>> |
iterateIndexEntriesMinor(int indexId,
Object toKey,
boolean isInclusive,
boolean ascSortOrder,
OBaseIndexEngine.ValuesTransformer transformer) |
int |
loadExternalIndexEngine(String engineName,
String algorithm,
String indexType,
OIndexDefinition indexDefinition,
OBinarySerializer<?> valueSerializer,
boolean isAutomatic,
Boolean durableInNonTxMode,
int version,
int apiVersion,
boolean multivalue,
Map<String,String> engineProperties) |
int |
loadIndexEngine(String name) |
protected Error |
logAndPrepareForRethrow(Error error) |
protected Error |
logAndPrepareForRethrow(Error error,
boolean putInReadOnlyMode) |
protected RuntimeException |
logAndPrepareForRethrow(RuntimeException runtimeException) |
protected RuntimeException |
logAndPrepareForRethrow(RuntimeException runtimeException,
boolean putInReadOnlyMode) |
protected RuntimeException |
logAndPrepareForRethrow(Throwable throwable) |
protected RuntimeException |
logAndPrepareForRethrow(Throwable throwable,
boolean putInReadOnlyMode) |
OPhysicalPosition[] |
lowerPhysicalPositions(int currentClusterId,
OPhysicalPosition physicalPosition) |
protected void |
makeFuzzyCheckpoint() |
protected void |
makeStorageDirty() |
void |
metadataOnly(byte[] metadata) |
void |
moveToErrorStateIfNeeded(Throwable error) |
void |
onException(Throwable e) |
void |
open(OContextConfiguration contextConfiguration) |
void |
open(OToken iToken,
OContextConfiguration configuration) |
void |
open(String iUserName,
String iUserPassword,
OContextConfiguration contextConfiguration) |
protected void |
openClusters(OAtomicOperation atomicOperation) |
protected void |
openIndexes() |
void |
pageIsBroken(String fileName,
long pageIndex)
Method is called by write cache when it is detected that data page in file is broken.
|
void |
pauseConfigurationUpdateNotifications() |
protected abstract void |
postCloseSteps(boolean onDelete,
boolean internalError,
long lastTxId) |
protected void |
postCloseStepsAfterLock(Map<String,Object> params) |
protected void |
postCreateSteps() |
protected void |
postDeleteSteps() |
void |
preallocateRids(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 Map<String,Object> |
preCloseSteps() |
protected void |
preCreateSteps() |
void |
putIndexValue(int indexId,
Object key,
Object value) |
void |
putRidIndexEntry(int indexId,
Object key,
ORID value) |
protected UUID |
readDatabaseInstanceId() |
protected abstract void |
readIv() |
OStorageOperationResult<ORawBuffer> |
readRecord(ORecordId rid,
String iFetchPlan,
boolean iIgnoreCache,
boolean prefetchRecords,
ORecordCallback<ORawBuffer> iCallback) |
OStorageOperationResult<ORawBuffer> |
readRecordIfVersionIsNotLatest(ORecordId rid,
String fetchPlan,
boolean ignoreCache,
int recordVersion) |
void |
registerRecoverListener(OStorageRecoverListener recoverListener) |
void |
release()
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.
|
void |
releaseReadLock(ORID rid) |
void |
releaseWriteLock(ORID rid) |
void |
reload() |
boolean |
removeKeyFromIndex(int indexId,
Object key) |
void |
removeProperty(String property) |
boolean |
removeRidIndexEntry(int indexId,
Object key,
ORID value) |
void |
requestCheckpoint() |
protected boolean |
restoreAtomicUnit(List<OWALRecord> atomicUnit,
OModifiableBoolean atLeastOnePageUpdate) |
protected OLogSequenceNumber |
restoreFrom(OWriteAheadLog writeAheadLog,
OLogSequenceNumber lsn) |
void |
restoreFromIncrementalBackup(String filePath) |
void |
restoreFullIncrementalBackup(InputStream stream) |
protected void |
serializeDeltaContent(OutputStream stream,
OCommandOutputListener outputListener,
SortedSet<ORID> sortedRids,
OLogSequenceNumber lsn) |
void |
setCharset(String charset) |
boolean |
setClusterAttribute(int id,
OCluster.ATTRIBUTES attribute,
Object value) |
boolean |
setClusterAttribute(String clusterName,
OCluster.ATTRIBUTES attribute,
Object value) |
void |
setClusterSelection(String clusterSelection) |
void |
setConflictStrategy(ORecordConflictStrategy conflictResolver) |
void |
setDateFormat(String dateFormat) |
void |
setDateTimeFormat(String dateTimeFormat) |
void |
setDefaultClusterId(int defaultClusterId) |
void |
setIndexMgrRecordId(String indexMgrRecordId) |
void |
setLocaleCountry(String localeCountry) |
void |
setLocaleLanguage(String locale) |
void |
setMinimumClusters(int minimumClusters) |
void |
setProperty(String property,
String value) |
void |
setRecordSerializer(String recordSerializer,
int version) |
void |
setSchemaRecordId(String schemaRecordId) |
void |
setStorageConfigurationUpdateListener(OStorageConfigurationUpdateListener storageConfigurationUpdateListener) |
void |
setTimeZone(TimeZone timeZoneValue) |
void |
setValidation(boolean validation) |
boolean |
supportIncremental() |
void |
synch() |
void |
tryToDeleteTreeRidBag(OSBTreeRidBag ridBag) |
void |
unregisterRecoverListener(OStorageRecoverListener recoverListener) |
void |
updateIndexEntry(int indexId,
Object key,
OIndexKeyUpdater<Object> valueCreator) |
OStorageOperationResult<Integer> |
updateRecord(ORecordId rid,
boolean updateContent,
byte[] content,
int version,
byte recordType,
int mode,
ORecordCallback<Integer> callback) |
boolean |
validatedPutIndexValue(int indexId,
Object key,
ORID value,
OBaseIndexEngine.Validator<Object,ORID> validator)
Puts the given value under the given key into this storage for the index with the given index
id.
|
boolean |
wereDataRestoredAfterOpen() |
boolean |
wereNonTxOperationsPerformedInPreviousOpen() |
close, countRecords, dropCluster, existsResource, getComponentsFactory, getName, getResource, getStatus, getUnderlying, getURL, getVersion, isAssigningClusterIds, isDistributed, normalizeName, removeResource, shutdown, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, countRecords, dropCluster, exists, getComponentsFactory, getName, getStatus, getType, getUnderlying, getVersion, isAssigningClusterIds, isDistributed, shutdownbackup, restoreexistsResource, getResource, removeResourcegetURLprotected static final ScheduledExecutorService fuzzyCheckpointExecutor
protected final OSBTreeCollectionManagerShared sbTreeCollectionManager
protected volatile OWriteAheadLog writeAheadLog
protected volatile OReadCache readCache
protected volatile OWriteCache writeCache
protected volatile OAtomicOperationsManager atomicOperationsManager
protected static final String DATABASE_INSTANCE_ID
protected AtomicOperationsTable atomicOperationsTable
public final void open(String iUserName, String iUserPassword, OContextConfiguration contextConfiguration)
public final void open(OContextConfiguration contextConfiguration)
protected abstract void readIv()
throws IOException
IOExceptionprotected abstract byte[] getIv()
public final String getCreatedAtVersion()
getCreatedAtVersion in interface OStorageprotected final void openIndexes()
protected final void openClusters(OAtomicOperation atomicOperation) throws IOException
IOExceptionpublic void open(OToken iToken, OContextConfiguration configuration)
public void create(OContextConfiguration contextConfiguration)
protected void generateDatabaseInstanceId(OAtomicOperation atomicOperation)
protected UUID readDatabaseInstanceId()
protected void checkDatabaseInstanceId(UUID backupUUID)
protected abstract void initIv()
throws IOException
IOExceptionpublic final boolean isClosed()
isClosed in interface OStorageisClosed in class OStorageAbstractpublic final void close(boolean force,
boolean onDelete)
close in interface OStorageclose in class OStorageAbstractpublic boolean check(boolean verbose,
OCommandOutputListener listener)
public final int addCluster(String clusterName, Object... parameters)
OStorageaddCluster in interface OStorageclusterName - name of the clusterpublic final int addCluster(String clusterName, int requestedId)
OStorageaddCluster in interface OStorageclusterName - name of the clusterrequestedId - requested id of the clusterpublic final boolean dropCluster(int clusterId)
OStoragedropCluster in interface OStorageclusterId - id of the cluster to deletepublic String getClusterNameById(int clusterId)
getClusterNameById in interface OStoragepublic long getClusterRecordsSizeById(int clusterId)
getClusterRecordsSizeById in interface OStoragepublic long getClusterRecordsSizeByName(String clusterName)
getClusterRecordsSizeByName in interface OStoragepublic String getClusterRecordConflictStrategy(int clusterId)
getClusterRecordConflictStrategy in interface OStoragepublic String getClusterEncryption(int clusterId)
getClusterEncryption in interface OStoragepublic boolean isSystemCluster(int clusterId)
isSystemCluster in interface OStoragepublic long getLastClusterPosition(int clusterId)
getLastClusterPosition in interface OStoragepublic long getClusterNextPosition(int clusterId)
getClusterNextPosition in interface OStoragepublic OPaginatedCluster.RECORD_STATUS getRecordStatus(ORID rid)
getRecordStatus in interface OStoragepublic final int getId()
getId in interface OIdentifiableStoragepublic UUID getUuid()
public final OSBTreeCollectionManager getSBtreeCollectionManager()
getSBtreeCollectionManager in interface OStoragepublic OReadCache getReadCache()
public OWriteCache getWriteCache()
public final long count(int clusterId,
boolean countTombstones)
public final long[] getClusterDataRange(int iClusterId)
OStoragegetClusterDataRange in interface OStorageiClusterId - Cluster idpublic OLogSequenceNumber getLSN()
public final void onException(Throwable e)
onException in interface OBackgroundExceptionListenerpublic Optional<OBackgroundNewDelta> extractTransactionsFromWal(List<OTransactionId> transactionsMetadata)
protected void serializeDeltaContent(OutputStream stream, OCommandOutputListener outputListener, SortedSet<ORID> sortedRids, OLogSequenceNumber lsn)
public final long count(int[] iClusterIds,
boolean countTombstones)
public final OStorageOperationResult<OPhysicalPosition> createRecord(ORecordId rid, byte[] content, int recordVersion, byte recordType, ORecordCallback<Long> callback)
public final ORecordMetadata getRecordMetadata(ORID rid)
getRecordMetadata in interface OStoragepublic boolean isDeleted(ORID rid)
public Iterator<OClusterBrowsePage> browseCluster(int clusterId)
public OStorageOperationResult<ORawBuffer> readRecord(ORecordId rid, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords, ORecordCallback<ORawBuffer> iCallback)
readRecord in interface OStoragepublic final OStorageOperationResult<ORawBuffer> readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) throws ORecordNotFoundException
readRecordIfVersionIsNotLatest in interface OStorageORecordNotFoundExceptionpublic final OStorageOperationResult<Integer> updateRecord(ORecordId rid, boolean updateContent, byte[] content, int version, byte recordType, int mode, ORecordCallback<Integer> callback)
public OStorageTransaction getStorageTransaction()
public final OAtomicOperationsManager getAtomicOperationsManager()
public OWriteAheadLog getWALInstance()
public AtomicOperationIdGen getIdGen()
public final OStorageOperationResult<Boolean> deleteRecord(ORecordId rid, int version, int mode, ORecordCallback<Boolean> callback)
deleteRecord in interface OStoragepublic final Set<String> getClusterNames()
getClusterNames in interface OStoragegetClusterNames in interface OStorageInfopublic final int getClusterIdByName(String clusterName)
getClusterIdByName in interface OStoragepublic void preallocateRids(OTransactionInternal clientTx)
clientTx - the transaction of witch allocate ridspublic List<ORecordOperation> commit(OTransactionInternal clientTx)
public List<ORecordOperation> commitPreAllocated(OTransactionInternal clientTx)
clientTx - the pre-allocated transaction to commitprotected List<ORecordOperation> commit(OTransactionInternal transaction, boolean allocated)
transaction - the transaction to commitallocated - true if the operation is pre-allocated commitpublic int loadIndexEngine(String name)
public int loadExternalIndexEngine(String engineName, String algorithm, String indexType, OIndexDefinition indexDefinition, OBinarySerializer<?> valueSerializer, boolean isAutomatic, Boolean durableInNonTxMode, int version, int apiVersion, boolean multivalue, Map<String,String> engineProperties)
public int addIndexEngine(String engineName, String algorithm, String indexType, OIndexDefinition indexDefinition, OBinarySerializer<?> valueSerializer, boolean isAutomatic, Boolean durableInNonTxMode, int version, int apiVersion, boolean multivalue, Map<String,String> engineProperties, Set<String> clustersToIndex, ODocument metadata)
public static int extractEngineAPIVersion(int externalId)
public void deleteIndexEngine(int indexId)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic boolean removeKeyFromIndex(int indexId,
Object key)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic void clearIndex(int indexId)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic Object getIndexValue(int indexId, Object key) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic Stream<ORID> getIndexValues(int indexId, Object key) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic String getIndexNameByKey(int indexId, Object key) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic boolean acquireIndexEngineExclusiveLock(int indexId,
Object key)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic void updateIndexEntry(int indexId,
Object key,
OIndexKeyUpdater<Object> valueCreator)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic <T> T callIndexEngine(boolean readOperation,
int indexId,
OIndexEngineCallback<T> callback)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic void putRidIndexEntry(int indexId,
Object key,
ORID value)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic boolean removeRidIndexEntry(int indexId,
Object key,
ORID value)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic void putIndexValue(int indexId,
Object key,
Object value)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic boolean validatedPutIndexValue(int indexId,
Object key,
ORID value,
OBaseIndexEngine.Validator<Object,ORID> validator)
throws OInvalidIndexEngineIdException
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.true if the validator allowed the put, false otherwise.OInvalidIndexEngineIdExceptionOBaseIndexEngine.Validator#validate(Object, Object, Object)public Stream<ORawPair<Object,ORID>> iterateIndexEntriesBetween(int indexId, Object rangeFrom, boolean fromInclusive, Object rangeTo, boolean toInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic Stream<ORawPair<Object,ORID>> iterateIndexEntriesMajor(int indexId, Object fromKey, boolean isInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic Stream<ORawPair<Object,ORID>> iterateIndexEntriesMinor(int indexId, Object toKey, boolean isInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic Stream<ORawPair<Object,ORID>> getIndexStream(int indexId, OBaseIndexEngine.ValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic Stream<ORawPair<Object,ORID>> getIndexDescStream(int indexId, OBaseIndexEngine.ValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic Stream<Object> getIndexKeyStream(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic long getIndexSize(int indexId,
OBaseIndexEngine.ValuesTransformer transformer)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic boolean hasIndexRangeQuerySupport(int indexId)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic void moveToErrorStateIfNeeded(Throwable error)
public final boolean checkForRecordValidity(OPhysicalPosition ppos)
checkForRecordValidity in interface OStoragecheckForRecordValidity in class OStorageAbstractpublic final String getPhysicalClusterNameById(int iClusterId)
getPhysicalClusterNameById in interface OStoragepublic final int getDefaultClusterId()
getDefaultClusterId in interface OStorageInfopublic final void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId in interface OStoragepublic String getClusterName(int clusterId)
getClusterName in interface OStoragepublic final long getSize()
OStoragepublic final int getClusters()
getClusters in interface OStorageInfopublic final Set<OCluster> getClusterInstances()
getClusterInstances in interface OStoragepublic final boolean cleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback)
cleanOutRecord in interface OStoragepublic final void freeze(boolean throwException)
OFreezableStorageComponentOFreezableStorageComponent.release() method will be called. This method
will wait till all ongoing modifications will be finished.freeze in interface OFreezableStorageComponentthrowException - If true OModificationOperationProhibitedException
exception will be thrown on call of methods that requires storage modification. Otherwise
other threads will wait for OFreezableStorageComponent.release() method call.public final void release()
OFreezableStorageComponentrelease in interface OFreezableStorageComponentpublic boolean wereDataRestoredAfterOpen()
public boolean wereNonTxOperationsPerformedInPreviousOpen()
public String getMode()
public final void pageIsBroken(String fileName, long pageIndex)
OPageIsBrokenListenerpageIsBroken in interface OPageIsBrokenListenerfileName - Name of broken file.pageIndex - Index of page which is broken in file.public final void requestCheckpoint()
requestCheckpoint in interface OCheckpointRequestListenerpublic final Object command(OCommandRequestText iCommand)
public final Object executeCommand(OCommandRequestText iCommand, OCommandExecutor executor)
public final OPhysicalPosition[] higherPhysicalPositions(int currentClusterId, OPhysicalPosition physicalPosition)
higherPhysicalPositions in interface OStoragepublic final OPhysicalPosition[] ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
ceilingPhysicalPositions in interface OStoragepublic final OPhysicalPosition[] lowerPhysicalPositions(int currentClusterId, OPhysicalPosition physicalPosition)
lowerPhysicalPositions in interface OStoragepublic final OPhysicalPosition[] floorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
floorPhysicalPositions in interface OStoragepublic void acquireWriteLock(ORID rid, long timeout)
public final void acquireWriteLock(ORID rid)
public final void releaseWriteLock(ORID rid)
public final void acquireReadLock(ORID rid)
public void acquireReadLock(ORID rid, long timeout)
public final void releaseReadLock(ORID rid)
public final ORecordConflictStrategy getRecordConflictStrategy()
getRecordConflictStrategy in interface OStoragepublic final void setConflictStrategy(ORecordConflictStrategy conflictResolver)
setConflictStrategy in interface OStoragepublic long getRecordScanned()
protected abstract OLogSequenceNumber copyWALToIncrementalBackup(ZipOutputStream zipOutputStream, long startSegment) throws IOException
IOExceptionprotected abstract boolean isWriteAllowedDuringIncrementalBackup()
public OStorageRecoverListener getRecoverListener()
public void registerRecoverListener(OStorageRecoverListener recoverListener)
public void unregisterRecoverListener(OStorageRecoverListener recoverListener)
protected abstract File createWalTempDirectory()
protected abstract void addFileToDirectory(String name, InputStream stream, File directory) throws IOException
IOExceptionprotected abstract OWriteAheadLog createWalFromIBUFiles(File directory, OContextConfiguration contextConfiguration, Locale locale, byte[] iv) throws IOException
IOExceptionprotected final void checkOpenness()
public void checkErrorState()
protected boolean isInError()
protected final void makeFuzzyCheckpoint()
public void tryToDeleteTreeRidBag(OSBTreeRidBag ridBag)
protected void flushAllData()
protected OAbstractPaginatedStorage.StartupMetadata checkIfStorageDirty() throws IOException
IOExceptionprotected void initConfiguration(OAtomicOperation atomicOperation, OContextConfiguration contextConfiguration) throws IOException
IOExceptionprotected final void postCreateSteps()
protected void preCreateSteps()
throws IOException
IOExceptionprotected abstract void initWalAndDiskCache(OContextConfiguration contextConfiguration) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected abstract void postCloseSteps(boolean onDelete,
boolean internalError,
long lastTxId)
throws IOException
IOExceptionprotected void postDeleteSteps()
protected void makeStorageDirty()
throws IOException
IOExceptionprotected void clearStorageDirty()
throws IOException
IOExceptionprotected boolean isDirty()
protected String getOpenedAtVersion()
public void metadataOnly(byte[] metadata)
public boolean setClusterAttribute(int id,
OCluster.ATTRIBUTES attribute,
Object value)
setClusterAttribute in interface OStoragepublic boolean setClusterAttribute(String clusterName, OCluster.ATTRIBUTES attribute, Object value)
setClusterAttribute in interface OStorageprotected void closeClusters(boolean onDelete)
throws IOException
IOExceptionprotected void closeIndexes(OAtomicOperation atomicOperation, boolean onDelete)
public String incrementalBackup(String backupDirectory, OCallable<Void,Void> started) throws UnsupportedOperationException
incrementalBackup in interface OStorageUnsupportedOperationExceptionpublic boolean supportIncremental()
supportIncremental in interface OStoragepublic void fullIncrementalBackup(OutputStream stream) throws UnsupportedOperationException
fullIncrementalBackup in interface OStorageUnsupportedOperationExceptionpublic void restoreFromIncrementalBackup(String filePath)
restoreFromIncrementalBackup in interface OStoragepublic void restoreFullIncrementalBackup(InputStream stream) throws UnsupportedOperationException
restoreFullIncrementalBackup in interface OStorageUnsupportedOperationExceptionprotected OLogSequenceNumber restoreFrom(OWriteAheadLog writeAheadLog, OLogSequenceNumber lsn) throws IOException
IOExceptionprotected final boolean restoreAtomicUnit(List<OWALRecord> atomicUnit, OModifiableBoolean atLeastOnePageUpdate) throws IOException
IOExceptionpublic void setStorageConfigurationUpdateListener(OStorageConfigurationUpdateListener storageConfigurationUpdateListener)
public void pauseConfigurationUpdateNotifications()
public void fireConfigurationUpdateNotifications()
protected static Map<Integer,List<ORecordId>> getRidsGroupedByCluster(Collection<ORecordId> rids)
protected final RuntimeException logAndPrepareForRethrow(RuntimeException runtimeException)
protected RuntimeException logAndPrepareForRethrow(RuntimeException runtimeException, boolean putInReadOnlyMode)
protected Error logAndPrepareForRethrow(Error error, boolean putInReadOnlyMode)
protected final RuntimeException logAndPrepareForRethrow(Throwable throwable)
protected RuntimeException logAndPrepareForRethrow(Throwable throwable, boolean putInReadOnlyMode)
public final OStorageConfiguration getConfiguration()
getConfiguration in interface OStorageInfogetConfiguration in class OStorageAbstractpublic final void setSchemaRecordId(String schemaRecordId)
setSchemaRecordId in interface OStoragepublic final void setDateFormat(String dateFormat)
setDateFormat in interface OStoragepublic final void setTimeZone(TimeZone timeZoneValue)
setTimeZone in interface OStoragepublic final void setLocaleLanguage(String locale)
setLocaleLanguage in interface OStoragepublic final void setCharset(String charset)
setCharset in interface OStoragepublic final void setIndexMgrRecordId(String indexMgrRecordId)
setIndexMgrRecordId in interface OStoragepublic final void setDateTimeFormat(String dateTimeFormat)
setDateTimeFormat in interface OStoragepublic final void setLocaleCountry(String localeCountry)
setLocaleCountry in interface OStoragepublic final void setClusterSelection(String clusterSelection)
setClusterSelection in interface OStoragepublic final void setMinimumClusters(int minimumClusters)
setMinimumClusters in interface OStoragepublic final void setValidation(boolean validation)
setValidation in interface OStoragepublic final void removeProperty(String property)
removeProperty in interface OStoragepublic final void setProperty(String property, String value)
setProperty in interface OStoragepublic final void setRecordSerializer(String recordSerializer, int version)
setRecordSerializer in interface OStoragepublic final void clearProperties()
clearProperties in interface OStoragepublic Optional<byte[]> getLastMetadata()
public void incOnOpen()
public int getSessionCount()
public long getLastCloseTime()
Copyright © 2009–2025 OrientDB. All rights reserved.