public class RecoveryAwareRemoteTransaction extends RemoteTransaction implements RecoveryAwareTransaction
RemoteTransaction
and adds recovery related information and functionality.affectedKeys, backupKeyLocks, hasLocalOnlyModifications, keyEquivalence, lockedKeys, lookedUpEntries, modifications, topologyId, tx
Constructor and Description |
---|
RecoveryAwareRemoteTransaction(GlobalTransaction tx,
int topologyId,
Equivalence<Object> keyEquivalence) |
RecoveryAwareRemoteTransaction(WriteCommand[] modifications,
GlobalTransaction tx,
int topologyId,
Equivalence<Object> keyEquivalence) |
Modifier and Type | Method and Description |
---|---|
void |
computeOrphan(Collection<Address> currentMembers)
Check's if this transaction's originator is no longer part of the cluster (orphan transaction) and updates
isOrphan() . |
Integer |
getStatus()
Following values might be returned:
-
Status.STATUS_PREPARED if the tx is prepared
- Status.STATUS_COMMITTED if the tx is committed
- Status.STATUS_ROLLEDBACK if the tx is rollback
- null otherwise
|
boolean |
isInDoubt()
A transaction is in doubt if it is prepared and and it is orphan.
|
boolean |
isOrphan()
A remote transaction is orphan if the node on which the transaction originated (ie the originator) is no longer
part of the cluster.
|
boolean |
isPrepared() |
void |
markCompleted(boolean committed)
Called when after the 2nd phase of a 2PC is successful.
|
void |
setPrepared(boolean prepared) |
String |
toString() |
clone, equals, getTransactionState, hashCode, lookedUpEntriesTopology, putLookedUpEntries, putLookedUpEntry, setLookedUpEntriesTopology, skipTransactionCompleteCheck, skipTransactionCompleteCheck
addAffectedKey, addAllAffectedKeys, addBackupLockForKey, addReadKey, addVersionRead, clearLockedKeys, clearLookedUpEntries, getAffectedKeys, getAllModifications, getBackupLockedKeys, getGlobalTransaction, getLockedKeys, getLookedUpEntries, getLookedUpRemoteVersion, getModifications, getTopologyId, getUpdatedEntryVersions, getVersionsRead, hasModification, isMarkedForRollback, keyRead, lookupEntry, markForRollback, notifyOnTransactionFinished, ownsLock, putLookedUpRemoteVersion, registerLockedKey, removeLookedUpEntry, replaceVersionRead, setModifications, setUpdatedEntryVersions, waitForLockRelease
finalize, getClass, notify, notifyAll, wait, wait, wait
addBackupLockForKey, addReadKey, addVersionRead, clearLockedKeys, clearLookedUpEntries, getAllModifications, getBackupLockedKeys, getGlobalTransaction, getLockedKeys, getLookedUpEntries, getLookedUpRemoteVersion, getModifications, getTopologyId, getUpdatedEntryVersions, getVersionsRead, hasModification, isMarkedForRollback, keyRead, lookupEntry, markForRollback, notifyOnTransactionFinished, ownsLock, putLookedUpEntries, putLookedUpEntry, putLookedUpRemoteVersion, removeLookedUpEntry, replaceVersionRead, setUpdatedEntryVersions, waitForLockRelease
public RecoveryAwareRemoteTransaction(WriteCommand[] modifications, GlobalTransaction tx, int topologyId, Equivalence<Object> keyEquivalence)
public RecoveryAwareRemoteTransaction(GlobalTransaction tx, int topologyId, Equivalence<Object> keyEquivalence)
public boolean isInDoubt()
public boolean isOrphan()
public void computeOrphan(Collection<Address> currentMembers)
isOrphan()
.currentMembers
- The current members of the cache.public boolean isPrepared()
isPrepared
in interface RecoveryAwareTransaction
public void setPrepared(boolean prepared)
setPrepared
in interface RecoveryAwareTransaction
public String toString()
toString
in class RemoteTransaction
public void markCompleted(boolean committed)
committed
- true if tx successfully committed, false if tx successfully rolled back.public Integer getStatus()
Status.STATUS_PREPARED
if the tx is prepared Status.STATUS_COMMITTED
if the tx is committedStatus.STATUS_ROLLEDBACK
if the tx is rollbackCopyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.