
public class ODistributedDatabaseImpl extends Object implements ODistributedDatabase
| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentHashMap<ODistributedRequestId,ODistributedTxContextImpl> |
activeTxContexts |
protected String |
databaseName |
static String |
DISTRIBUTED_SYNC_JSON_FILENAME |
protected ConcurrentHashMap<ORID,ODistributedRequestId> |
lockManager |
protected ODistributedAbstractPlugin |
manager |
protected ODistributedMessageServiceImpl |
msgService |
protected ReadWriteLock |
processLock |
protected Lock |
requestLock |
protected AtomicBoolean |
status |
protected ODistributedSyncConfiguration |
syncConfiguration |
protected List<ODistributedWorker> |
workerThreads |
| Constructor and Description |
|---|
ODistributedDatabaseImpl(OHazelcastPlugin manager,
ODistributedMessageServiceImpl msgService,
String iDatabaseName) |
public static final String DISTRIBUTED_SYNC_JSON_FILENAME
protected final ODistributedAbstractPlugin manager
protected final ODistributedMessageServiceImpl msgService
protected final String databaseName
protected final Lock requestLock
protected ODistributedSyncConfiguration syncConfiguration
protected ConcurrentHashMap<ORID,ODistributedRequestId> lockManager
protected ConcurrentHashMap<ODistributedRequestId,ODistributedTxContextImpl> activeTxContexts
protected final List<ODistributedWorker> workerThreads
protected volatile ReadWriteLock processLock
protected AtomicBoolean status
public ODistributedDatabaseImpl(OHazelcastPlugin manager, ODistributedMessageServiceImpl msgService, String iDatabaseName)
public void processRequest(ODistributedRequest request)
processRequest in interface ODistributedDatabasepublic int checkQuorumBeforeReplicate(OCommandDistributedReplicateRequest.QUORUM_TYPE quorumType, Collection<String> iClusterNames, Collection<String> iNodes, ODistributedConfiguration cfg)
checkQuorumBeforeReplicate in interface ODistributedDatabasepublic ODistributedResponse send2Nodes(ODistributedRequest iRequest, Collection<String> iClusterNames, Collection<String> iNodes, ODistributedRequest.EXECUTION_MODE iExecutionMode, Object localResult, OCallable<Void,ODistributedRequestId> iAfterSentCallback)
send2Nodes in interface ODistributedDatabasepublic void setOnline()
setOnline in interface ODistributedDatabasepublic ODistributedRequestId lockRecord(OIdentifiable iRecord, ODistributedRequestId iRequestId)
ODistributedDatabaselockRecord in interface ODistributedDatabaseiRecord - Record to lockiRequestId - Request idODistributedDatabase.unlockRecord(OIdentifiable, ODistributedRequestId)public void unlockRecord(OIdentifiable iRecord, ODistributedRequestId requestId)
ODistributedDatabaseunlockRecord in interface ODistributedDatabaseODistributedDatabase.lockRecord(OIdentifiable, ODistributedRequestId)public 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 handleUnreachableNode(int iNodeId)
ODistributedDatabasehandleUnreachableNode in interface ODistributedDatabaseiNodeId - node idpublic String getDatabaseName()
getDatabaseName in interface ODistributedDatabasepublic ODatabaseDocumentTx getDatabaseInstance()
getDatabaseInstance 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(OCommandDistributedReplicateRequest.QUORUM_TYPE quorumType, Collection<String> clusterNames, ODistributedConfiguration cfg, int allAvailableNodes, int masterAvailableNodes, boolean checkNodesAreOnline)
protected ODistributedResponse waitForResponse(ODistributedRequest iRequest, ODistributedResponseManager currentResponseMgr) throws InterruptedException
InterruptedExceptionprotected void checkLocalNodeInConfiguration()
protected String getLocalNodeName()
Copyright © 2009–2016 Orient Technologies. All rights reserved.