public class ODistributedStorage extends Object implements OStorage, OFreezableStorageComponent, OAutoshardedStorage
OStorage.LOCKING_STRATEGY, OStorage.STATUS
CLUSTER_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 OStorage
public boolean isDistributed()
isDistributed
in interface OStorage
public boolean isAssigningClusterIds()
isAssigningClusterIds
in interface OStorage
isAssigningClusterIds
in interface OStorageInfo
public Object command(OCommandRequestText iCommand)
OStorage
public void acquireDistributedExclusiveLock(long timeout)
acquireDistributedExclusiveLock
in interface OAutoshardedStorage
public void releaseDistributedExclusiveLock()
releaseDistributedExclusiveLock
in interface OAutoshardedStorage
public boolean isLocalEnv()
OAutoshardedStorage
isLocalEnv
in interface OAutoshardedStorage
public OStorageOperationResult<ORawBuffer> readRecord(ORecordId iRecordId, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords, ORecordCallback<ORawBuffer> iCallback)
readRecord
in interface OStorage
public OStorageOperationResult<ORawBuffer> readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) throws ORecordNotFoundException
readRecordIfVersionIsNotLatest
in interface OStorage
ORecordNotFoundException
public OStorageOperationResult<Boolean> deleteRecord(ORecordId iRecordId, int iVersion, int iMode, ORecordCallback<Boolean> iCallback)
deleteRecord
in interface OStorage
public OSBTreeCollectionManager getSBtreeCollectionManager()
getSBtreeCollectionManager
in interface OStorage
public ORecordMetadata getRecordMetadata(ORID rid)
getRecordMetadata
in interface OStorage
public boolean cleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback)
cleanOutRecord
in interface OStorage
public boolean existsResource(String iName)
existsResource
in interface OSharedContainer
public String getClusterName(int clusterId)
getClusterName
in interface OStorage
public boolean setClusterAttribute(int id, OCluster.ATTRIBUTES attribute, Object value)
setClusterAttribute
in interface OStorage
public ORecordConflictStrategy getRecordConflictStrategy()
getRecordConflictStrategy
in interface OStorage
public void setConflictStrategy(ORecordConflictStrategy iResolver)
setConflictStrategy
in interface OStorage
public <T> T removeResource(String iName)
removeResource
in interface OSharedContainer
public <T> T getResource(String iName, Callable<T> iCallback)
getResource
in interface OSharedContainer
public void open(String iUserName, String iUserPassword, OContextConfiguration iProperties)
public void create(OContextConfiguration iProperties) throws IOException
create
in interface OStorage
IOException
public String incrementalBackup(String backupDirectory, OCallable<Void,Void> started)
incrementalBackup
in interface OStorage
public void restoreFromIncrementalBackup(String filePath)
restoreFromIncrementalBackup
in interface OStorage
public boolean supportIncremental()
supportIncremental
in interface OStorage
public void fullIncrementalBackup(OutputStream stream) throws UnsupportedOperationException
fullIncrementalBackup
in interface OStorage
UnsupportedOperationException
public void restoreFullIncrementalBackup(InputStream stream) throws UnsupportedOperationException
restoreFullIncrementalBackup
in interface OStorage
UnsupportedOperationException
public void closeOnDrop()
public List<ORecordOperation> commit(OTransactionInternal iTx)
public void rollback(OTransactionInternal iTx)
public OStorageConfiguration getConfiguration()
getConfiguration
in interface OStorageInfo
public int getClusters()
getClusters
in interface OStorageInfo
public Set<String> getClusterNames()
getClusterNames
in interface OStorage
getClusterNames
in interface OStorageInfo
public Collection<? extends OCluster> getClusterInstances()
getClusterInstances
in interface OStorage
public int addCluster(String iClusterName, Object... iParameters)
OStorage
addCluster
in interface OStorage
iClusterName
- name of the clusterpublic int addCluster(String iClusterName, int iRequestedId)
OStorage
addCluster
in interface OStorage
iClusterName
- name of the clusteriRequestedId
- requested id of the clusterpublic boolean dropCluster(String iClusterName)
dropCluster
in interface OStorage
public boolean dropCluster(int iId)
OStorage
dropCluster
in interface OStorage
iId
- 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 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 boolean isSystemCluster(int clusterId)
isSystemCluster
in interface OStorage
public long getLastClusterPosition(int clusterId)
getLastClusterPosition
in interface OStorage
public long getClusterNextPosition(int clusterId)
getClusterNextPosition
in interface OStorage
public OPaginatedCluster.RECORD_STATUS getRecordStatus(ORID rid)
getRecordStatus
in interface OStorage
public long count(int iClusterId, boolean countTombstones)
public long count(int[] iClusterIds, boolean countTombstones)
public long getSize()
OStorage
public long countRecords()
OStorage
countRecords
in interface OStorage
public int getDefaultClusterId()
getDefaultClusterId
in interface OStorageInfo
public void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId
in interface OStorage
public int getClusterIdByName(String iClusterName)
getClusterIdByName
in interface OStorage
public String getPhysicalClusterNameById(int iClusterId)
getPhysicalClusterNameById
in interface OStorage
public boolean checkForRecordValidity(OPhysicalPosition ppos)
checkForRecordValidity
in interface OStorage
public String getURL()
getURL
in interface OStorageInfo
public long getVersion()
getVersion
in interface OStorage
public long[] getClusterDataRange(int currentClusterId)
OStorage
getClusterDataRange
in interface OStorage
currentClusterId
- Cluster idpublic OStorage.STATUS getStatus()
OStorage
public ODistributedStorageEventListener getEventListener()
public void setEventListener(ODistributedStorageEventListener eventListener)
public OPhysicalPosition[] higherPhysicalPositions(int currentClusterId, OPhysicalPosition entry)
higherPhysicalPositions
in interface OStorage
public OServer getServer()
public ODistributedServerManager getDistributedManager()
public ODistributedConfiguration getDistributedConfiguration()
public void setDistributedConfiguration(OModifiableDistributedConfiguration distributedConfiguration)
public OPhysicalPosition[] ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
ceilingPhysicalPositions
in interface OStorage
public OPhysicalPosition[] floorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
floorPhysicalPositions
in interface OStorage
public OPhysicalPosition[] lowerPhysicalPositions(int currentClusterId, OPhysicalPosition entry)
lowerPhysicalPositions
in interface OStorage
public OStorage getUnderlying()
getUnderlying
in interface OStorage
public OCurrentStorageComponentsFactory getComponentsFactory()
getComponentsFactory
in interface OStorage
public String getType()
OStorage
public 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 void release()
OFreezableStorageComponent
release
in interface OFreezableStorageComponent
public List<String> backup(OutputStream out, Map<String,Object> options, Callable<Object> callable, OCommandOutputListener iListener, int compressionLevel, int bufferSize) throws IOException
OBackupable
backup
in interface OBackupable
out
- 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 compressionIOException
ODatabaseExport
public void restore(InputStream in, Map<String,Object> options, Callable<Object> callable, OCommandOutputListener iListener) throws IOException
OBackupable
restore
in interface OBackupable
in
- 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 messagesIOException
ODatabaseImport
public String getStorageId()
OAutoshardedStorage
getStorageId
in interface OAutoshardedStorage
public String getNodeId()
getNodeId
in interface OAutoshardedStorage
public void shutdown()
OStorage
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.protected void checkNodeIsMaster(String localNodeName, ODistributedConfiguration dbCfg, String operation)
public OSyncSource getLastValidBackup()
public void setLastValidBackup(OSyncSource lastValidBackup)
protected void handleDistributedException(String iMessage, Exception e, Object... iParams)
public void resetLastValidBackup()
public void clearLastValidBackup()
protected void dropStorageFiles()
public static void dropStorageFiles(OLocalPaginatedStorage storage)
protected void saveDatabaseConfiguration()
protected File getDistributedConfigFile()
public ODistributedDatabase getLocalDistributedDatabase()
public void setSchemaRecordId(String schemaRecordId)
setSchemaRecordId
in interface OStorage
public void setDateFormat(String dateFormat)
setDateFormat
in interface OStorage
public void setTimeZone(TimeZone timeZoneValue)
setTimeZone
in interface OStorage
public void setLocaleLanguage(String locale)
setLocaleLanguage
in interface OStorage
public void setCharset(String charset)
setCharset
in interface OStorage
public void setIndexMgrRecordId(String indexMgrRecordId)
setIndexMgrRecordId
in interface OStorage
public void setDateTimeFormat(String dateTimeFormat)
setDateTimeFormat
in interface OStorage
public void setLocaleCountry(String localeCountry)
setLocaleCountry
in interface OStorage
public void setClusterSelection(String clusterSelection)
setClusterSelection
in interface OStorage
public void setMinimumClusters(int minimumClusters)
setMinimumClusters
in interface OStorage
public void setValidation(boolean validation)
setValidation
in interface OStorage
public void removeProperty(String property)
removeProperty
in interface OStorage
public void setProperty(String property, String value)
setProperty
in interface OStorage
public void setRecordSerializer(String recordSerializer, int version)
setRecordSerializer
in interface OStorage
public void clearProperties()
clearProperties
in interface OStorage
Copyright © 2009–2020 OrientDB. All rights reserved.