
public abstract class OAbstractPaginatedStorage extends OStorageAbstract implements OLowDiskSpaceListener, OCheckpointRequestListener, OIdentifiableStorage, OBackgroundExceptionListener, OFreezableStorageComponent, OPageIsBrokenListener
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 OScheduledThreadPoolExecutorWithLogging |
fuzzyCheckpointExecutor |
protected OStorageInterruptionManager |
interruptionManager |
protected OReadCache |
readCache |
protected OSBTreeCollectionManagerShared |
sbTreeCollectionManager |
protected OWriteAheadLog |
writeAheadLog |
protected OWriteCache |
writeCache |
componentsFactory, configuration, 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 |
|---|---|
void |
acquireReadLock(ORID rid) |
void |
acquireWriteLock(ORID rid) |
int |
addCluster(String clusterName,
int requestedId,
Object... parameters)
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 atomicOperation,
boolean readOperation,
int indexId,
OIndexEngineCallback<T> callback) |
OPhysicalPosition[] |
ceilingPhysicalPositions(int clusterId,
OPhysicalPosition physicalPosition) |
boolean |
check(boolean verbose,
OCommandOutputListener listener) |
protected void |
checkDatabaseInstanceId(UUID backupUUID) |
boolean |
checkForRecordValidity(OPhysicalPosition ppos) |
protected long |
checkIfStorageDirty() |
protected void |
checkOpenness()
Checks if the storage is open.
|
void |
checkReadOnlyConditions() |
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(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
|
OSessionStoragePerformanceStatistic |
completeGatheringPerformanceStatisticForCurrentThread()
Completes gathering performance characteristics for current thread initiated by call of
startGatheringPerformanceStatisticForCurrentThread() |
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) |
long |
countRecords()
Returns the total number of records.
|
void |
create(OContextConfiguration contextConfiguration) |
OStorageOperationResult<OPhysicalPosition> |
createRecord(ORecordId rid,
byte[] content,
int recordVersion,
byte recordType,
int mode,
ORecordCallback<Long> callback) |
protected abstract OWriteAheadLog |
createWalFromIBUFiles(File directory,
OContextConfiguration contextConfiguration,
Locale locale) |
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,
boolean iTruncate)
Drops a cluster.
|
Object |
executeCommand(OCommandRequestText iCommand,
OCommandExecutor executor) |
static int |
extractEngineAPIVersion(int externalId) |
void |
fireConfigurationUpdateNotifications() |
OPhysicalPosition[] |
floorPhysicalPositions(int clusterId,
OPhysicalPosition physicalPosition) |
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) |
String |
getClusterNameById(int clusterId) |
Set<String> |
getClusterNames() |
long |
getClusterNextPosition(int clusterId) |
ORecordConflictStrategy |
getClusterRecordConflictStrategy() |
String |
getClusterRecordConflictStrategy(int clusterId) |
long |
getClusterRecordsSizeById(int clusterId) |
long |
getClusterRecordsSizeByName(String clusterName) |
int |
getClusters() |
OStorageConfiguration |
getConfiguration() |
String |
getCreatedAtVersion() |
int |
getDefaultClusterId() |
long |
getFullCheckpointCount() |
int |
getId() |
AtomicOperationIdGen |
getIdGen() |
OIndexCursor |
getIndexCursor(int indexId,
OBaseIndexEngine.ValuesTransformer valuesTransformer) |
OIndexCursor |
getIndexDescCursor(int indexId,
OBaseIndexEngine.ValuesTransformer valuesTransformer) |
OBaseIndexEngine |
getIndexEngine(int indexId) |
Object |
getIndexFirstKey(int indexId) |
OIndexKeyCursor |
getIndexKeyCursor(int indexId) |
Object |
getIndexLastKey(int indexId) |
long |
getIndexSize(int indexId,
OBaseIndexEngine.ValuesTransformer transformer) |
Object |
getIndexValue(int indexId,
Object key) |
long |
getLastCloseTime() |
long |
getLastClusterPosition(int clusterId) |
OLogSequenceNumber |
getLSN() |
String |
getMode() |
protected OPerformanceStatisticManager |
getPerformanceStatisticManager() |
String |
getPhysicalClusterNameById(int iClusterId) |
OReadCache |
getReadCache() |
ORecordMetadata |
getRecordMetadata(ORID rid) |
AtomicLong |
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() |
OWriteAheadLog |
getWALInstance() |
OWriteCache |
getWriteCache() |
void |
handleJVMError(Error e)
That is internal method which is called once we encounter any error inside of JVM.
|
boolean |
hasIndexRangeQuerySupport(int indexId) |
OStorageOperationResult<Boolean> |
hideRecord(ORecordId rid,
int mode,
ORecordCallback<Boolean> callback) |
OPhysicalPosition[] |
higherPhysicalPositions(int currentClusterId,
OPhysicalPosition physicalPosition) |
void |
incOnOpen() |
String |
incrementalBackup(String backupDirectory,
OCallable<Void,Void> started) |
boolean |
indexContainsKey(int indexId,
Object key) |
protected void |
initConfiguration(OAtomicOperation atomicOperation,
OContextConfiguration contextConfiguration) |
protected abstract void |
initWalAndDiskCache(OContextConfiguration contextConfiguration) |
void |
interruptExecution(Thread thread)
forces interruption of this execution
|
boolean |
isClosed() |
boolean |
isDeleted(ORID rid) |
protected boolean |
isDirty() |
boolean |
isRemote() |
boolean |
isSystemCluster(int clusterId) |
protected abstract boolean |
isWriteAllowedDuringIncrementalBackup() |
OIndexCursor |
iterateIndexEntriesBetween(int indexId,
Object rangeFrom,
boolean fromInclusive,
Object rangeTo,
boolean toInclusive,
boolean ascSortOrder,
OBaseIndexEngine.ValuesTransformer transformer) |
OIndexCursor |
iterateIndexEntriesMajor(int indexId,
Object fromKey,
boolean isInclusive,
boolean ascSortOrder,
OBaseIndexEngine.ValuesTransformer transformer) |
OIndexCursor |
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 RuntimeException |
logAndPrepareForRethrow(RuntimeException runtimeException) |
protected RuntimeException |
logAndPrepareForRethrow(Throwable throwable) |
void |
lowDiskSpace(OLowDiskSpaceInformation information) |
OPhysicalPosition[] |
lowerPhysicalPositions(int currentClusterId,
OPhysicalPosition physicalPosition) |
protected void |
makeFullCheckpoint() |
protected void |
makeFuzzyCheckpoint() |
protected void |
makeStorageDirty() |
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() |
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 jvmError,
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() |
OStorageOperationResult<ORawBuffer> |
readRecord(ORecordId iRid,
String iFetchPlan,
boolean iIgnoreCache,
boolean prefetchRecords,
ORecordCallback<ORawBuffer> iCallback) |
OStorageOperationResult<ORawBuffer> |
readRecordIfVersionIsNotLatest(ORecordId rid,
String fetchPlan,
boolean ignoreCache,
int recordVersion) |
OBackgroundDelta |
recordsChangedAfterLSN(OLogSequenceNumber lsn,
OCommandOutputListener outputListener)
This method finds all the records which were updated starting from (but not including) current LSN and write result in provided
output stream.
|
Set<ORecordId> |
recordsChangedRecently(int maxEntries)
This method finds all the records changed in the last X transactions.
|
OStorageOperationResult<Integer> |
recyclePosition(ORecordId rid,
byte[] content,
int version,
byte recordType)
Resurrects a record that was previously deleted, with a new content.
|
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 |
renameCluster(String oldName,
String newName)
Method that completes the cluster rename operation.
|
void |
requestCheckpoint() |
protected boolean |
restoreAtomicUnit(List<OWALRecord> atomicUnit,
OModifiableBoolean atLeastOnePageUpdate) |
protected OLogSequenceNumber |
restoreFrom(OLogSequenceNumber lsn,
OWriteAheadLog writeAheadLog) |
void |
restoreFromIncrementalBackup(String filePath) |
void |
restoreFullIncrementalBackup(InputStream stream) |
void |
rollback(OMicroTransaction microTransaction)
Rollbacks the given micro-transaction.
|
void |
rollback(OTransactionInternal clientTx) |
protected void |
serializeDeltaContent(OutputStream stream,
OCommandOutputListener outputListener,
SortedSet<ORID> sortedRids,
OLogSequenceNumber lsn) |
void |
setCharset(String charset) |
void |
setClusterAttribute(int clusterId,
OCluster.ATTRIBUTES attribute,
Object value) |
Object |
setClusterAttribute(String clusterName,
OCluster.ATTRIBUTES attribute,
Object value) |
void |
setClusterSelection(String clusterSelection) |
boolean |
setClusterStatus(OAtomicOperation atomicOperation,
OCluster cluster,
OStorageClusterConfiguration.STATUS status)
INTERNAL METHOD !!!
|
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) |
void |
startGatheringPerformanceStatisticForCurrentThread()
Starts to gather information about storage performance for current thread.
|
boolean |
supportIncremental() |
void |
synch() |
void |
truncateCluster(String clusterName) |
void |
tryToDeleteTreeRidBag(OSBTreeRidBag ridBag) |
void |
underDistributedStorage()
This method is called by distributed storage during initialization to indicate that database is used in distributed cluster
configuration
|
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, dropCluster, existsResource, getComponentsFactory, getName, getResource, getStatus, getUnderlying, getURL, getVersion, isAssigningClusterIds, isDistributed, normalizeName, removeResource, shutdown, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, dropCluster, exists, getComponentsFactory, getName, getStatus, getType, getUnderlying, getURL, getVersion, isAssigningClusterIds, isDistributed, shutdownbackup, restoreexistsResource, getResource, removeResourceprotected static final OScheduledThreadPoolExecutorWithLogging fuzzyCheckpointExecutor
protected OStorageInterruptionManager interruptionManager
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)
public final void handleJVMError(Error e)
public void underDistributedStorage()
public final String getCreatedAtVersion()
getCreatedAtVersion in interface OStorageprotected final void openIndexes()
protected final void openClusters()
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)
public 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, Object... parameters)
OStorageaddCluster in interface OStorageclusterName - name of the clusterrequestedId - requested id of the clusterpublic final boolean dropCluster(int clusterId,
boolean iTruncate)
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 boolean isSystemCluster(int clusterId)
isSystemCluster in interface OStoragepublic long getLastClusterPosition(int clusterId)
getLastClusterPosition in interface OStoragepublic void setClusterAttribute(int clusterId,
OCluster.ATTRIBUTES attribute,
Object value)
setClusterAttribute in interface OStoragepublic Object setClusterAttribute(String clusterName, OCluster.ATTRIBUTES attribute, Object value)
setClusterAttribute in interface OStoragepublic String getClusterRecordConflictStrategy(int clusterId)
getClusterRecordConflictStrategy in interface OStoragepublic String getClusterEncryption(int clusterId)
getClusterEncryption in interface OStoragepublic void truncateCluster(String clusterName)
truncateCluster in interface OStoragepublic long countRecords()
OStoragecountRecords in interface OStoragecountRecords in class OStorageAbstractpublic 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 final boolean setClusterStatus(OAtomicOperation atomicOperation, OCluster cluster, OStorageClusterConfiguration.STATUS status) throws IOException
IOExceptionpublic 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 OBackgroundDelta recordsChangedAfterLSN(OLogSequenceNumber lsn, OCommandOutputListener outputListener)
lsn - LSN from which we should find changed recordsnull if it was impossible to find changed
records: write ahead log is absent, record with start LSN was not found in WAL, etc.OGlobalConfiguration.STORAGE_TRACK_CHANGED_RECORDS_IN_WALprotected void serializeDeltaContent(OutputStream stream, OCommandOutputListener outputListener, SortedSet<ORID> sortedRids, OLogSequenceNumber lsn)
public Set<ORecordId> recordsChangedRecently(int maxEntries)
maxEntries - Maximum number of entries to check back from last log.OGlobalConfiguration.STORAGE_TRACK_CHANGED_RECORDS_IN_WALpublic final long count(int[] iClusterIds,
boolean countTombstones)
public final OStorageOperationResult<OPhysicalPosition> createRecord(ORecordId rid, byte[] content, int recordVersion, byte recordType, int mode, ORecordCallback<Long> callback)
createRecord in interface OStoragepublic final ORecordMetadata getRecordMetadata(ORID rid)
getRecordMetadata in interface OStoragepublic boolean isDeleted(ORID rid)
public Iterator<OClusterBrowsePage> browseCluster(int clusterId)
public OStorageOperationResult<ORawBuffer> readRecord(ORecordId iRid, 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 final OStorageOperationResult<Integer> recyclePosition(ORecordId rid, byte[] content, int version, byte recordType)
OStoragerecyclePosition in interface OStoragepublic 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 OStorageOperationResult<Boolean> hideRecord(ORecordId rid, int mode, ORecordCallback<Boolean> callback)
hideRecord in interface OStorageprotected OPerformanceStatisticManager getPerformanceStatisticManager()
public void startGatheringPerformanceStatisticForCurrentThread()
OSessionStoragePerformanceStatistic.public OSessionStoragePerformanceStatistic completeGatheringPerformanceStatisticForCurrentThread()
startGatheringPerformanceStatisticForCurrentThread()startGatheringPerformanceStatisticForCurrentThread() or
null if profiling of storage was not started.public final Set<String> getClusterNames()
getClusterNames in interface OStoragepublic 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 indexContainsKey(int indexId,
Object key)
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 OBaseIndexEngine getIndexEngine(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic void updateIndexEntry(int indexId,
Object key,
OIndexKeyUpdater<Object> valueCreator)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic <T> T callIndexEngine(boolean atomicOperation,
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 Object getIndexFirstKey(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic Object getIndexLastKey(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic OIndexCursor iterateIndexEntriesBetween(int indexId, Object rangeFrom, boolean fromInclusive, Object rangeTo, boolean toInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic OIndexCursor iterateIndexEntriesMajor(int indexId, Object fromKey, boolean isInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic OIndexCursor iterateIndexEntriesMinor(int indexId, Object toKey, boolean isInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic OIndexCursor getIndexCursor(int indexId, OBaseIndexEngine.ValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic OIndexCursor getIndexDescCursor(int indexId, OBaseIndexEngine.ValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic OIndexKeyCursor getIndexKeyCursor(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic long getIndexSize(int indexId,
OBaseIndexEngine.ValuesTransformer transformer)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic boolean hasIndexRangeQuerySupport(int indexId)
throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdExceptionpublic void rollback(OTransactionInternal clientTx)
public void rollback(OMicroTransaction microTransaction)
microTransaction - the micro-transaction to rollback.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 OStoragepublic final void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId in interface OStoragepublic final long getSize()
OStoragepublic final int getClusters()
getClusters in interface OStoragepublic final void renameCluster(String oldName, String newName)
public 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 lowDiskSpace(OLowDiskSpaceInformation information)
lowDiskSpace in interface OLowDiskSpaceListenerpublic 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 final void acquireWriteLock(ORID rid)
public final void releaseWriteLock(ORID rid)
public final void acquireReadLock(ORID rid)
public final void releaseReadLock(ORID rid)
public final ORecordConflictStrategy getClusterRecordConflictStrategy()
getClusterRecordConflictStrategy in interface OStoragepublic final void setConflictStrategy(ORecordConflictStrategy conflictResolver)
setConflictStrategy in interface OStoragepublic AtomicLong 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) throws IOException
IOExceptionprotected final void checkOpenness()
protected final void makeFuzzyCheckpoint()
public void tryToDeleteTreeRidBag(OSBTreeRidBag ridBag)
protected void makeFullCheckpoint()
public long getFullCheckpointCount()
protected long 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 jvmError,
long lastTxId)
throws IOException
IOExceptionprotected void postDeleteSteps()
protected void makeStorageDirty()
throws IOException
IOExceptionprotected void clearStorageDirty()
throws IOException
IOExceptionprotected boolean isDirty()
protected void closeClusters(boolean onDelete)
throws IOException
IOExceptionprotected void closeIndexes(boolean onDelete)
throws IOException
IOExceptionpublic 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 final OLogSequenceNumber restoreFrom(OLogSequenceNumber lsn, OWriteAheadLog writeAheadLog) throws IOException
IOExceptionprotected final boolean restoreAtomicUnit(List<OWALRecord> atomicUnit, OModifiableBoolean atLeastOnePageUpdate) throws IOException
IOExceptionpublic final void checkReadOnlyConditions()
public 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 final RuntimeException logAndPrepareForRethrow(Throwable throwable)
public final OStorageConfiguration getConfiguration()
getConfiguration in interface OStoragegetConfiguration 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 void incOnOpen()
public int getSessionCount()
public long getLastCloseTime()
public void interruptExecution(Thread thread)
thread - The thread where this storage instance is running (has to be provided from higher
level)Copyright © 2009–2025 OrientDB. All rights reserved.