Interface OStorage

All Superinterfaces:
OBackupable, OStorageInfo
All Known Subinterfaces:
OIdentifiableStorage
All Known Implementing Classes:
OAbstractPaginatedStorage, ODirectMemoryStorage, OLocalPaginatedStorage, OStorageRemote

public interface OStorage extends OBackupable, OStorageInfo
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:
  • Field Details

  • Method Details

    • open

      void open(String iUserName, String iUserPassword, OContextConfiguration contextConfiguration)
    • create

      void create(OContextConfiguration contextConfiguration) throws IOException
      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

      ORecordMetadata getRecordMetadata(ORID rid)
    • cleanOutRecord

      boolean cleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback)
    • commit

    • getClusterNames

      Set<String> getClusterNames()
      Specified by:
      getClusterNames in interface OStorageInfo
    • getClusterInstances

      Collection<? extends OCluster> getClusterInstances()
    • addCluster

      int addCluster(String iClusterName, Object... iParameters)
      Add a new cluster into the storage.
      Parameters:
      iClusterName - name of the cluster
    • addCluster

      int addCluster(String iClusterName, int iRequestedId)
      Add a new cluster into the storage.
      Parameters:
      iClusterName - name of the cluster
      iRequestedId - requested id of the cluster
    • dropCluster

      boolean dropCluster(String iClusterName)
    • getClusterName

      String getClusterName(int clusterId)
    • setClusterAttribute

      boolean setClusterAttribute(int id, OCluster.ATTRIBUTES attribute, Object value)
    • 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

      String getClusterNameById(int clusterId)
    • getClusterRecordsSizeById

      long getClusterRecordsSizeById(int clusterId)
    • getClusterRecordsSizeByName

      long getClusterRecordsSizeByName(String clusterName)
    • getClusterRecordConflictStrategy

      String getClusterRecordConflictStrategy(int clusterId)
    • getClusterEncryption

      String getClusterEncryption(int clusterId)
    • isSystemCluster

      boolean isSystemCluster(int clusterId)
    • getLastClusterPosition

      long getLastClusterPosition(int clusterId)
    • getClusterNextPosition

      long getClusterNextPosition(int clusterId)
    • getRecordStatus

      OPaginatedCluster.RECORD_STATUS getRecordStatus(ORID rid)
    • 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

      int getClusterIdByName(String iClusterName)
      Specified by:
      getClusterIdByName in interface OStorageInfo
    • getPhysicalClusterNameById

      String getPhysicalClusterNameById(int iClusterId)
      Specified by:
      getPhysicalClusterNameById in interface OStorageInfo
    • checkForRecordValidity

      boolean checkForRecordValidity(OPhysicalPosition ppos)
    • getName

      String getName()
      Specified by:
      getName in interface OStorageInfo
    • getVersion

      long getVersion()
    • getCreatedAtVersion

      String getCreatedAtVersion()
      Returns:
      Version of product release under which storage was created.
    • synch

      void synch()
    • command

      Object command(OCommandRequestText iCommand)
      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

      OPhysicalPosition[] higherPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
    • lowerPhysicalPositions

      OPhysicalPosition[] lowerPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
    • ceilingPhysicalPositions

      OPhysicalPosition[] ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
    • floorPhysicalPositions

      OPhysicalPosition[] floorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
    • 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 boolean isDistributed()
      Deprecated.
    • isAssigningClusterIds

      boolean isAssigningClusterIds()
      Specified by:
      isAssigningClusterIds in interface OStorageInfo
    • getSBtreeCollectionManager

      OSBTreeCollectionManager getSBtreeCollectionManager()
    • getComponentsFactory

      OCurrentStorageComponentsFactory getComponentsFactory()
    • getRecordConflictStrategy

      ORecordConflictStrategy getRecordConflictStrategy()
      Specified by:
      getRecordConflictStrategy in interface OStorageInfo
    • setConflictStrategy

      void setConflictStrategy(ORecordConflictStrategy iResolver)
    • incrementalBackup

      String incrementalBackup(String backupDirectory, OCallable<Void,Void> started) throws UnsupportedOperationException
      Returns:
      Backup file name
      Throws:
      UnsupportedOperationException
    • supportIncremental

      boolean supportIncremental()
    • fullIncrementalBackup

      void fullIncrementalBackup(OutputStream stream) throws UnsupportedOperationException
      Throws:
      UnsupportedOperationException
    • restoreFromIncrementalBackup

      void restoreFromIncrementalBackup(String filePath)
    • restoreFullIncrementalBackup

      void restoreFullIncrementalBackup(InputStream stream) throws UnsupportedOperationException
      Throws:
      UnsupportedOperationException
    • shutdown

      void shutdown()
      This method is called in Orient.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

      void setSchemaRecordId(String schemaRecordId)
    • setDateFormat

      void setDateFormat(String dateFormat)
    • setTimeZone

      void setTimeZone(TimeZone timeZoneValue)
    • setLocaleLanguage

      void setLocaleLanguage(String locale)
    • setCharset

      void setCharset(String charset)
    • setIndexMgrRecordId

      void setIndexMgrRecordId(String indexMgrRecordId)
    • setDateTimeFormat

      void setDateTimeFormat(String dateTimeFormat)
    • setLocaleCountry

      void setLocaleCountry(String localeCountry)
    • setClusterSelection

      void setClusterSelection(String clusterSelection)
    • setMinimumClusters

      void setMinimumClusters(int minimumClusters)
    • setValidation

      void setValidation(boolean validation)
    • removeProperty

      void removeProperty(String property)
    • setProperty

      void setProperty(String property, String value)
    • setRecordSerializer

      void setRecordSerializer(String recordSerializer, int version)
    • clearProperties

      void clearProperties()
    • getClustersIds

      int[] getClustersIds(Set<String> filterClusters)
    • isIcrementalBackupRunning

      default boolean isIcrementalBackupRunning()
    • getContext

      OrientDBInternal getContext()