
public class OStorageRemote extends OStorageAbstract implements OStorageProxy
| Modifier and Type | Class and Description |
|---|---|
static class |
OStorageRemote.CONNECTION_STRATEGY |
OStorage.LOCKING_STRATEGY, OStorage.SIZE, OStorage.STATUS| Modifier and Type | Field and Description |
|---|---|
protected Map<String,OCluster> |
clusterMap |
protected ORemoteConnectionManager |
connectionManager |
static String |
DRIVER_NAME |
static String |
PARAM_CONNECTION_STRATEGY |
protected List<String> |
serverURLs |
componentsFactory, configuration, mode, name, sharedContainer, stateLock, status, storageThreadGroup, url, versionCLUSTER_DEFAULT_NAME| Constructor and Description |
|---|
OStorageRemote(String iClientId,
String iURL,
String iMode) |
OStorageRemote(String iClientId,
String iURL,
String iMode,
OStorage.STATUS status,
boolean managePushMessages) |
| Modifier and Type | Method and Description |
|---|---|
int |
addCluster(String iClusterName,
boolean forceListBased,
Object... iArguments)
Add a new cluster into the storage.
|
int |
addCluster(String iClusterName,
int iRequestedId,
boolean forceListBased,
Object... iParameters)
Add a new cluster into the storage.
|
protected String |
addHost(String host)
Registers the remote server with port.
|
int |
addUser() |
<T> T |
asyncNetworkOperation(OStorageRemoteOperationWrite write,
OStorageRemoteOperationRead<T> read,
int mode,
ORecordId recordId,
ORecordCallback<T> callback,
String errorMessage) |
List<String> |
backup(OutputStream out,
Map<String,Object> options,
Callable<Object> callable,
OCommandOutputListener iListener,
int compressionLevel,
int bufferSize)
Executes a backup of the database.
|
<T> T |
baseNetworkOperation(OStorageRemoteOperation<T> operation,
String errorMessage,
int retry) |
OChannelBinaryAsynchClient |
beginRequest(OChannelBinaryAsynchClient network,
byte iCommand,
OStorageRemoteSession session)
Acquire a network channel from the pool.
|
void |
beginResponse(OChannelBinaryAsynchClient iNetwork,
OStorageRemoteSession session) |
OPhysicalPosition[] |
ceilingPhysicalPositions(int clusterId,
OPhysicalPosition physicalPosition) |
boolean |
cleanOutRecord(ORecordId recordId,
int recordVersion,
int iMode,
ORecordCallback<Boolean> callback) |
void |
clearProperties() |
void |
close(boolean iForce,
boolean onDelete) |
Object |
command(OCommandRequestText iCommand)
Execute the command remotely and get the results back.
|
List<ORecordOperation> |
commit(OTransaction iTx,
Runnable callback) |
OStorageRemote |
copy(ODatabaseDocumentTx source,
ODatabaseDocumentTx dest) |
long |
count(int iClusterId) |
long |
count(int[] iClusterIds) |
long |
count(int[] iClusterIds,
boolean countTombstones) |
long |
count(int iClusterId,
boolean countTombstones) |
long |
countRecords()
Returns the total number of records.
|
void |
create(Map<String,Object> iOptions) |
OStorageOperationResult<OPhysicalPosition> |
createRecord(ORecordId iRid,
byte[] iContent,
int iRecordVersion,
byte iRecordType,
int iMode,
ORecordCallback<Long> iCallback) |
void |
delete() |
OStorageOperationResult<Boolean> |
deleteRecord(ORecordId iRid,
int iVersion,
int iMode,
ORecordCallback<Boolean> iCallback) |
boolean |
dropCluster(int iClusterId,
boolean iTruncate)
Drops a cluster.
|
void |
endRequest(OChannelBinaryAsynchClient iNetwork)
Ends the request and unlock the write lock
|
void |
endResponse(OChannelBinaryAsynchClient iNetwork)
End response reached: release the channel in the pool to being reused
|
boolean |
exists() |
OPhysicalPosition[] |
floorPhysicalPositions(int clusterId,
OPhysicalPosition physicalPosition) |
OContextConfiguration |
getClientConfiguration() |
OCluster |
getClusterById(int iClusterId) |
OCluster |
getClusterByName(String iClusterName) |
ODocument |
getClusterConfiguration() |
long[] |
getClusterDataRange(int iClusterId)
Returns a pair of long values telling the begin and end positions of data in the requested cluster.
|
int |
getClusterIdByName(String iClusterName) |
Collection<OCluster> |
getClusterInstances() |
int |
getClusterMap() |
Set<String> |
getClusterNames() |
int |
getClusters() |
ORecordConflictStrategy |
getConflictStrategy() |
protected String |
getCurrentServerURL() |
protected OStorageRemoteSession |
getCurrentSession() |
int |
getDefaultClusterId() |
protected int |
getDefaultPort() |
protected int |
getDefaultSSLPort() |
OChannelBinaryAsynchClient |
getNetwork(String iCurrentURL) |
protected String |
getNextAvailableServerURL(boolean iIsConnectOperation,
OStorageRemoteSession session) |
String |
getPhysicalClusterNameById(int iClusterId) |
ORecordMetadata |
getRecordMetadata(ORID rid) |
protected void |
getResponse(OChannelBinaryAsynchClient iNetwork,
OStorageRemoteSession session) |
OSBTreeCollectionManager |
getSBtreeCollectionManager() |
protected String |
getServerURFromList(boolean iNextAvailable,
OStorageRemoteSession session) |
String |
getServerURL() |
int |
getSessionId() |
long |
getSize()
Returns the size of the database.
|
String |
getType()
Returns the storage's type.
|
String |
getURL() |
String |
getUserName() |
int |
getUsers() |
long |
getVersion()
Returns current storage's version as serial.
|
OStorageOperationResult<Boolean> |
hideRecord(ORecordId recordId,
int mode,
ORecordCallback<Boolean> callback) |
OPhysicalPosition[] |
higherPhysicalPositions(int iClusterId,
OPhysicalPosition iClusterPosition) |
void |
importDatabase(String options,
InputStream inputStream,
String name,
OCommandOutputListener listener) |
String |
incrementalBackup(String backupDirectory) |
boolean |
isAssigningClusterIds() |
boolean |
isClosed() |
boolean |
isPermanentRequester() |
boolean |
isRemote() |
OPhysicalPosition[] |
lowerPhysicalPositions(int iClusterId,
OPhysicalPosition physicalPosition) |
<T> T |
networkOperation(OStorageRemoteOperation<T> operation,
String errorMessage) |
<T> T |
networkOperationRetry(OStorageRemoteOperation<T> operation,
String errorMessage,
int retry) |
void |
open(String iUserName,
String iUserPassword,
Map<String,Object> iOptions) |
protected void |
openRemoteDatabase() |
void |
openRemoteDatabase(OChannelBinaryAsynchClient network) |
protected void |
openRemoteDatabase(String currentURL) |
protected void |
parseServerURLs()
Parse the URLs.
|
OStorageOperationResult<ORawBuffer> |
readRecord(ORecordId iRid,
String iFetchPlan,
boolean iIgnoreCache,
boolean prefetchRecords,
ORecordCallback<ORawBuffer> iCallback) |
OStorageOperationResult<ORawBuffer> |
readRecordIfVersionIsNotLatest(ORecordId rid,
String fetchPlan,
boolean ignoreCache,
int recordVersion) |
protected Object |
readSynchResult(OChannelBinaryAsynchClient network,
ODatabaseDocument database,
List<ORecord> temporaryResults) |
void |
recyclePosition(ORecordId iRecordId,
byte[] content,
int recordVersion,
byte recordType)
Resurrects a record that was previously deleted.
|
void |
reload() |
void |
removeProperty(String property) |
void |
removeSessions(String url) |
int |
removeUser() |
protected String |
reopenRemoteDatabase() |
void |
restore(InputStream in,
Map<String,Object> options,
Callable<Object> callable,
OCommandOutputListener iListener)
Executes a restore of a database backup.
|
void |
restoreFromIncrementalBackup(String filePath) |
void |
rollback(OTransaction iTx) |
protected void |
sendClientInfo(OChannelBinaryAsynchClient network,
String driverName,
boolean supportsPushMessages,
boolean collectStats) |
void |
setCharset(String charset) |
void |
setClusterSelection(String clusterSelection) |
void |
setConflictStrategy(ORecordConflictStrategy iResolver) |
void |
setDateFormat(String dateFormat) |
void |
setDateTimeFormat(String dateTimeFormat) |
void |
setDefaultClusterId(int defaultClusterId) |
void |
setIndexMgrRecordId(String indexMgrRecordId) |
void |
setLocaleCountry(String localeCountry) |
void |
setLocaleLanguage(String localeLanguage) |
void |
setMinimumClusters(int minimumClusters) |
void |
setProperty(String property,
String value) |
void |
setRecordSerializer(String recordSerializer,
int version) |
void |
setSchemaRecordId(String schemaRecordId) |
void |
setTimeZone(TimeZone timeZone) |
void |
setValidation(boolean validation) |
void |
synch() |
void |
updateClusterConfiguration(String iConnectedURL,
byte[] obj) |
void |
updateConfiguration() |
OStorageOperationResult<Integer> |
updateRecord(ORecordId iRid,
boolean updateContent,
byte[] iContent,
int iVersion,
byte iRecordType,
int iMode,
ORecordCallback<Integer> iCallback) |
protected String |
useNewServerURL(String iUrl) |
callInLock, checkForClusterPermissions, checkForRecordValidity, close, dropCluster, existsResource, getComponentsFactory, getConfiguration, getName, getResource, getStatus, getUnderlying, isDistributed, normalizeName, removeResource, shutdown, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcallInLock, checkForClusterPermissions, checkForRecordValidity, close, dropCluster, getComponentsFactory, getConfiguration, getName, getStatus, getUnderlying, isDistributed, shutdownexistsResource, getResource, removeResourcepublic static final String PARAM_CONNECTION_STRATEGY
public static final String DRIVER_NAME
protected ORemoteConnectionManager connectionManager
public OStorageRemote(String iClientId, String iURL, String iMode) throws IOException
IOExceptionpublic OStorageRemote(String iClientId, String iURL, String iMode, OStorage.STATUS status, boolean managePushMessages) throws IOException
IOExceptionpublic <T> T asyncNetworkOperation(OStorageRemoteOperationWrite write, OStorageRemoteOperationRead<T> read, int mode, ORecordId recordId, ORecordCallback<T> callback, String errorMessage)
public <T> T networkOperationRetry(OStorageRemoteOperation<T> operation, String errorMessage, int retry)
public <T> T networkOperation(OStorageRemoteOperation<T> operation, String errorMessage)
public <T> T baseNetworkOperation(OStorageRemoteOperation<T> operation, String errorMessage, int retry)
public boolean isAssigningClusterIds()
isAssigningClusterIds in interface OStorageisAssigningClusterIds in class OStorageAbstractpublic int getSessionId()
public String getServerURL()
public OSBTreeCollectionManager getSBtreeCollectionManager()
getSBtreeCollectionManager in interface OStoragepublic void close(boolean iForce,
boolean onDelete)
close in interface OStorageclose in class OStorageAbstractpublic int getUsers()
getUsers in interface OStorageProxypublic int addUser()
addUser in interface OStorageProxypublic int removeUser()
removeUser in interface OStorageProxypublic Set<String> getClusterNames()
getClusterNames in interface OStoragepublic OStorageOperationResult<OPhysicalPosition> createRecord(ORecordId iRid, byte[] iContent, int iRecordVersion, byte iRecordType, int iMode, ORecordCallback<Long> iCallback)
createRecord in interface OStoragepublic ORecordMetadata getRecordMetadata(ORID rid)
getRecordMetadata in interface OStoragepublic OStorageOperationResult<ORawBuffer> readRecordIfVersionIsNotLatest(ORecordId rid, String fetchPlan, boolean ignoreCache, int recordVersion) throws ORecordNotFoundException
readRecordIfVersionIsNotLatest in interface OStorageORecordNotFoundExceptionpublic OStorageOperationResult<ORawBuffer> readRecord(ORecordId iRid, String iFetchPlan, boolean iIgnoreCache, boolean prefetchRecords, ORecordCallback<ORawBuffer> iCallback)
readRecord in interface OStoragepublic String incrementalBackup(String backupDirectory)
incrementalBackup in interface OStoragepublic void restoreFromIncrementalBackup(String filePath)
restoreFromIncrementalBackup in interface OStoragepublic OStorageOperationResult<Integer> updateRecord(ORecordId iRid, boolean updateContent, byte[] iContent, int iVersion, byte iRecordType, int iMode, ORecordCallback<Integer> iCallback)
updateRecord in interface OStoragepublic void recyclePosition(ORecordId iRecordId, byte[] content, int recordVersion, byte recordType)
OStoragerecyclePosition in interface OStoragepublic OStorageOperationResult<Boolean> deleteRecord(ORecordId iRid, int iVersion, int iMode, ORecordCallback<Boolean> iCallback)
deleteRecord in interface OStoragepublic OStorageOperationResult<Boolean> hideRecord(ORecordId recordId, int mode, ORecordCallback<Boolean> callback)
hideRecord in interface OStoragepublic boolean cleanOutRecord(ORecordId recordId, int recordVersion, int iMode, ORecordCallback<Boolean> callback)
cleanOutRecord in interface OStoragepublic 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 OContextConfiguration getClientConfiguration()
public long count(int iClusterId,
boolean countTombstones)
public long[] getClusterDataRange(int iClusterId)
OStoragegetClusterDataRange in interface OStorageiClusterId - Cluster idpublic OPhysicalPosition[] higherPhysicalPositions(int iClusterId, OPhysicalPosition iClusterPosition)
higherPhysicalPositions in interface OStoragepublic OPhysicalPosition[] ceilingPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
ceilingPhysicalPositions in interface OStoragepublic OPhysicalPosition[] lowerPhysicalPositions(int iClusterId, OPhysicalPosition physicalPosition)
lowerPhysicalPositions in interface OStoragepublic OPhysicalPosition[] floorPhysicalPositions(int clusterId, OPhysicalPosition physicalPosition)
floorPhysicalPositions in interface OStoragepublic long getSize()
OStoragepublic long countRecords()
OStoragecountRecords in interface OStoragecountRecords in class OStorageAbstractpublic long count(int[] iClusterIds,
boolean countTombstones)
public Object command(OCommandRequestText iCommand)
protected Object readSynchResult(OChannelBinaryAsynchClient network, ODatabaseDocument database, List<ORecord> temporaryResults) throws IOException
IOExceptionpublic List<ORecordOperation> commit(OTransaction iTx, Runnable callback)
public void rollback(OTransaction iTx)
public int getClusterIdByName(String iClusterName)
getClusterIdByName in interface OStoragepublic int getDefaultClusterId()
getDefaultClusterId in interface OStoragepublic void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId in interface OStoragepublic int addCluster(String iClusterName, boolean forceListBased, Object... iArguments)
OStorageaddCluster in interface OStorageiClusterName - name of the clusterpublic int addCluster(String iClusterName, int iRequestedId, boolean forceListBased, Object... iParameters)
OStorageaddCluster in interface OStorageiClusterName - name of the clusteriRequestedId - requested id of the clusterpublic boolean dropCluster(int iClusterId,
boolean iTruncate)
OStoragedropCluster in interface OStorageiClusterId - id of the cluster to deletepublic String getPhysicalClusterNameById(int iClusterId)
getPhysicalClusterNameById in interface OStoragepublic int getClusterMap()
public Collection<OCluster> getClusterInstances()
getClusterInstances in interface OStoragepublic OCluster getClusterById(int iClusterId)
getClusterById in interface OStoragepublic long getVersion()
OStorageAbstractgetVersion in interface OStoragegetVersion in class OStorageAbstractpublic ODocument getClusterConfiguration()
public void endRequest(OChannelBinaryAsynchClient iNetwork) throws IOException
IOExceptionpublic void endResponse(OChannelBinaryAsynchClient iNetwork) throws IOException
IOExceptionpublic boolean isPermanentRequester()
public void updateClusterConfiguration(String iConnectedURL, byte[] obj)
public void removeSessions(String url)
public OCluster getClusterByName(String iClusterName)
getClusterByName in interface OStoragegetClusterByName in class OStorageAbstractpublic ORecordConflictStrategy getConflictStrategy()
getConflictStrategy in interface OStoragepublic void setConflictStrategy(ORecordConflictStrategy iResolver)
setConflictStrategy in interface OStoragepublic String getURL()
getURL in interface OStoragegetURL in class OStorageAbstractpublic int getClusters()
getClusters in interface OStoragepublic String getType()
OStoragepublic String getUserName()
getUserName in interface OStorageProxyprotected String reopenRemoteDatabase() throws IOException
IOExceptionprotected void openRemoteDatabase()
throws IOException
IOExceptionpublic void openRemoteDatabase(OChannelBinaryAsynchClient network) throws IOException
IOExceptionprotected void openRemoteDatabase(String currentURL)
protected void sendClientInfo(OChannelBinaryAsynchClient network, String driverName, boolean supportsPushMessages, boolean collectStats) throws IOException
IOExceptionprotected void parseServerURLs()
protected int getDefaultPort()
protected int getDefaultSSLPort()
public OChannelBinaryAsynchClient beginRequest(OChannelBinaryAsynchClient network, byte iCommand, OStorageRemoteSession session) throws IOException
iCommand - id. Ids described at OChannelBinaryProtocolIOExceptionprotected String getNextAvailableServerURL(boolean iIsConnectOperation, OStorageRemoteSession session)
protected String getCurrentServerURL()
protected String getServerURFromList(boolean iNextAvailable, OStorageRemoteSession session)
public OChannelBinaryAsynchClient getNetwork(String iCurrentURL)
public void beginResponse(OChannelBinaryAsynchClient iNetwork, OStorageRemoteSession session) throws IOException
IOExceptionprotected void getResponse(OChannelBinaryAsynchClient iNetwork, OStorageRemoteSession session) throws IOException
IOExceptionprotected OStorageRemoteSession getCurrentSession()
public boolean isClosed()
isClosed in interface OStorageisClosed in class OStorageAbstractpublic OStorageRemote copy(ODatabaseDocumentTx source, ODatabaseDocumentTx dest)
copy in interface OStorageProxypublic void importDatabase(String options, InputStream inputStream, String name, OCommandOutputListener listener)
public void updateConfiguration()
updateConfiguration in interface OStoragepublic void setRecordSerializer(String recordSerializer, int version)
setRecordSerializer in interface OStoragepublic void setProperty(String property, String value)
setProperty in interface OStoragepublic void setDateFormat(String dateFormat)
setDateFormat in interface OStoragepublic void setDateTimeFormat(String dateTimeFormat)
setDateTimeFormat in interface OStoragepublic void setTimeZone(TimeZone timeZone)
setTimeZone in interface OStoragepublic void setLocaleCountry(String localeCountry)
setLocaleCountry in interface OStoragepublic void setLocaleLanguage(String localeLanguage)
setLocaleLanguage in interface OStoragepublic void setCharset(String charset)
setCharset 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 clearProperties()
clearProperties in interface OStoragepublic void removeProperty(String property)
removeProperty in interface OStoragepublic void setSchemaRecordId(String schemaRecordId)
setSchemaRecordId in interface OStoragepublic void setIndexMgrRecordId(String indexMgrRecordId)
setIndexMgrRecordId in interface OStorageCopyright © 2009–2025 OrientDB. All rights reserved.