public class OStorageRemote
extends com.orientechnologies.orient.core.storage.OStorageAbstract
implements com.orientechnologies.orient.core.storage.OStorageProxy
| 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 |
configuration, level2Cache, lock, mode, name, status, url, version| Constructor and Description |
|---|
OStorageRemote(String iClientId,
String iURL,
String iMode) |
| 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.
|
protected OChannelBinaryClient |
beginRequest(byte iCommand)
Acquire a network channel from the pool.
|
protected void |
beginResponse(OChannelBinaryClient 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) |
protected void |
checkConnection() |
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) |
protected void |
closeChannel(OChannelBinaryClient iNetwork)
Closes the channel and remove it from the pool.
|
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) |
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) |
protected void |
createConnectionPool() |
protected OChannelBinaryClient |
createNetworkConnection() |
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(OChannelBinaryClient iNetwork)
Ends the request and unlock the write lock
|
void |
endResponse(OChannelBinaryClient 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() |
String |
getClientId() |
com.orientechnologies.orient.core.storage.OCluster |
getClusterById(int iClusterId) |
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) |
com.orientechnologies.orient.core.storage.ODataSegment |
getDataSegmentById(int iDataSegmentId) |
int |
getDataSegmentIdByName(String iName) |
int |
getDefaultClusterId() |
protected String |
getDefaultHost() |
protected int |
getDefaultPort() |
String |
getPhysicalClusterNameById(int iClusterId) |
com.orientechnologies.orient.core.storage.ORecordMetadata |
getRecordMetadata(com.orientechnologies.orient.core.id.ORID rid) |
protected void |
getResponse(OChannelBinaryClient iNetwork) |
int |
getSessionId() |
long |
getSize() |
String |
getType() |
String |
getURL() |
long |
getVersion() |
protected void |
handleException(String message,
Exception exception)
Handles exceptions.
|
com.orientechnologies.orient.core.storage.OPhysicalPosition[] |
higherPhysicalPositions(int iClusterId,
com.orientechnologies.orient.core.storage.OPhysicalPosition iClusterPosition) |
boolean |
isHashClustersAreUsed() |
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 URL in the following formats:
|
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) |
void |
reload() |
void |
removeRemoteServerEventListener() |
void |
rollback(com.orientechnologies.orient.core.tx.OTransaction iTx) |
protected void |
sendClientInfo(OChannelBinaryClient network) |
void |
setAsynchEventListener(ORemoteServerEventListener iListener) |
void |
setDefaultClusterId(int defaultClusterId) |
void |
setSessionId(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, getConfiguration, getLevel2Cache, getLock, getName, getStatus, getUsers, isClosed, removeUser, toStringexistsResource, getResource, removeResourceclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic 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 int getSessionId()
public void setSessionId(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)
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)
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 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 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 boolean isHashClustersAreUsed()
isHashClustersAreUsed 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)
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 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()
protected void handleException(String message, Exception exception)
message - exception - protected void openRemoteDatabase()
throws IOException
IOExceptionprotected void sendClientInfo(OChannelBinaryClient network) throws IOException
IOExceptionprotected void parseServerURLs()
protected String getDefaultHost()
protected int getDefaultPort()
protected OChannelBinaryClient createNetworkConnection() throws IOException, UnknownHostException
IOExceptionUnknownHostExceptionprotected void checkConnection()
protected OChannelBinaryClient beginRequest(byte iCommand) throws IOException
iCommand - IOExceptionpublic void endRequest(OChannelBinaryClient iNetwork) throws IOException
IOExceptionprotected void closeChannel(OChannelBinaryClient iNetwork)
iNetwork - Channel to close and removeprotected void beginResponse(OChannelBinaryClient iNetwork) throws IOException
IOExceptionpublic void endResponse(OChannelBinaryClient iNetwork)
public boolean isPermanentRequester()
protected void getResponse(OChannelBinaryClient iNetwork) throws IOException
IOExceptionpublic void updateClusterConfiguration(byte[] obj)
protected void createConnectionPool()
throws IOException,
UnknownHostException
IOExceptionUnknownHostExceptionpublic 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 void setDefaultClusterId(int defaultClusterId)
setDefaultClusterId in interface com.orientechnologies.orient.core.storage.OStoragepublic String getType()
getType in interface com.orientechnologies.orient.core.storage.OStorageCopyright © 2009-2013 Orient Technologies. All Rights Reserved.