public class RecoveryAwareRemoteTransaction extends RemoteTransaction implements RecoveryAwareTransaction
RemoteTransaction
and adds recovery related information and functionality.affectedKeys, backupKeyLocks, lockedKeys, lookedUpEntries, modifications, tx
Constructor and Description |
---|
RecoveryAwareRemoteTransaction(GlobalTransaction tx,
int viewId) |
RecoveryAwareRemoteTransaction(WriteCommand[] modifications,
GlobalTransaction tx,
int viewId) |
Modifier and Type | Method and Description |
---|---|
void |
computeOrphan(Collection<Address> leavers)
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, hashCode, invalidate, isMissingModifications, putLookedUpEntries, putLookedUpEntry, setMissingModifications
addAffectedKey, addAllAffectedKeys, addBackupLockForKey, addReadKey, clearLockedKeys, clearLookedUpEntries, getAffectedKeys, getGlobalTransaction, getLockedKeys, getLookedUpEntries, getModifications, getUpdatedEntryVersions, getViewId, keyRead, lookupEntry, notifyOnTransactionFinished, ownsLock, registerLockedKey, removeLookedUpEntry, setModifications, setUpdatedEntryVersions, waitForLockRelease
finalize, getClass, notify, notifyAll, wait, wait, wait
addBackupLockForKey, addReadKey, clearLockedKeys, clearLookedUpEntries, getGlobalTransaction, getLockedKeys, getLookedUpEntries, getModifications, getUpdatedEntryVersions, getViewId, keyRead, lookupEntry, notifyOnTransactionFinished, ownsLock, putLookedUpEntries, putLookedUpEntry, removeLookedUpEntry, setUpdatedEntryVersions, waitForLockRelease
public RecoveryAwareRemoteTransaction(WriteCommand[] modifications, GlobalTransaction tx, int viewId)
public RecoveryAwareRemoteTransaction(GlobalTransaction tx, int viewId)
public boolean isInDoubt()
public boolean isOrphan()
public void computeOrphan(Collection<Address> leavers)
isOrphan()
.leavers
- the nodes that left the clusterpublic 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 © 2012 JBoss by Red Hat. All Rights Reserved.