Interface OStorage
- All Superinterfaces:
OStorageInfo
- All Known Subinterfaces:
OIdentifiableStorage
- All Known Implementing Classes:
OAbstractPaginatedStorage,ODirectMemoryStorage,OEnterpriseLocalPaginatedStorage,OLocalPaginatedStorage
This is the gateway interface between the Database side and the storage. Provided implementations
are: Local, Remote and Memory.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enum -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidacquireReadLock(ORID rid, long timeout) voidacquireWriteLock(ORID rid, long timeout) intaddCluster(String iClusterName, int iRequestedId) Add a new cluster into the storage.intaddCluster(String iClusterName, Object... iParameters) Add a new cluster into the storage.intaddIndexEngine(OIndexMetadata indexMetadata, Map<String, String> engineProperties) backup(OutputStream out, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) Executes a backup of the database.voidbackupTransactions(OutputStream output, List<OTransactionId> transactionsMetadata) <T> TcallIndexEngine(boolean readOperation, int indexId, OIndexEngineCallback<T> callback) ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) booleancheck(boolean verbose, OCommandOutputListener listener) booleancleanOutRecord(ORecordId recordId, int recordVersion) voidclearIndex(int indexId) voidvoidclose()voidvoidcommitPreAllocated(OStorageTransaction clientTx) longcount(int iClusterId) longcount(int[] iClusterIds) longReturns the total number of records.voidcreate(OContextConfiguration contextConfiguration, ODatabaseId id) createSBTree(int clusterId, UUID ownerUUID) voiddelete()voiddeleteIndexEngine(int indexId) deleteRecord(ORecordId iRecordId, int iVersion) booleandropCluster(int iId) Drops a cluster.booleandropCluster(String iClusterName) voidendDDL()booleanexists()extractTransactionsFromWal(List<OTransactionId> transactionsMetadata) voidfloorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) voidfullIncrementalBackup(OutputStream stream) long[]getClusterDataRange(int currentClusterId) Returns a pair of long values telling the begin and end positions of data in the requested cluster.getClusterEncryption(int clusterId) intgetClusterIdByName(String iClusterName) Collection<? extends OClusterInfo> getClusterName(int clusterId) getClusterNameById(int clusterId) longgetClusterNextPosition(int clusterId) getClusterRecordConflictStrategy(int clusterId) longgetClusterRecordsSizeById(int clusterId) longgetClusterRecordsSizeByName(String clusterName) int[]getClustersIds(Set<String> filterClusters) intgetIndexApiVersion(int indexId) getIndexDescStream(int indexId, IndexEngineValuesTransformer valuesTransformer) getIndexEngine(int indexId) getIndexKeyStream(int indexId) longgetIndexSize(int indexId, IndexEngineValuesTransformer transformer) getIndexStream(int indexId, IndexEngineValuesTransformer valuesTransformer) getIndexValue(int indexId, Object key) getIndexValues(int indexId, Object key) longgetLastClusterPosition(int clusterId) Optional<byte[]> getName()getPath()getPhysicalClusterNameById(int iClusterId) getRecordMetadata(ORID rid) getRecordStatus(ORID rid) longgetSize()Returns the size of the database.Returns the current storage's statusgetType()Returns the storage's type.longintgetVersionForKey(String indexName, Object key) booleanhasIndexRangeQuerySupport(int indexId) higherPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) incrementalBackup(String backupDirectory, OCallable<Void, Void> started) voidincrementalSync(OutputStream dest, Runnable started) booleanbooleanisClosed()booleandefault booleanbooleanisMemory()booleanisSystemCluster(int clusterId) iterateIndexEntriesBetween(int indexId, Object rangeFrom, boolean fromInclusive, Object rangeTo, boolean toInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) iterateIndexEntriesMajor(int indexId, Object fromKey, boolean isInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) iterateIndexEntriesMinor(int indexId, Object toKey, boolean isInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) intloadIndexEngine(OIndexMetadata indexMetadata) lowerPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) voidmetadataOnly(byte[] metadata) voidopen(OContextConfiguration configurations) voidvoidpreallocateRids(OAllocationTransaction clientTx) readRecord(ORecordId iRid) readRecordIfVersionIsNotLatest(ORecordId rid, int recordVersion) voidreleaseReadLock(ORID rid) voidreleaseWriteLock(ORID rid) voidreload()voidvoidremoveProperty(String property) resolveObjectSerializer(byte serializerId) voidrestore(InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) Executes a restore of a database backup.voidrestoreFromIncrementalBackup(String filePath) voidvoidsetCharset(String charset) booleansetClusterAttribute(int id, OCluster.ATTRIBUTES attribute, Object value) voidsetClusterSelection(String clusterSelection) voidsetConflictStrategy(ORecordConflictStrategy iResolver) voidsetDateFormat(String dateFormat) voidsetDateTimeFormat(String dateTimeFormat) voidsetDefaultClusterId(int defaultClusterId) voidsetIndexMgrRecordId(String indexMgrRecordId) voidsetLocaleCountry(String localeCountry) voidsetLocaleLanguage(String locale) voidsetMinimumClusters(int minimumClusters) voidsetProperty(String property, String value) voidsetRecordSerializer(String recordSerializer, int version) voidsetSchemaRecordId(String schemaRecordId) voidsetStorageConfigurationUpdateListener(OStorageConfigurationUpdateListener storageConfigurationUpdateListener) voidsetTimeZone(TimeZone timeZoneValue) voidsetValidation(boolean validation) voidshutdown()This method is called inOrient.shutdown()method.voidstartDDL()booleanvoidsynch()booleanbooleanMethods inherited from interface com.orientechnologies.orient.core.storage.OStorageInfo
getClusters, getConfiguration, getDefaultClusterId, getURL
-
Field Details
-
CLUSTER_DEFAULT_NAME
- See Also:
-
-
Method Details
-
create
-
exists
boolean exists() -
reload
void reload() -
delete
void delete() -
close
void close() -
isClosed
boolean isClosed() -
readRecord
-
readRecordIfVersionIsNotLatest
ORawBuffer readRecordIfVersionIsNotLatest(ORecordId rid, int recordVersion) throws ORecordNotFoundException - Throws:
ORecordNotFoundException
-
deleteRecord
-
getRecordMetadata
-
cleanOutRecord
-
commit
-
getClusterNames
- Specified by:
getClusterNamesin interfaceOStorageInfo
-
getClusterInstances
Collection<? extends OClusterInfo> getClusterInstances() -
addCluster
Add a new cluster into the storage.- Parameters:
iClusterName- name of the cluster
-
addCluster
Add a new cluster into the storage.- Parameters:
iClusterName- name of the clusteriRequestedId- requested id of the cluster
-
dropCluster
-
getClusterName
-
setClusterAttribute
-
dropCluster
boolean dropCluster(int iId) Drops a cluster.- Parameters:
iId- id of the cluster to delete- Returns:
- true if has been removed, otherwise false
-
getClusterNameById
-
getClusterRecordsSizeById
long getClusterRecordsSizeById(int clusterId) -
getClusterRecordsSizeByName
-
getClusterRecordConflictStrategy
-
getClusterEncryption
-
isSystemCluster
boolean isSystemCluster(int clusterId) -
getLastClusterPosition
long getLastClusterPosition(int clusterId) -
getClusterNextPosition
long getClusterNextPosition(int clusterId) -
getRecordStatus
-
count
long count(int iClusterId) -
count
long count(int[] iClusterIds) -
getSize
long getSize()Returns the size of the database. -
countRecords
long countRecords()Returns the total number of records. -
setDefaultClusterId
void setDefaultClusterId(int defaultClusterId) -
getClusterIdByName
- Specified by:
getClusterIdByNamein interfaceOStorageInfo
-
getPhysicalClusterNameById
- Specified by:
getPhysicalClusterNameByIdin interfaceOStorageInfo
-
getName
String getName()- Specified by:
getNamein interfaceOStorageInfo
-
getVersion
long getVersion() -
getCreatedAtVersion
String getCreatedAtVersion()- Returns:
- Version of product release under which storage was created.
-
synch
void synch() -
getClusterDataRange
long[] getClusterDataRange(int currentClusterId) Returns a pair of long values telling the begin and end positions of data in the requested cluster. Useful to know the range of the records.- Parameters:
currentClusterId- Cluster id
-
higherPhysicalPositions
-
lowerPhysicalPositions
-
ceilingPhysicalPositions
-
floorPhysicalPositions
-
getStatus
OStorage.STATUS getStatus()Returns the current storage's status -
getType
String getType()Returns the storage's type.- Specified by:
getTypein interfaceOStorageInfo
-
isAssigningClusterIds
boolean isAssigningClusterIds()- Specified by:
isAssigningClusterIdsin interfaceOStorageInfo
-
getSBtreeCollectionManager
OSBTreeCollectionManager getSBtreeCollectionManager() -
getComponentsFactory
OCurrentStorageComponentsFactory getComponentsFactory() -
getRecordConflictStrategy
ORecordConflictStrategy getRecordConflictStrategy()- Specified by:
getRecordConflictStrategyin interfaceOStorageInfo
-
setConflictStrategy
-
incrementalBackup
String incrementalBackup(String backupDirectory, OCallable<Void, Void> started) throws UnsupportedOperationException- Returns:
- Backup file name
- Throws:
UnsupportedOperationException
-
supportIncremental
boolean supportIncremental() -
fullIncrementalBackup
- Throws:
UnsupportedOperationException
-
restoreFromIncrementalBackup
-
restoreFullIncrementalBackup
- Throws:
UnsupportedOperationException
-
shutdown
void shutdown()This method is called inOrient.shutdown()method. For most of the storages it means that storage will be merely closed, but sometimes additional operations are need to be taken in account. -
setSchemaRecordId
-
setDateFormat
-
setTimeZone
-
setLocaleLanguage
-
setCharset
-
setIndexMgrRecordId
-
setDateTimeFormat
-
setLocaleCountry
-
setClusterSelection
-
setMinimumClusters
void setMinimumClusters(int minimumClusters) -
setValidation
void setValidation(boolean validation) -
removeProperty
-
setProperty
-
setRecordSerializer
-
clearProperties
void clearProperties() -
getClustersIds
-
isIcrementalBackupRunning
default boolean isIcrementalBackupRunning() -
getContext
OrientDBInternal getContext() -
getLastMetadata
Optional<byte[]> getLastMetadata() -
open
-
setStorageConfigurationUpdateListener
void setStorageConfigurationUpdateListener(OStorageConfigurationUpdateListener storageConfigurationUpdateListener) -
startDDL
void startDDL() -
endDDL
void endDDL() -
fireConfigurationUpdateNotifications
void fireConfigurationUpdateNotifications() -
pauseConfigurationUpdateNotifications
void pauseConfigurationUpdateNotifications() -
preallocateRids
-
commitPreAllocated
-
acquireWriteLock
-
releaseWriteLock
-
acquireReadLock
-
releaseReadLock
-
wereDataRestoredAfterOpen
boolean wereDataRestoredAfterOpen() -
wereNonTxOperationsPerformedInPreviousOpen
boolean wereNonTxOperationsPerformedInPreviousOpen() -
hasIndexRangeQuerySupport
- Throws:
OInvalidIndexEngineIdException
-
addIndexEngine
-
loadIndexEngine
-
clearIndex
- Throws:
OInvalidIndexEngineIdException
-
deleteIndexEngine
- Throws:
OInvalidIndexEngineIdException
-
getIndexStream
Stream<ORawPair<Object,ORID>> getIndexStream(int indexId, IndexEngineValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
callIndexEngine
<T> T callIndexEngine(boolean readOperation, int indexId, OIndexEngineCallback<T> callback) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
getIndexKeyStream
- Throws:
OInvalidIndexEngineIdException
-
getIndexEngine
- Throws:
OInvalidIndexEngineIdException
-
removeIndexValuesContainer
-
iterateIndexEntriesBetween
Stream<ORawPair<Object,ORID>> iterateIndexEntriesBetween(int indexId, Object rangeFrom, boolean fromInclusive, Object rangeTo, boolean toInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
iterateIndexEntriesMajor
Stream<ORawPair<Object,ORID>> iterateIndexEntriesMajor(int indexId, Object fromKey, boolean isInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
iterateIndexEntriesMinor
Stream<ORawPair<Object,ORID>> iterateIndexEntriesMinor(int indexId, Object toKey, boolean isInclusive, boolean ascSortOrder, IndexEngineValuesTransformer transformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
getIndexValue
- Throws:
OInvalidIndexEngineIdException
-
getIndexValues
- Throws:
OInvalidIndexEngineIdException
-
getIndexSize
long getIndexSize(int indexId, IndexEngineValuesTransformer transformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
getIndexDescStream
Stream<ORawPair<Object,ORID>> getIndexDescStream(int indexId, IndexEngineValuesTransformer valuesTransformer) throws OInvalidIndexEngineIdException - Throws:
OInvalidIndexEngineIdException
-
getVersionForKey
-
metadataOnly
void metadataOnly(byte[] metadata) -
isMemory
boolean isMemory() -
extractTransactionsFromWal
-
backupTransactions
-
check
-
resolveObjectSerializer
-
createSBTree
-
isDeleted
-
incrementalSync
-
getPath
-
getDatbaseId
ODatabaseId getDatbaseId() -
getIndexApiVersion
int getIndexApiVersion(int indexId) -
backup
List<String> backup(OutputStream out, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) throws IOExceptionExecutes a backup of the database. During the backup the database will be frozen in read-only mode.- Parameters:
out- OutputStream used to write the backup content. Use a FileOutputStream to make the backup persistent on diskoptions- Backup options as Mapinvalid input: '<'String, Object> objectcallable- Callback to execute when the database is lockediListener- Listener called for backup messagescompressionLevel- ZIP Compression level between 1 (the minimum) and 9 (maximum). The bigger is the compression, the smaller will be the final backup content, but will consume more CPU and time to executebufferSize- Buffer size in bytes, the bigger is the buffer, the more efficient will be the compression- Throws:
IOException- See Also:
-
restore
void restore(InputStream in, Map<String, Object> options, Callable<Object> callable, OCommandOutputListener iListener) throws IOExceptionExecutes a restore of a database backup. During the restore the database will be frozen in read-only mode.- Parameters:
in- InputStream used to read the backup content. Use a FileInputStream to read a backup on a diskoptions- Backup options as Mapinvalid input: '<'String, Object> objectcallable- Callback to execute when the database is lockediListener- Listener called for backup messages- Throws:
IOException- See Also:
-