
public class ODistributedDatabaseImpl extends Object implements ODistributedDatabase
| Modifier and Type | Class and Description |
|---|---|
class |
ODistributedDatabaseImpl.ODistributedLock |
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentHashMap<ODistributedRequestId,ODistributedTxContext> |
activeTxContexts |
protected String |
databaseName |
static String |
DISTRIBUTED_SYNC_JSON_FILENAME |
protected ConcurrentHashMap<com.orientechnologies.orient.core.id.ORID,ODistributedDatabaseImpl.ODistributedLock> |
lockManager |
protected ODistributedAbstractPlugin |
manager |
protected ODistributedMessageServiceImpl |
msgService |
protected ODistributedDatabaseRepairer |
repairer |
protected ODistributedSyncConfiguration |
syncConfiguration |
protected List<ODistributedWorker> |
workerThreads |
| Constructor and Description |
|---|
ODistributedDatabaseImpl(OHazelcastPlugin manager,
ODistributedMessageServiceImpl msgService,
String iDatabaseName,
ODistributedConfiguration cfg) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculateQuorum(com.orientechnologies.orient.core.command.OCommandDistributedReplicateRequest.QUORUM_TYPE quorumType,
Collection<String> clusterNames,
ODistributedConfiguration cfg,
int allAvailableNodes,
int masterAvailableNodes,
boolean checkNodesAreOnline,
String localNodeName) |
protected void |
checkForServerOnline(ODistributedRequest iRequest) |
protected void |
checkLocalNodeInConfiguration(ODistributedConfiguration cfg) |
void |
dumpLocks() |
boolean |
exists() |
void |
filterBeforeThisMomentum(ODistributedMomentum momentum) |
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx |
getDatabaseInstance() |
String |
getDatabaseName() |
ODistributedDatabaseRepairer |
getDatabaseRepairer() |
protected Set<Integer> |
getInvolvedQueuesByPartitionKeys(int[] partitionKeys) |
com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OLogSequenceNumber |
getLastLSN(String server) |
protected String |
getLocalNodeName() |
ODistributedServerManager |
getManager() |
long |
getProcessedRequests() |
long |
getReceivedRequests() |
com.orientechnologies.orient.core.storage.ORawBuffer |
getRecordIfLocked(com.orientechnologies.orient.core.id.ORID rid) |
ODistributedSyncConfiguration |
getSyncConfiguration() |
void |
handleUnreachableNode(String nodeName) |
boolean |
lockRecord(com.orientechnologies.orient.core.id.ORID rid,
ODistributedRequestId iRequestId,
long timeout) |
ODistributedTxContext |
popTxContext(ODistributedRequestId requestId) |
protected void |
processRequest(int partitionKey,
ODistributedRequest request) |
void |
processRequest(ODistributedRequest request)
Distributed requests against the available workers by using one queue per worker.
|
ODistributedTxContext |
registerTxContext(ODistributedRequestId reqId) |
void |
resume() |
ODistributedResponse |
send2Nodes(ODistributedRequest iRequest,
Collection<String> iClusterNames,
Collection<String> iNodes,
ODistributedRequest.EXECUTION_MODE iExecutionMode,
Object localResult,
com.orientechnologies.common.util.OCallable<Void,ODistributedRequestId> iAfterSentCallback) |
void |
setLSN(String sourceNodeName,
com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OLogSequenceNumber taskLastLSN,
boolean updateLastOperationTimestamp) |
void |
setOnline() |
void |
shutdown() |
void |
suspend() |
void |
unlockRecord(com.orientechnologies.orient.core.db.record.OIdentifiable iRecord,
ODistributedRequestId requestId) |
void |
unlockResourcesOfServer(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal database,
String serverName) |
protected boolean |
waitForLocalNode(ODistributedConfiguration cfg,
Collection<String> iClusterNames,
Collection<String> iNodes) |
void |
waitForOnline() |
protected ODistributedResponse |
waitForResponse(ODistributedRequest iRequest,
ODistributedResponseManager currentResponseMgr) |
void |
waitIsReady(ORemoteTask task) |
public static final String DISTRIBUTED_SYNC_JSON_FILENAME
protected final ODistributedAbstractPlugin manager
protected final ODistributedMessageServiceImpl msgService
protected final String databaseName
protected ODistributedDatabaseRepairer repairer
protected ODistributedSyncConfiguration syncConfiguration
protected ConcurrentHashMap<com.orientechnologies.orient.core.id.ORID,ODistributedDatabaseImpl.ODistributedLock> lockManager
protected ConcurrentHashMap<ODistributedRequestId,ODistributedTxContext> activeTxContexts
protected final List<ODistributedWorker> workerThreads
public ODistributedDatabaseImpl(OHazelcastPlugin manager, ODistributedMessageServiceImpl msgService, String iDatabaseName, ODistributedConfiguration cfg)
public com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OLogSequenceNumber getLastLSN(String server)
public void waitForOnline()
waitForOnline in interface ODistributedDatabasepublic void processRequest(ODistributedRequest request)
processRequest in interface ODistributedDatabasepublic void waitIsReady(ORemoteTask task)
protected Set<Integer> getInvolvedQueuesByPartitionKeys(int[] partitionKeys)
protected void processRequest(int partitionKey,
ODistributedRequest request)
public ODistributedResponse send2Nodes(ODistributedRequest iRequest, Collection<String> iClusterNames, Collection<String> iNodes, ODistributedRequest.EXECUTION_MODE iExecutionMode, Object localResult, com.orientechnologies.common.util.OCallable<Void,ODistributedRequestId> iAfterSentCallback)
send2Nodes in interface ODistributedDatabasepublic void setOnline()
setOnline in interface ODistributedDatabasepublic com.orientechnologies.orient.core.storage.ORawBuffer getRecordIfLocked(com.orientechnologies.orient.core.id.ORID rid)
getRecordIfLocked in interface ODistributedDatabasepublic boolean lockRecord(com.orientechnologies.orient.core.id.ORID rid,
ODistributedRequestId iRequestId,
long timeout)
lockRecord in interface ODistributedDatabasepublic void unlockRecord(com.orientechnologies.orient.core.db.record.OIdentifiable iRecord,
ODistributedRequestId requestId)
unlockRecord in interface ODistributedDatabasepublic void unlockResourcesOfServer(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal database,
String serverName)
unlockResourcesOfServer in interface ODistributedDatabasepublic ODistributedTxContext registerTxContext(ODistributedRequestId reqId)
registerTxContext in interface ODistributedDatabasepublic ODistributedTxContext popTxContext(ODistributedRequestId requestId)
popTxContext in interface ODistributedDatabasepublic ODistributedServerManager getManager()
getManager in interface ODistributedDatabasepublic boolean exists()
public ODistributedSyncConfiguration getSyncConfiguration()
getSyncConfiguration in interface ODistributedDatabasepublic void filterBeforeThisMomentum(ODistributedMomentum momentum)
public void handleUnreachableNode(String nodeName)
handleUnreachableNode in interface ODistributedDatabasepublic String getDatabaseName()
getDatabaseName in interface ODistributedDatabasepublic com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx getDatabaseInstance()
getDatabaseInstance in interface ODistributedDatabasepublic long getReceivedRequests()
getReceivedRequests in interface ODistributedDatabasepublic long getProcessedRequests()
getProcessedRequests in interface ODistributedDatabasepublic void shutdown()
protected void checkForServerOnline(ODistributedRequest iRequest) throws ODistributedException
ODistributedExceptionprotected boolean waitForLocalNode(ODistributedConfiguration cfg, Collection<String> iClusterNames, Collection<String> iNodes)
protected int calculateQuorum(com.orientechnologies.orient.core.command.OCommandDistributedReplicateRequest.QUORUM_TYPE quorumType,
Collection<String> clusterNames,
ODistributedConfiguration cfg,
int allAvailableNodes,
int masterAvailableNodes,
boolean checkNodesAreOnline,
String localNodeName)
protected ODistributedResponse waitForResponse(ODistributedRequest iRequest, ODistributedResponseManager currentResponseMgr) throws InterruptedException
InterruptedExceptionprotected void checkLocalNodeInConfiguration(ODistributedConfiguration cfg)
protected String getLocalNodeName()
public void setLSN(String sourceNodeName, com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OLogSequenceNumber taskLastLSN, boolean updateLastOperationTimestamp) throws IOException
setLSN in interface ODistributedDatabaseIOExceptionpublic ODistributedDatabaseRepairer getDatabaseRepairer()
getDatabaseRepairer in interface ODistributedDatabasepublic void suspend()
public void resume()
public void dumpLocks()
dumpLocks in interface ODistributedDatabaseCopyright © 2009–2017 OrientDB. All rights reserved.