
public class ODistributedStorage extends Object implements OStorage, OFreezableStorageComponent, OAutoshardedStorage
OStorage.LOCKING_STRATEGY, OStorage.STATUSCLUSTER_DEFAULT_NAME| Constructor and Description |
|---|
ODistributedStorage(OServer iServer,
String dbName) |
public void replaceIfNeeded(OAbstractPaginatedStorage wrapped)
public void wrap(OAbstractPaginatedStorage wrapped)
public String getCreatedAtVersion()
SELECT FROM metadata:storage instead.getCreatedAtVersion in interface OStoragepublic void startAsynchronousWorker()
public boolean isDistributed()
isDistributed in interface OStoragepublic boolean isAssigningClusterIds()
isAssigningClusterIds in interface OStoragepublic Object command(OCommandRequestText iCommand)
OStoragepublic void acquireDistributedExclusiveLock(long timeout)
acquireDistributedExclusiveLock in interface OAutoshardedStoragepublic void releaseDistributedExclusiveLock()
releaseDistributedExclusiveLock in interface OAutoshardedStorageprotected Object executeCommand(OCommandRequestText iCommand, String localNodeName, Collection<String> involvedClusters, OAbstractCommandTask task, Set<String> nodes, boolean executedLocally)
protected void undoCommandOnLocalServer(OCommandRequestText iCommand)
protected Map<String,Object> executeOnServers(OCommandRequestText iCommand, OCommandExecutor exec, Collection<String> involvedClusters, Map<String,Collection<String>> nodeClusterMap)
protected Object mergeResultByAggregation(OCommandExecutorSQLSelect select, Map<String,Object> iResults)
protected boolean executeOnlyLocally(String localNodeName, ODistributedConfiguration dbCfg, OCommandExecutor exec, Collection<String> involvedClusters, Collection<String> nodes)
public OStorageOperationResult<OPhysicalPosition> createRecord(ORecordId iRecordId, byte[] iContent, int iRecordVersion, byte iRecordType, int iMode, ORecordCallback<Long> iCallback)
createRecord in interface OStoragepublic boolean isLocalEnv()
OAutoshardedStorageisLocalEnv in interface OAutoshardedStoragepublic OStorageOperationResult<ORawBuffer> readRecord(ORecordId iRecordId, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords, ORecordCallback<ORawBuffer> iCallback)
readRecord in interface OStoragepublic OStorageOperationResult<ORawBuffer> readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) throws ORecordNotFoundException
readRecordIfVersionIsNotLatest in interface OStorageORecordNotFoundExceptionpublic OStorageOperationResult<Boolean> deleteRecord(ORecordId iRecordId, int iVersion, int iMode, ORecordCallback<Boolean> iCallback)
deleteRecord in interface OStoragepublic OSBTreeCollectionManager getSBtreeCollectionManager()
getSBtreeCollectionManager in interface OStorageprotected void checkWriteQuorum(ODistributedConfiguration dbCfg, String clusterName, String localNodeName)
public OStorageOperationResult<Integer> recyclePosition(ORecordId iRecordId, byte[] iContent, int iVersion, byte iRecordType)
OStoragerecyclePosition in interface OStoragepublic int getConfigurationUpdated()
public OStorageOperationResult<Boolean> hideRecord(ORecordId recordId, int mode, ORecordCallback<Boolean> callback)
hideRecord in interface OStoragepublic ORecordMetadata getRecordMetadata(ORID rid)
getRecordMetadata in interface OStoragepublic boolean cleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback)
cleanOutRecord in interface OStoragepublic boolean existsResource(String iName)
existsResource in interface OSharedContainerpublic ORecordConflictStrategy getClusterRecordConflictStrategy()
getClusterRecordConflictStrategy in interface OStoragepublic void setConflictStrategy(ORecordConflictStrategy iResolver)
setConflictStrategy in interface OStoragepublic <T> T removeResource(String iName)
removeResource in interface OSharedContainerpublic <T> T getResource(String iName, Callable<T> iCallback)
getResource in interface OSharedContainerpublic void open(String iUserName, String iUserPassword, OContextConfiguration iProperties)
public void create(OContextConfiguration iProperties) throws IOException
create in interface OStorageIOExceptionpublic String incrementalBackup(String backupDirectory, OCallable<Void,Void> started)
incrementalBackup in interface OStoragepublic void restoreFromIncrementalBackup(String filePath)
restoreFromIncrementalBackup in interface OStoragepublic boolean supportIncremental()
supportIncremental in interface OStoragepublic void fullIncrementalBackup(OutputStream stream) throws UnsupportedOperationException
fullIncrementalBackup in interface OStorageUnsupportedOperationExceptionpublic void restoreFullIncrementalBackup(InputStream stream) throws UnsupportedOperationException
restoreFullIncrementalBackup in interface OStorageUnsupportedOperationExceptionpublic void closeOnDrop()
public List<ORecordOperation> commit(OTransactionInternal iTx)
protected ODistributedRequestId acquireRecordLock(ORecordId rid)
protected void releaseRecordLock(ORecordId rid, ODistributedRequestId requestId)
public void rollback(OTransactionInternal iTx)
public OStorageConfiguration getConfiguration()
getConfiguration in interface OStoragepublic int getClusters()
getClusters in interface OStoragepublic Set<String> getClusterNames()
getClusterNames in interface OStoragepublic int addCluster(String iClusterName, Object... iParameters)
OStorageaddCluster in interface OStorageiClusterName - name of the clusterpublic int addCluster(String iClusterName, int iRequestedId, Object... iParameters)
OStorageaddCluster in interface OStorageiClusterName - name of the clusteriRequestedId - requested id of the clusterpublic boolean dropCluster(String iClusterName, boolean iTruncate)
dropCluster in interface OStoragepublic boolean dropCluster(int iId,
boolean iTruncate)
OStoragedropCluster in interface OStorageiId - id of the cluster to deletepublic long count(int iClusterId,
boolean countTombstones)
public long count(int[] iClusterIds,
boolean countTombstones)
public long getSize()
OStoragepublic long countRecords()
OStoragecountRecords in interface OStoragepublic int getDefaultClusterId()
getDefaultClusterId in interface OStoragepublic void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId in interface OStoragepublic int getClusterIdByName(String iClusterName)
getClusterIdByName in interface OStoragepublic String getPhysicalClusterNameById(int iClusterId)
getPhysicalClusterNameById in interface OStoragepublic boolean checkForRecordValidity(OPhysicalPosition ppos)
checkForRecordValidity in interface OStoragepublic long getVersion()
getVersion in interface OStoragepublic long[] getClusterDataRange(int currentClusterId)
OStoragegetClusterDataRange in interface OStoragecurrentClusterId - Cluster idpublic OStorage.STATUS getStatus()
OStoragepublic ODistributedStorageEventListener getEventListener()
public void setEventListener(ODistributedStorageEventListener eventListener)
public OPhysicalPosition[] higherPhysicalPositions(int currentClusterId, OPhysicalPosition entry)
higherPhysicalPositions in interface OStoragepublic OServer getServer()
public ODistributedServerManager getDistributedManager()
public ODistributedConfiguration getDistributedConfiguration()
public void setDistributedConfiguration(OModifiableDistributedConfiguration distributedConfiguration)
public OPhysicalPosition[] ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
ceilingPhysicalPositions in interface OStoragepublic OPhysicalPosition[] floorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
floorPhysicalPositions in interface OStoragepublic OPhysicalPosition[] lowerPhysicalPositions(int currentClusterId, OPhysicalPosition entry)
lowerPhysicalPositions in interface OStoragepublic OStorage getUnderlying()
getUnderlying in interface OStoragepublic OCurrentStorageComponentsFactory getComponentsFactory()
getComponentsFactory in interface OStoragepublic String getType()
OStoragepublic 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 void release()
OFreezableStorageComponentrelease in interface OFreezableStorageComponentpublic List<String> backup(OutputStream out, Map<String,Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) throws IOException
OBackupablebackup in interface OBackupableout - OutputStream used to write the backup content. Use a FileOutputStream to make the backup persistent on diskoptions - Backup options as Mapcallable - 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 compressionIOExceptionODatabaseExportpublic void restore(InputStream in, Map<String,Object> options, Callable<Object> callable, OCommandOutputListener iListener) throws IOException
OBackupablerestore in interface OBackupablein - InputStream used to read the backup content. Use a FileInputStream to read a backup on a diskoptions - Backup options as Mapcallable - Callback to execute when the database is lockediListener - Listener called for backup messagesIOExceptionODatabaseImportpublic String getClusterNameById(int clusterId)
getClusterNameById in interface OStoragepublic long getClusterRecordsSizeById(int clusterId)
getClusterRecordsSizeById in interface OStoragepublic long getClusterRecordsSizeByName(String clusterName)
getClusterRecordsSizeByName in interface OStoragepublic void truncateCluster(String clusterName)
truncateCluster 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 boolean isSystemCluster(int clusterId)
isSystemCluster in interface OStoragepublic long getLastClusterPosition(int clusterId)
getLastClusterPosition in interface OStoragepublic long getClusterNextPosition(int clusterId)
getClusterNextPosition in interface OStoragepublic OPaginatedCluster.RECORD_STATUS getRecordStatus(ORID rid)
getRecordStatus in interface OStoragepublic String getStorageId()
OAutoshardedStoragegetStorageId in interface OAutoshardedStoragepublic String getNodeId()
getNodeId in interface OAutoshardedStoragepublic void shutdown()
OStorageOrient.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.public void shutdownAsynchronousWorker()
protected void checkNodeIsMaster(String localNodeName, ODistributedConfiguration dbCfg, String operation)
public OSyncSource getLastValidBackup()
public void setLastValidBackup(OSyncSource lastValidBackup)
protected void asynchronousExecution(OAsynchDistributedOperation iOperation)
protected OAsyncReplicationError getAsyncReplicationError()
protected void handleDistributedException(String iMessage, Exception e, Object... iParams)
public void resetLastValidBackup()
public void clearLastValidBackup()
protected void dropStorageFiles()
public static void dropStorageFiles(OAbstractPaginatedStorage wrapped)
protected String checkForCluster(ORecord record, String localNodeName, ODistributedConfiguration dbCfg)
protected void saveDatabaseConfiguration()
protected File getDistributedConfigFile()
public ODistributedDatabase getLocalDistributedDatabase()
public void setSchemaRecordId(String schemaRecordId)
setSchemaRecordId in interface OStoragepublic void setDateFormat(String dateFormat)
setDateFormat in interface OStoragepublic void setTimeZone(TimeZone timeZoneValue)
setTimeZone in interface OStoragepublic void setLocaleLanguage(String locale)
setLocaleLanguage in interface OStoragepublic void setCharset(String charset)
setCharset in interface OStoragepublic void setIndexMgrRecordId(String indexMgrRecordId)
setIndexMgrRecordId in interface OStoragepublic void setDateTimeFormat(String dateTimeFormat)
setDateTimeFormat in interface OStoragepublic void setLocaleCountry(String localeCountry)
setLocaleCountry in interface OStoragepublic void setClusterSelection(String clusterSelection)
setClusterSelection in interface OStoragepublic void setMinimumClusters(int minimumClusters)
setMinimumClusters in interface OStoragepublic void setValidation(boolean validation)
setValidation in interface OStoragepublic void removeProperty(String property)
removeProperty in interface OStoragepublic void setProperty(String property, String value)
setProperty in interface OStoragepublic void setRecordSerializer(String recordSerializer, int version)
setRecordSerializer in interface OStoragepublic void clearProperties()
clearProperties in interface OStorageCopyright © 2009–2025 OrientDB. All rights reserved.