
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<ORID,ODistributedDatabaseImpl.ODistributedLock> |
lockManager |
protected ODistributedWorker |
lockThread |
protected ODistributedAbstractPlugin |
manager |
protected ODistributedMessageServiceImpl |
msgService |
protected ODistributedWorker |
nowaitThread |
protected ODistributedDatabaseRepairer |
repairer |
protected ODistributedSyncConfiguration |
syncConfiguration |
protected List<ODistributedWorker> |
workerThreads |
| Constructor and Description |
|---|
ODistributedDatabaseImpl(OHazelcastPlugin manager,
ODistributedMessageServiceImpl msgService,
String iDatabaseName,
ODistributedConfiguration cfg) |
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<ORID,ODistributedDatabaseImpl.ODistributedLock> lockManager
protected ConcurrentHashMap<ODistributedRequestId,ODistributedTxContext> activeTxContexts
protected final List<ODistributedWorker> workerThreads
protected ODistributedWorker lockThread
protected ODistributedWorker nowaitThread
public ODistributedDatabaseImpl(OHazelcastPlugin manager, ODistributedMessageServiceImpl msgService, String iDatabaseName, ODistributedConfiguration cfg)
public OLogSequenceNumber getLastLSN(String server)
public void waitForOnline()
waitForOnline in interface ODistributedDatabasepublic void processRequest(ODistributedRequest request)
processRequest in interface ODistributedDatabasepublic boolean waitIsReady(OCallable<Boolean,Void> retryCallback)
waitIsReady in interface ODistributedDatabaseprotected 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, OCallable<Void,ODistributedRequestId> iAfterSentCallback, OCallable<Void,ODistributedResponseManager> endCallback)
send2Nodes in interface ODistributedDatabasepublic void setOnline()
setOnline in interface ODistributedDatabasepublic ORawBuffer getRecordIfLocked(ORID rid)
ODistributedDatabasegetRecordIfLocked in interface ODistributedDatabaserid - record to load.public void replaceRecordContentIfLocked(ORID rid, byte[] bytes)
ODistributedDatabasereplaceRecordContentIfLocked in interface ODistributedDatabaserid - Record ID of the record to findbytes - Content as byte[] of the record to replacepublic boolean lockRecord(ORID rid, ODistributedRequestId requestId, long timeout)
ODistributedDatabaselockRecord in interface ODistributedDatabaserid - Record to lockrequestId - Request idtimeout - Timeout in ms to wait for the lockODistributedDatabase.unlockRecord(OIdentifiable, ODistributedRequestId)public void unlockRecord(OIdentifiable iRecord, ODistributedRequestId requestId)
ODistributedDatabaseunlockRecord in interface ODistributedDatabaseiRecord - Record to unlockrequestId - Request idODistributedDatabase.lockRecord(ORID, ODistributedRequestId, long)public boolean forceLockRecord(ORID rid, ODistributedRequestId requestId)
ODistributedDatabaseforceLockRecord in interface ODistributedDatabaserid - Record to lockrequestId - Request idpublic void unlockResourcesOfServer(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)
ODistributedDatabasehandleUnreachableNode in interface ODistributedDatabasenodeName - node idpublic String getDatabaseName()
getDatabaseName in interface ODistributedDatabasepublic 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(OCommandDistributedReplicateRequest.QUORUM_TYPE quorumType, Collection<String> clusterNames, ODistributedConfiguration cfg, int totalServers, int totalMasterServers, boolean checkNodesAreOnline, String localNodeName)
protected ODistributedResponse waitForResponse(ODistributedRequest iRequest, ODistributedResponseManager currentResponseMgr) throws InterruptedException
InterruptedExceptionpublic void checkNodeInConfiguration(ODistributedConfiguration cfg, String serverName)
checkNodeInConfiguration in interface ODistributedDatabaseprotected String getLocalNodeName()
public void setLSN(String sourceNodeName, OLogSequenceNumber taskLastLSN, boolean updateLastOperationTimestamp) throws IOException
setLSN in interface ODistributedDatabaseIOExceptionpublic ODistributedDatabaseRepairer getDatabaseRepairer()
getDatabaseRepairer in interface ODistributedDatabasepublic void suspend()
public void resume()
public String dump()
dump in interface ODistributedDatabaseCopyright © 2009–2025 OrientDB. All rights reserved.