public class OStorageRemote
extends com.orientechnologies.orient.core.storage.OStorageAbstract
implements com.orientechnologies.orient.core.storage.OStorageProxy
com.orientechnologies.orient.core.storage.OStorage.CLUSTER_TYPE, com.orientechnologies.orient.core.storage.OStorage.LOCKING_STRATEGY, com.orientechnologies.orient.core.storage.OStorage.SIZE, com.orientechnologies.orient.core.storage.OStorage.STATUS| Modifier and Type | Field and Description |
|---|---|
protected Map<String,com.orientechnologies.orient.core.storage.OCluster> |
clusterMap |
static String |
PARAM_DB_TYPE |
static String |
PARAM_MAX_POOL |
static String |
PARAM_MIN_POOL |
protected List<String> |
serverURLs |
componentsFactory, configuration, level2Cache, lock, mode, name, status, url, version| Constructor and Description |
|---|
OStorageRemote(String iClientId,
String iURL,
String iMode) |
OStorageRemote(String iClientId,
String iURL,
String iMode,
com.orientechnologies.orient.core.storage.OStorage.STATUS status) |
| Modifier and Type | Method and Description |
|---|---|
int |
addCluster(String iClusterType,
String iClusterName,
int iRequestedId,
String iLocation,
String iDataSegmentName,
boolean forceListBased,
Object... iParameters) |
int |
addCluster(String iClusterType,
String iClusterName,
String iLocation,
String iDataSegmentName,
boolean forceListBased,
Object... iArguments) |
int |
addDataSegment(String iDataSegmentName) |
int |
addDataSegment(String iSegmentName,
String iLocation) |
protected String |
addHost(String host)
Registers the remote server with port.
|
void |
backup(OutputStream out,
Map<String,Object> options,
Callable<Object> callable,
com.orientechnologies.orient.core.command.OCommandOutputListener iListener,
int compressionLevel,
int bufferSize) |
protected OChannelBinaryAsynchClient |
beginRequest(byte iCommand)
Acquire a network channel from the pool.
|
protected void |
beginResponse(OChannelBinaryAsynchClient iNetwork)
Starts listening the response.
|
<V> V |
callInRecordLock(Callable<V> iCallable,
com.orientechnologies.orient.core.id.ORID rid,
boolean iExclusiveLock) |
com.orientechnologies.orient.core.storage.OPhysicalPosition[] |
ceilingPhysicalPositions(int clusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition physicalPosition) |
boolean |
cleanOutRecord(com.orientechnologies.orient.core.id.ORecordId recordId,
com.orientechnologies.orient.core.version.ORecordVersion recordVersion,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Boolean> callback) |
void |
close(boolean iForce,
boolean onDelete) |
Object |
command(com.orientechnologies.orient.core.command.OCommandRequestText iCommand)
Execute the command remotely and get the results back.
|
void |
commit(com.orientechnologies.orient.core.tx.OTransaction iTx,
Runnable callback) |
long |
count(int iClusterId) |
long |
count(int[] iClusterIds) |
long |
count(int[] iClusterIds,
boolean countTombstones) |
long |
count(int iClusterId,
boolean countTombstones) |
long |
countRecords() |
void |
create(Map<String,Object> iOptions) |
com.orientechnologies.orient.core.storage.OStorageOperationResult<com.orientechnologies.orient.core.storage.OPhysicalPosition> |
createRecord(int iDataSegmentId,
com.orientechnologies.orient.core.id.ORecordId iRid,
byte[] iContent,
com.orientechnologies.orient.core.version.ORecordVersion iRecordVersion,
byte iRecordType,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<com.orientechnologies.orient.core.id.OClusterPosition> iCallback) |
void |
delete() |
com.orientechnologies.orient.core.storage.OStorageOperationResult<Boolean> |
deleteRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
com.orientechnologies.orient.core.version.ORecordVersion iVersion,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Boolean> iCallback) |
boolean |
dropCluster(int iClusterId,
boolean iTruncate) |
boolean |
dropDataSegment(String iSegmentName) |
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() |
com.orientechnologies.orient.core.storage.OPhysicalPosition[] |
floorPhysicalPositions(int clusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition physicalPosition) |
ORemoteServerEventListener |
getAsynchEventListener() |
protected OChannelBinaryAsynchClient |
getAvailableNetwork(String iCurrentURL) |
String |
getClientId() |
com.orientechnologies.orient.core.storage.OCluster |
getClusterById(int iClusterId) |
com.orientechnologies.orient.core.storage.OCluster |
getClusterByName(String iClusterName) |
com.orientechnologies.orient.core.record.impl.ODocument |
getClusterConfiguration() |
com.orientechnologies.orient.core.id.OClusterPosition[] |
getClusterDataRange(int iClusterId) |
int |
getClusterIdByName(String iClusterName) |
Collection<com.orientechnologies.orient.core.storage.OCluster> |
getClusterInstances() |
int |
getClusterMap() |
Set<String> |
getClusterNames() |
int |
getClusters() |
String |
getClusterTypeByName(String iClusterName) |
Class<OSBTreeCollectionManagerRemote> |
getCollectionManagerClass() |
protected String |
getCurrentServerURL() |
com.orientechnologies.orient.core.storage.ODataSegment |
getDataSegmentById(int iDataSegmentId) |
int |
getDataSegmentIdByName(String iName) |
int |
getDefaultClusterId() |
protected String |
getDefaultHost() |
protected int |
getDefaultPort() |
protected int |
getDefaultSSLPort() |
String |
getPhysicalClusterNameById(int iClusterId) |
com.orientechnologies.orient.core.storage.ORecordMetadata |
getRecordMetadata(com.orientechnologies.orient.core.id.ORID rid) |
protected void |
getResponse(OChannelBinaryAsynchClient iNetwork) |
String |
getServerURL() |
int |
getSessionId() |
long |
getSize() |
String |
getType() |
String |
getURL() |
long |
getVersion() |
protected void |
handleException(OChannelBinaryAsynchClient iNetwork,
String message,
Exception exception)
Handles exceptions.
|
com.orientechnologies.orient.core.storage.OStorageOperationResult<Boolean> |
hideRecord(com.orientechnologies.orient.core.id.ORecordId recordId,
int mode,
com.orientechnologies.orient.core.storage.ORecordCallback<Boolean> callback) |
com.orientechnologies.orient.core.storage.OPhysicalPosition[] |
higherPhysicalPositions(int iClusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition iClusterPosition) |
boolean |
isPermanentRequester() |
com.orientechnologies.orient.core.storage.OPhysicalPosition[] |
lowerPhysicalPositions(int iClusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition physicalPosition) |
void |
open(String iUserName,
String iUserPassword,
Map<String,Object> iOptions) |
protected void |
openRemoteDatabase() |
protected void |
parseServerURLs()
Parse the URLs.
|
com.orientechnologies.orient.core.storage.OStorageOperationResult<com.orientechnologies.orient.core.storage.ORawBuffer> |
readRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
String iFetchPlan,
boolean iIgnoreCache,
com.orientechnologies.orient.core.storage.ORecordCallback<com.orientechnologies.orient.core.storage.ORawBuffer> iCallback,
boolean loadTombstones,
com.orientechnologies.orient.core.storage.OStorage.LOCKING_STRATEGY iLockingStrategy) |
void |
reload() |
void |
removeRemoteServerEventListener() |
protected String |
removeServerURL(String iUrl) |
void |
restore(InputStream in,
Map<String,Object> options,
Callable<Object> callable,
com.orientechnologies.orient.core.command.OCommandOutputListener iListener) |
void |
rollback(com.orientechnologies.orient.core.tx.OTransaction iTx) |
protected void |
sendClientInfo(OChannelBinaryAsynchClient network) |
void |
setAsynchEventListener(ORemoteServerEventListener iListener) |
void |
setDefaultClusterId(int defaultClusterId) |
void |
setSessionId(String iServerURL,
int iSessionId) |
void |
synch() |
void |
updateClusterConfiguration(byte[] obj) |
com.orientechnologies.orient.core.storage.OStorageOperationResult<com.orientechnologies.orient.core.version.ORecordVersion> |
updateRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
byte[] iContent,
com.orientechnologies.orient.core.version.ORecordVersion iVersion,
byte iRecordType,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<com.orientechnologies.orient.core.version.ORecordVersion> iCallback) |
boolean |
updateReplica(int dataSegmentId,
com.orientechnologies.orient.core.id.ORecordId rid,
byte[] content,
com.orientechnologies.orient.core.version.ORecordVersion recordVersion,
byte recordType) |
addUser, callInLock, checkForClose, checkForClusterPermissions, checkForRecordValidity, close, dropCluster, getComponentsFactory, getConfiguration, getLastOperationId, getLevel2Cache, getLock, getName, getStatus, getUnderlying, getUsers, isClosed, isDistributed, removeUser, toStringexistsResource, getResource, removeResourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddUser, callInLock, checkForClusterPermissions, checkForRecordValidity, close, dropCluster, getComponentsFactory, getConfiguration, getLastOperationId, getLevel2Cache, getLock, getName, getStatus, getUnderlying, getUsers, isClosed, isDistributed, removeUserpublic static final String PARAM_MIN_POOL
public static final String PARAM_MAX_POOL
public static final String PARAM_DB_TYPE
public OStorageRemote(String iClientId, String iURL, String iMode) throws IOException
IOExceptionpublic OStorageRemote(String iClientId, String iURL, String iMode, com.orientechnologies.orient.core.storage.OStorage.STATUS status) throws IOException
IOExceptionpublic int getSessionId()
public String getServerURL()
public void setSessionId(String iServerURL, int iSessionId)
public ORemoteServerEventListener getAsynchEventListener()
public void setAsynchEventListener(ORemoteServerEventListener iListener)
public void removeRemoteServerEventListener()
public void open(String iUserName, String iUserPassword, Map<String,Object> iOptions)
open in interface com.orientechnologies.orient.core.storage.OStoragepublic void reload()
reload in interface com.orientechnologies.orient.core.storage.OStoragepublic void create(Map<String,Object> iOptions)
create in interface com.orientechnologies.orient.core.storage.OStoragepublic boolean exists()
exists in interface com.orientechnologies.orient.core.storage.OStoragepublic void close(boolean iForce,
boolean onDelete)
close in interface com.orientechnologies.orient.core.storage.OStorageclose in class com.orientechnologies.orient.core.storage.OStorageAbstractpublic void delete()
delete in interface com.orientechnologies.orient.core.storage.OStoragepublic Set<String> getClusterNames()
getClusterNames in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OStorageOperationResult<com.orientechnologies.orient.core.storage.OPhysicalPosition> createRecord(int iDataSegmentId,
com.orientechnologies.orient.core.id.ORecordId iRid,
byte[] iContent,
com.orientechnologies.orient.core.version.ORecordVersion iRecordVersion,
byte iRecordType,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<com.orientechnologies.orient.core.id.OClusterPosition> iCallback)
createRecord in interface com.orientechnologies.orient.core.storage.OStoragepublic boolean updateReplica(int dataSegmentId,
com.orientechnologies.orient.core.id.ORecordId rid,
byte[] content,
com.orientechnologies.orient.core.version.ORecordVersion recordVersion,
byte recordType)
throws IOException
updateReplica in interface com.orientechnologies.orient.core.storage.OStorageIOExceptionpublic <V> V callInRecordLock(Callable<V> iCallable, com.orientechnologies.orient.core.id.ORID rid, boolean iExclusiveLock)
callInRecordLock in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.ORecordMetadata getRecordMetadata(com.orientechnologies.orient.core.id.ORID rid)
getRecordMetadata in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OStorageOperationResult<com.orientechnologies.orient.core.storage.ORawBuffer> readRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
String iFetchPlan,
boolean iIgnoreCache,
com.orientechnologies.orient.core.storage.ORecordCallback<com.orientechnologies.orient.core.storage.ORawBuffer> iCallback,
boolean loadTombstones,
com.orientechnologies.orient.core.storage.OStorage.LOCKING_STRATEGY iLockingStrategy)
readRecord in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OStorageOperationResult<com.orientechnologies.orient.core.version.ORecordVersion> updateRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
byte[] iContent,
com.orientechnologies.orient.core.version.ORecordVersion iVersion,
byte iRecordType,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<com.orientechnologies.orient.core.version.ORecordVersion> iCallback)
updateRecord in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OStorageOperationResult<Boolean> deleteRecord(com.orientechnologies.orient.core.id.ORecordId iRid, com.orientechnologies.orient.core.version.ORecordVersion iVersion, int iMode, com.orientechnologies.orient.core.storage.ORecordCallback<Boolean> iCallback)
deleteRecord in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OStorageOperationResult<Boolean> hideRecord(com.orientechnologies.orient.core.id.ORecordId recordId, int mode, com.orientechnologies.orient.core.storage.ORecordCallback<Boolean> callback)
hideRecord in interface com.orientechnologies.orient.core.storage.OStoragepublic boolean cleanOutRecord(com.orientechnologies.orient.core.id.ORecordId recordId,
com.orientechnologies.orient.core.version.ORecordVersion recordVersion,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Boolean> callback)
cleanOutRecord in interface com.orientechnologies.orient.core.storage.OStoragepublic void backup(OutputStream out, Map<String,Object> options, Callable<Object> callable, com.orientechnologies.orient.core.command.OCommandOutputListener iListener, int compressionLevel, int bufferSize) throws IOException
backup in interface com.orientechnologies.orient.core.util.OBackupableIOExceptionpublic void restore(InputStream in, Map<String,Object> options, Callable<Object> callable, com.orientechnologies.orient.core.command.OCommandOutputListener iListener) throws IOException
restore in interface com.orientechnologies.orient.core.util.OBackupableIOExceptionpublic long count(int iClusterId)
count in interface com.orientechnologies.orient.core.storage.OStoragepublic long count(int iClusterId,
boolean countTombstones)
count in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.id.OClusterPosition[] getClusterDataRange(int iClusterId)
getClusterDataRange in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OPhysicalPosition[] higherPhysicalPositions(int iClusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition iClusterPosition)
higherPhysicalPositions in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OPhysicalPosition[] ceilingPhysicalPositions(int clusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition physicalPosition)
ceilingPhysicalPositions in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OPhysicalPosition[] lowerPhysicalPositions(int iClusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition physicalPosition)
lowerPhysicalPositions in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OPhysicalPosition[] floorPhysicalPositions(int clusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition physicalPosition)
floorPhysicalPositions in interface com.orientechnologies.orient.core.storage.OStoragepublic long getSize()
getSize in interface com.orientechnologies.orient.core.storage.OStoragepublic long countRecords()
countRecords in interface com.orientechnologies.orient.core.storage.OStoragecountRecords in class com.orientechnologies.orient.core.storage.OStorageAbstractpublic long count(int[] iClusterIds)
count in interface com.orientechnologies.orient.core.storage.OStoragepublic long count(int[] iClusterIds,
boolean countTombstones)
count in interface com.orientechnologies.orient.core.storage.OStoragepublic Object command(com.orientechnologies.orient.core.command.OCommandRequestText iCommand)
command in interface com.orientechnologies.orient.core.storage.OStoragepublic void commit(com.orientechnologies.orient.core.tx.OTransaction iTx,
Runnable callback)
commit in interface com.orientechnologies.orient.core.storage.OStoragepublic void rollback(com.orientechnologies.orient.core.tx.OTransaction iTx)
rollback in interface com.orientechnologies.orient.core.storage.OStoragepublic int getClusterIdByName(String iClusterName)
getClusterIdByName in interface com.orientechnologies.orient.core.storage.OStoragepublic String getClusterTypeByName(String iClusterName)
getClusterTypeByName in interface com.orientechnologies.orient.core.storage.OStoragepublic int getDefaultClusterId()
getDefaultClusterId in interface com.orientechnologies.orient.core.storage.OStoragepublic void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId in interface com.orientechnologies.orient.core.storage.OStoragepublic int addCluster(String iClusterType, String iClusterName, String iLocation, String iDataSegmentName, boolean forceListBased, Object... iArguments)
addCluster in interface com.orientechnologies.orient.core.storage.OStoragepublic int addCluster(String iClusterType, String iClusterName, int iRequestedId, String iLocation, String iDataSegmentName, boolean forceListBased, Object... iParameters)
addCluster in interface com.orientechnologies.orient.core.storage.OStoragepublic boolean dropCluster(int iClusterId,
boolean iTruncate)
dropCluster in interface com.orientechnologies.orient.core.storage.OStoragepublic int addDataSegment(String iDataSegmentName)
addDataSegment in interface com.orientechnologies.orient.core.storage.OStoragepublic int addDataSegment(String iSegmentName, String iLocation)
addDataSegment in interface com.orientechnologies.orient.core.storage.OStoragepublic boolean dropDataSegment(String iSegmentName)
dropDataSegment in interface com.orientechnologies.orient.core.storage.OStoragepublic void synch()
synch in interface com.orientechnologies.orient.core.storage.OStoragepublic String getPhysicalClusterNameById(int iClusterId)
getPhysicalClusterNameById in interface com.orientechnologies.orient.core.storage.OStoragepublic int getClusterMap()
public Collection<com.orientechnologies.orient.core.storage.OCluster> getClusterInstances()
getClusterInstances in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.OCluster getClusterById(int iClusterId)
getClusterById in interface com.orientechnologies.orient.core.storage.OStoragepublic long getVersion()
getVersion in interface com.orientechnologies.orient.core.storage.OStoragegetVersion in class com.orientechnologies.orient.core.storage.OStorageAbstractpublic com.orientechnologies.orient.core.record.impl.ODocument getClusterConfiguration()
public void endRequest(OChannelBinaryAsynchClient iNetwork) throws IOException
IOExceptionpublic void endResponse(OChannelBinaryAsynchClient iNetwork)
public boolean isPermanentRequester()
public void updateClusterConfiguration(byte[] obj)
public com.orientechnologies.orient.core.storage.OCluster getClusterByName(String iClusterName)
getClusterByName in interface com.orientechnologies.orient.core.storage.OStoragegetClusterByName in class com.orientechnologies.orient.core.storage.OStorageAbstractpublic String getURL()
getURL in interface com.orientechnologies.orient.core.storage.OStoragegetURL in class com.orientechnologies.orient.core.storage.OStorageAbstractpublic String getClientId()
public int getDataSegmentIdByName(String iName)
getDataSegmentIdByName in interface com.orientechnologies.orient.core.storage.OStoragepublic com.orientechnologies.orient.core.storage.ODataSegment getDataSegmentById(int iDataSegmentId)
getDataSegmentById in interface com.orientechnologies.orient.core.storage.OStoragepublic int getClusters()
getClusters in interface com.orientechnologies.orient.core.storage.OStoragepublic String getType()
getType in interface com.orientechnologies.orient.core.storage.OStoragepublic Class<OSBTreeCollectionManagerRemote> getCollectionManagerClass()
getCollectionManagerClass in interface com.orientechnologies.orient.core.storage.OStorageprotected void handleException(OChannelBinaryAsynchClient iNetwork, String message, Exception exception)
message - the detail messageexception - cause of the errorprotected void openRemoteDatabase()
throws IOException
IOExceptionprotected void sendClientInfo(OChannelBinaryAsynchClient network) throws IOException
IOExceptionprotected void parseServerURLs()
protected String getDefaultHost()
protected int getDefaultPort()
protected int getDefaultSSLPort()
protected OChannelBinaryAsynchClient beginRequest(byte iCommand) throws IOException
iCommand - id. Ids described at OChannelBinaryProtocolIOExceptionprotected String getCurrentServerURL()
protected OChannelBinaryAsynchClient getAvailableNetwork(String iCurrentURL) throws IOException
IOExceptionprotected void beginResponse(OChannelBinaryAsynchClient iNetwork) throws IOException
IOExceptionprotected void getResponse(OChannelBinaryAsynchClient iNetwork) throws IOException
IOExceptionCopyright © 2009-2014 Orient Technologies. All Rights Reserved.