public class OStorageRemote
extends com.orientechnologies.orient.core.storage.OStorageAbstract
| 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,
String iLocation,
String iDataSegmentName,
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.
|
protected void |
checkConnection() |
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 |
countRecords() |
void |
create(Map<String,Object> iOptions) |
protected void |
createConnectionPool() |
protected OChannelBinaryClient |
createNetworkConnection() |
com.orientechnologies.orient.core.storage.OPhysicalPosition |
createRecord(int iDataSegmentId,
com.orientechnologies.orient.core.id.ORecordId iRid,
byte[] iContent,
int iRecordVersion,
byte iRecordType,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Long> iCallback) |
void |
delete() |
boolean |
deleteRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
int iVersion,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Boolean> iCallback) |
boolean |
dropCluster(int iClusterId) |
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() |
ORemoteServerEventListener |
getAsynchEventListener() |
String |
getClientId() |
com.orientechnologies.orient.core.storage.OCluster |
getClusterById(int iClusterId) |
com.orientechnologies.orient.core.record.impl.ODocument |
getClusterConfiguration() |
long[] |
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) |
protected void |
getResponse(OChannelBinaryClient iNetwork) |
int |
getSessionId() |
long |
getSize() |
String |
getURL() |
long |
getVersion() |
protected void |
handleException(String iMessage,
Exception iException)
Handles exceptions.
|
boolean |
isPermanentRequester() |
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.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) |
void |
reload() |
void |
removeRemoteServerEventListener() |
void |
rollback(com.orientechnologies.orient.core.tx.OTransaction iTx) |
protected void |
sendClientInfo(OChannelBinaryClient network) |
void |
setAsynchEventListener(ORemoteServerEventListener iListener) |
void |
setSessionId(int iSessionId) |
void |
synch() |
void |
updateClusterConfiguration(com.orientechnologies.orient.core.record.impl.ODocument obj) |
int |
updateRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
byte[] iContent,
int iVersion,
byte iRecordType,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Integer> iCallback) |
addUser, callInLock, checkForClose, checkForRecordValidity, close, dropCluster, getConfiguration, getLevel2Cache, getLock, getName, getUsers, isClosed, removeUser, toStringexistsResource, getResource, removeResourcepublic 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 reload()
public boolean exists()
public void close(boolean iForce)
close in interface com.orientechnologies.orient.core.storage.OStorageclose in class com.orientechnologies.orient.core.storage.OStorageAbstractpublic void delete()
public com.orientechnologies.orient.core.storage.OPhysicalPosition createRecord(int iDataSegmentId,
com.orientechnologies.orient.core.id.ORecordId iRid,
byte[] iContent,
int iRecordVersion,
byte iRecordType,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Long> iCallback)
public 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)
public int updateRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
byte[] iContent,
int iVersion,
byte iRecordType,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Integer> iCallback)
public boolean deleteRecord(com.orientechnologies.orient.core.id.ORecordId iRid,
int iVersion,
int iMode,
com.orientechnologies.orient.core.storage.ORecordCallback<Boolean> iCallback)
public long count(int iClusterId)
public long[] getClusterDataRange(int iClusterId)
public long getSize()
public long countRecords()
countRecords in interface com.orientechnologies.orient.core.storage.OStoragecountRecords in class com.orientechnologies.orient.core.storage.OStorageAbstractpublic long count(int[] iClusterIds)
public Object command(com.orientechnologies.orient.core.command.OCommandRequestText iCommand)
public void commit(com.orientechnologies.orient.core.tx.OTransaction iTx)
public void rollback(com.orientechnologies.orient.core.tx.OTransaction iTx)
public int getClusterIdByName(String iClusterName)
public int getDefaultClusterId()
public int addCluster(String iClusterType, String iClusterName, String iLocation, String iDataSegmentName, Object... iArguments)
public boolean dropCluster(int iClusterId)
public int addDataSegment(String iDataSegmentName)
public boolean dropDataSegment(String iSegmentName)
public void synch()
public String getPhysicalClusterNameById(int iClusterId)
public int getClusterMap()
public Collection<com.orientechnologies.orient.core.storage.OCluster> getClusterInstances()
public com.orientechnologies.orient.core.storage.OCluster getClusterById(int iClusterId)
public 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 iMessage, Exception iException)
iMessage - iException - 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(com.orientechnologies.orient.core.record.impl.ODocument 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)
public com.orientechnologies.orient.core.storage.ODataSegment getDataSegmentById(int iDataSegmentId)
public int getClusters()
Copyright © 2009-2012 Orient Technologies. All Rights Reserved.