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 OScheduledThreadPoolExecutorWithLogging |
fuzzyCheckpointExecutor |
protected OReadCache |
readCache |
protected OSBTreeCollectionManagerShared |
sbTreeCollectionManager |
protected OWriteAheadLog |
writeAheadLog |
protected OWriteCache |
writeCache |
componentsFactory, configuration, mode, name, sharedContainer, stateLock, status, storageThreadGroup, url
CLUSTER_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) |
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) |
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) |
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) |
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 void |
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) |
void |
rollbackOperationsFromThread(Thread thread) |
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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, dropCluster, exists, getComponentsFactory, getName, getStatus, getType, getUnderlying, getURL, getVersion, isAssigningClusterIds, isDistributed, shutdown
backup, restore
existsResource, getResource, removeResource
protected static final OScheduledThreadPoolExecutorWithLogging fuzzyCheckpointExecutor
protected final OSBTreeCollectionManagerShared sbTreeCollectionManager
protected volatile OWriteAheadLog writeAheadLog
protected volatile OReadCache readCache
protected volatile OWriteCache writeCache
protected volatile OAtomicOperationsManager atomicOperationsManager
protected AtomicOperationsTable atomicOperationsTable
public final void open(String iUserName, String iUserPassword, OContextConfiguration contextConfiguration)
public final void open(OContextConfiguration contextConfiguration)
public void rollbackOperationsFromThread(Thread thread)
public final void handleJVMError(Error e)
public void underDistributedStorage()
public final String getCreatedAtVersion()
getCreatedAtVersion
in interface OStorage
protected final void openIndexes()
protected final void openClusters() throws IOException
IOException
public void open(OToken iToken, OContextConfiguration configuration)
public void create(OContextConfiguration contextConfiguration)
public final boolean isClosed()
isClosed
in interface OStorage
isClosed
in class OStorageAbstract
public final void close(boolean force, boolean onDelete)
close
in interface OStorage
close
in class OStorageAbstract
public boolean check(boolean verbose, OCommandOutputListener listener)
public final int addCluster(String clusterName, Object... parameters)
OStorage
addCluster
in interface OStorage
clusterName
- name of the clusterpublic final int addCluster(String clusterName, int requestedId, Object... parameters)
OStorage
addCluster
in interface OStorage
clusterName
- name of the clusterrequestedId
- requested id of the clusterpublic final boolean dropCluster(int clusterId, boolean iTruncate)
OStorage
dropCluster
in interface OStorage
clusterId
- id of the cluster to deletepublic String getClusterNameById(int clusterId)
getClusterNameById
in interface OStorage
public long getClusterRecordsSizeById(int clusterId)
getClusterRecordsSizeById
in interface OStorage
public long getClusterRecordsSizeByName(String clusterName)
getClusterRecordsSizeByName
in interface OStorage
public boolean isSystemCluster(int clusterId)
isSystemCluster
in interface OStorage
public long getLastClusterPosition(int clusterId)
getLastClusterPosition
in interface OStorage
public void setClusterAttribute(int clusterId, OCluster.ATTRIBUTES attribute, Object value)
setClusterAttribute
in interface OStorage
public Object setClusterAttribute(String clusterName, OCluster.ATTRIBUTES attribute, Object value)
setClusterAttribute
in interface OStorage
public String getClusterRecordConflictStrategy(int clusterId)
getClusterRecordConflictStrategy
in interface OStorage
public String getClusterEncryption(int clusterId)
getClusterEncryption
in interface OStorage
public void truncateCluster(String clusterName)
truncateCluster
in interface OStorage
public long countRecords()
OStorage
countRecords
in interface OStorage
countRecords
in class OStorageAbstract
public long getClusterNextPosition(int clusterId)
getClusterNextPosition
in interface OStorage
public OPaginatedCluster.RECORD_STATUS getRecordStatus(ORID rid)
getRecordStatus
in interface OStorage
public final int getId()
getId
in interface OIdentifiableStorage
public final boolean setClusterStatus(OAtomicOperation atomicOperation, OCluster cluster, OStorageClusterConfiguration.STATUS status) throws IOException
IOException
public final OSBTreeCollectionManager getSBtreeCollectionManager()
getSBtreeCollectionManager
in interface OStorage
public OReadCache getReadCache()
public OWriteCache getWriteCache()
public final long count(int clusterId, boolean countTombstones)
public final long[] getClusterDataRange(int iClusterId)
OStorage
getClusterDataRange
in interface OStorage
iClusterId
- Cluster idpublic OLogSequenceNumber getLSN()
public final void onException(Throwable e)
onException
in interface OBackgroundExceptionListener
public 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_WAL
protected 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_WAL
public 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 OStorage
public final ORecordMetadata getRecordMetadata(ORID rid)
getRecordMetadata
in interface OStorage
public 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 OStorage
public final OStorageOperationResult<ORawBuffer> readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) throws ORecordNotFoundException
readRecordIfVersionIsNotLatest
in interface OStorage
ORecordNotFoundException
public 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)
OStorage
recyclePosition
in interface OStorage
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 OStorage
public final OStorageOperationResult<Boolean> hideRecord(ORecordId rid, int mode, ORecordCallback<Boolean> callback)
hideRecord
in interface OStorage
protected 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 OStorage
public final int getClusterIdByName(String clusterName)
getClusterIdByName
in interface OStorage
public 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
OInvalidIndexEngineIdException
public boolean indexContainsKey(int indexId, Object key) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public boolean removeKeyFromIndex(int indexId, Object key) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public void clearIndex(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public Object getIndexValue(int indexId, Object key) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public OBaseIndexEngine getIndexEngine(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public void updateIndexEntry(int indexId, Object key, OIndexKeyUpdater<Object> valueCreator) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public <T> T callIndexEngine(boolean atomicOperation, boolean readOperation, int indexId, OIndexEngineCallback<T> callback) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public void putRidIndexEntry(int indexId, Object key, ORID value) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public boolean removeRidIndexEntry(int indexId, Object key, ORID value) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public void putIndexValue(int indexId, Object key, Object value) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public 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.OInvalidIndexEngineIdException
OBaseIndexEngine.Validator#validate(Object, Object, Object)
public Object getIndexFirstKey(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public Object getIndexLastKey(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public OIndexCursor iterateIndexEntriesBetween(int indexId, Object rangeFrom, boolean fromInclusive, Object rangeTo, boolean toInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public OIndexCursor iterateIndexEntriesMajor(int indexId, Object fromKey, boolean isInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public OIndexCursor iterateIndexEntriesMinor(int indexId, Object toKey, boolean isInclusive, boolean ascSortOrder, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public OIndexCursor getIndexCursor(int indexId, OBaseIndexEngine.ValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public OIndexCursor getIndexDescCursor(int indexId, OBaseIndexEngine.ValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public OIndexKeyCursor getIndexKeyCursor(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public long getIndexSize(int indexId, OBaseIndexEngine.ValuesTransformer transformer) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public boolean hasIndexRangeQuerySupport(int indexId) throws OInvalidIndexEngineIdException
OInvalidIndexEngineIdException
public void rollback(OTransactionInternal clientTx)
public void rollback(OMicroTransaction microTransaction)
microTransaction
- the micro-transaction to rollback.public final boolean checkForRecordValidity(OPhysicalPosition ppos)
checkForRecordValidity
in interface OStorage
checkForRecordValidity
in class OStorageAbstract
public final String getPhysicalClusterNameById(int iClusterId)
getPhysicalClusterNameById
in interface OStorage
public final int getDefaultClusterId()
getDefaultClusterId
in interface OStorage
public final void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId
in interface OStorage
public final long getSize()
OStorage
public final int getClusters()
getClusters
in interface OStorage
public final void renameCluster(String oldName, String newName)
public final boolean cleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback)
cleanOutRecord
in interface OStorage
public final void freeze(boolean throwException)
OFreezableStorageComponent
OFreezableStorageComponent.release()
method will be called. This method will wait till all ongoing modifications will be finished.freeze
in interface OFreezableStorageComponent
throwException
- 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()
OFreezableStorageComponent
release
in interface OFreezableStorageComponent
public boolean wereDataRestoredAfterOpen()
public boolean wereNonTxOperationsPerformedInPreviousOpen()
public String getMode()
public final void lowDiskSpace(OLowDiskSpaceInformation information)
lowDiskSpace
in interface OLowDiskSpaceListener
public final void pageIsBroken(String fileName, long pageIndex)
OPageIsBrokenListener
pageIsBroken
in interface OPageIsBrokenListener
fileName
- Name of broken file.pageIndex
- Index of page which is broken in file.public final void requestCheckpoint()
requestCheckpoint
in interface OCheckpointRequestListener
public final Object command(OCommandRequestText iCommand)
public final Object executeCommand(OCommandRequestText iCommand, OCommandExecutor executor)
public final OPhysicalPosition[] higherPhysicalPositions(int currentClusterId, OPhysicalPosition physicalPosition)
higherPhysicalPositions
in interface OStorage
public final OPhysicalPosition[] ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
ceilingPhysicalPositions
in interface OStorage
public final OPhysicalPosition[] lowerPhysicalPositions(int currentClusterId, OPhysicalPosition physicalPosition)
lowerPhysicalPositions
in interface OStorage
public final OPhysicalPosition[] floorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
floorPhysicalPositions
in interface OStorage
public 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 OStorage
public final void setConflictStrategy(ORecordConflictStrategy conflictResolver)
setConflictStrategy
in interface OStorage
public AtomicLong getRecordScanned()
protected abstract OLogSequenceNumber copyWALToIncrementalBackup(ZipOutputStream zipOutputStream, long startSegment) throws IOException
IOException
protected 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
IOException
protected abstract OWriteAheadLog createWalFromIBUFiles(File directory, OContextConfiguration contextConfiguration, Locale locale) throws IOException
IOException
protected final void checkOpenness()
protected final void makeFuzzyCheckpoint()
public void tryToDeleteTreeRidBag(OSBTreeRidBag ridBag)
protected void makeFullCheckpoint()
public long getFullCheckpointCount()
protected long checkIfStorageDirty() throws IOException
IOException
protected void initConfiguration(OAtomicOperation atomicOperation, OContextConfiguration contextConfiguration) throws IOException
IOException
protected final void postCreateSteps()
protected void preCreateSteps() throws IOException
IOException
protected abstract void initWalAndDiskCache(OContextConfiguration contextConfiguration) throws IOException, InterruptedException
IOException
InterruptedException
protected abstract void postCloseSteps(boolean onDelete, boolean jvmError, long lastTxId) throws IOException
IOException
protected void postDeleteSteps()
protected void makeStorageDirty() throws IOException
IOException
protected void clearStorageDirty() throws IOException
IOException
protected boolean isDirty()
protected void closeClusters(boolean onDelete) throws IOException
IOException
protected void closeIndexes(boolean onDelete) throws IOException
IOException
public String incrementalBackup(String backupDirectory, OCallable<Void,Void> started) throws UnsupportedOperationException
incrementalBackup
in interface OStorage
UnsupportedOperationException
public boolean supportIncremental()
supportIncremental
in interface OStorage
public void fullIncrementalBackup(OutputStream stream) throws UnsupportedOperationException
fullIncrementalBackup
in interface OStorage
UnsupportedOperationException
public void restoreFromIncrementalBackup(String filePath)
restoreFromIncrementalBackup
in interface OStorage
public void restoreFullIncrementalBackup(InputStream stream) throws UnsupportedOperationException
restoreFullIncrementalBackup
in interface OStorage
UnsupportedOperationException
protected final OLogSequenceNumber restoreFrom(OLogSequenceNumber lsn, OWriteAheadLog writeAheadLog) throws IOException
IOException
protected final void restoreAtomicUnit(List<OWALRecord> atomicUnit, OModifiableBoolean atLeastOnePageUpdate) throws IOException
IOException
public 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 OStorage
getConfiguration
in class OStorageAbstract
public final void setSchemaRecordId(String schemaRecordId)
setSchemaRecordId
in interface OStorage
public final void setDateFormat(String dateFormat)
setDateFormat
in interface OStorage
public final void setTimeZone(TimeZone timeZoneValue)
setTimeZone
in interface OStorage
public final void setLocaleLanguage(String locale)
setLocaleLanguage
in interface OStorage
public final void setCharset(String charset)
setCharset
in interface OStorage
public final void setIndexMgrRecordId(String indexMgrRecordId)
setIndexMgrRecordId
in interface OStorage
public final void setDateTimeFormat(String dateTimeFormat)
setDateTimeFormat
in interface OStorage
public final void setLocaleCountry(String localeCountry)
setLocaleCountry
in interface OStorage
public final void setClusterSelection(String clusterSelection)
setClusterSelection
in interface OStorage
public final void setMinimumClusters(int minimumClusters)
setMinimumClusters
in interface OStorage
public final void setValidation(boolean validation)
setValidation
in interface OStorage
public final void removeProperty(String property)
removeProperty
in interface OStorage
public final void setProperty(String property, String value)
setProperty
in interface OStorage
public final void setRecordSerializer(String recordSerializer, int version)
setRecordSerializer
in interface OStorage
public final void clearProperties()
clearProperties
in interface OStorage
public void incOnOpen()
public int getSessionCount()
public long getLastCloseTime()
Copyright © 2009–2020 OrientDB. All rights reserved.