Interface OStorage
- All Superinterfaces:
OBackupable,OStorageInfo
- All Known Subinterfaces:
OIdentifiableStorage
- All Known Implementing Classes:
OAbstractPaginatedStorage,ODirectMemoryStorage,OLocalPaginatedStorage,OStorageRemote
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 TypeMethodDescriptionintaddCluster(String iClusterName, int iRequestedId) Add a new cluster into the storage.intaddCluster(String iClusterName, Object... iParameters) Add a new cluster into the storage.ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) booleanbooleancleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback) voidvoidclose()voidclose(boolean iForce, boolean onDelete) command(OCommandRequestText iCommand) Execute the command request and return the result back.longcount(int iClusterId) longcount(int[] iClusterIds) longcount(int[] iClusterIds, boolean countTombstones) longcount(int iClusterId, boolean countTombstones) longReturns the total number of records.voidcreate(OContextConfiguration contextConfiguration) voiddelete()deleteRecord(ORecordId iRecordId, int iVersion, int iMode, ORecordCallback<Boolean> iCallback) booleandropCluster(int iId) Drops a cluster.booleandropCluster(String iClusterName) booleanexists()floorPhysicalPositions(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 OCluster> getClusterName(int clusterId) getClusterNameById(int clusterId) longgetClusterNextPosition(int clusterId) getClusterRecordConflictStrategy(int clusterId) longgetClusterRecordsSizeById(int clusterId) longgetClusterRecordsSizeByName(String clusterName) int[]getClustersIds(Set<String> filterClusters) longgetLastClusterPosition(int clusterId) getName()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.longhigherPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) incrementalBackup(String backupDirectory, OCallable<Void, Void> started) booleanbooleanisClosed()booleanDeprecated.default booleanbooleanisRemote()booleanisSystemCluster(int clusterId) lowerPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition) voidopen(String iUserName, String iUserPassword, OContextConfiguration contextConfiguration) readRecord(ORecordId iRid, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords, ORecordCallback<ORawBuffer> iCallback) readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) voidreload()voidremoveProperty(String property) 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) voidsetTimeZone(TimeZone timeZoneValue) voidsetValidation(boolean validation) voidshutdown()This method is called inOrient.shutdown()method.booleanvoidsynch()Methods inherited from interface com.orientechnologies.orient.core.util.OBackupable
backup, restoreMethods inherited from interface com.orientechnologies.orient.core.storage.OStorageInfo
getClusters, getConfiguration, getDefaultClusterId, getURL
-
Field Details
-
CLUSTER_DEFAULT_NAME
- See Also:
-
-
Method Details
-
open
-
create
- Throws:
IOException
-
exists
boolean exists() -
reload
void reload() -
delete
void delete() -
close
void close() -
close
void close(boolean iForce, boolean onDelete) -
isClosed
boolean isClosed() -
readRecord
OStorageOperationResult<ORawBuffer> readRecord(ORecordId iRid, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords, ORecordCallback<ORawBuffer> iCallback) -
readRecordIfVersionIsNotLatest
OStorageOperationResult<ORawBuffer> readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) throws ORecordNotFoundException - Throws:
ORecordNotFoundException
-
deleteRecord
OStorageOperationResult<Boolean> deleteRecord(ORecordId iRecordId, int iVersion, int iMode, ORecordCallback<Boolean> iCallback) -
getRecordMetadata
-
cleanOutRecord
boolean cleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback) -
commit
-
getClusterNames
- Specified by:
getClusterNamesin interfaceOStorageInfo
-
getClusterInstances
Collection<? extends OCluster> 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 iClusterId, boolean countTombstones) -
count
long count(int[] iClusterIds) -
count
long count(int[] iClusterIds, boolean countTombstones) -
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
-
checkForRecordValidity
-
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() -
command
Execute the command request and return the result back. -
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. -
getUnderlying
OStorage getUnderlying() -
isRemote
boolean isRemote() -
isDistributed
Deprecated. -
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()
-