public class RecoveryManagerImpl extends Object implements RecoveryManager
RecoveryManagerRecoveryManager.InDoubtTxInfo, RecoveryManager.RecoveryIterator| Constructor and Description |
|---|
RecoveryManagerImpl(ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> recoveryHolder,
String cacheName) |
| Modifier and Type | Method and Description |
|---|---|
String |
forceTransactionCompletion(Xid xid,
boolean commit)
Replays the given transaction by re-running the prepare and commit.
|
String |
forceTransactionCompletionFromCluster(Xid xid,
Address where,
boolean commit)
This method invokes
RecoveryManager.forceTransactionCompletion(javax.transaction.xa.Xid, boolean) on the specified node. |
Set<RecoveryManager.InDoubtTxInfo> |
getInDoubtTransactionInfo()
Same as
RecoveryManager.getInDoubtTransactionInfoFromCluster(), but only returns transactions from the local node. |
Set<RecoveryManager.InDoubtTxInfo> |
getInDoubtTransactionInfoFromCluster()
Returns a
Set containing all the in-doubt transactions from the cluster, including the local node. |
List<Xid> |
getInDoubtTransactions()
Local call that returns a list containing:
|
ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> |
getInDoubtTransactionsMap() |
RecoveryAwareRemoteTransaction |
getPreparedTransaction(Xid xid)
Local call returning the remote transaction identified by the supplied xid or null.
|
RecoveryManager.RecoveryIterator |
getPreparedTransactionsFromCluster()
Returns the list of transactions in prepared state from both local and remote cluster nodes.
|
void |
init(RpcManager rpcManager,
CommandsFactory commandsFactory,
TransactionTable txTable,
TransactionCoordinator txCoordinator,
TransactionFactory txFactory) |
boolean |
isTransactionPrepared(GlobalTransaction globalTx)
Checks both internal state and transaction table's state for the given tx.
|
void |
registerInDoubtTransaction(RecoveryAwareRemoteTransaction remoteTransaction) |
RecoveryAwareTransaction |
removeRecoveryInformation(Long internalId)
Same as
RecoveryManager.removeRecoveryInformation(javax.transaction.xa.Xid) but identifies the tx by its internal id. |
RecoveryAwareTransaction |
removeRecoveryInformation(Xid xid)
Remove recovery information stored on this node (doesn't involve rpc).
|
void |
removeRecoveryInformationFromCluster(Collection<Address> where,
long internalId,
boolean sync)
Same as
#removeRecoveryInformationFromCluster(java.util.Collection but the transaction
is identified by its internal id, and not by its xid. |
void |
removeRecoveryInformationFromCluster(Collection<Address> lockOwners,
Xid xid,
boolean sync,
GlobalTransaction gtx)
Removes from the specified nodes (or all nodes if the value of 'where' is null) the recovery information associated with
these Xids.
|
public RecoveryManagerImpl(ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> recoveryHolder, String cacheName)
public void init(RpcManager rpcManager, CommandsFactory commandsFactory, TransactionTable txTable, TransactionCoordinator txCoordinator, TransactionFactory txFactory)
public RecoveryManager.RecoveryIterator getPreparedTransactionsFromCluster()
RecoveryManager- in order to get all tx from the cluster a broadcast is performed. This can be performed only once (assuming the call is successful), the first time this method is called. After that a local, cached list of tx prepared on this node is returned. - during the broadcast just return the list of prepared transactions that are not originated on other active nodes of the cluster.
getPreparedTransactionsFromCluster in interface RecoveryManagerpublic void removeRecoveryInformationFromCluster(Collection<Address> lockOwners, Xid xid, boolean sync, GlobalTransaction gtx)
RecoveryManagerremoveRecoveryInformationFromCluster in interface RecoveryManagerlockOwners - on which nodes should this be executed.xid - the list of xids to be removed.sync - execute sync or async (false)public void removeRecoveryInformationFromCluster(Collection<Address> where, long internalId, boolean sync)
RecoveryManager#removeRecoveryInformationFromCluster(java.util.Collection but the transaction
is identified by its internal id, and not by its xid.removeRecoveryInformationFromCluster in interface RecoveryManagerpublic RecoveryAwareTransaction removeRecoveryInformation(Xid xid)
RecoveryManagerremoveRecoveryInformation in interface RecoveryManagerpublic RecoveryAwareTransaction removeRecoveryInformation(Long internalId)
RecoveryManagerRecoveryManager.removeRecoveryInformation(javax.transaction.xa.Xid) but identifies the tx by its internal id.removeRecoveryInformation in interface RecoveryManagerpublic List<Xid> getInDoubtTransactions()
RecoveryManager- all the remote transactions prepared on this node for which the originator(i.e. the node where the tx stared) is no longer part of the cluster. AND - all the locally originated transactions which are prepared and for which the commit failed
getInDoubtTransactions in interface RecoveryManagerRecoveryAwareRemoteTransaction.isInDoubt()public Set<RecoveryManager.InDoubtTxInfo> getInDoubtTransactionInfo()
RecoveryManagerRecoveryManager.getInDoubtTransactionInfoFromCluster(), but only returns transactions from the local node.getInDoubtTransactionInfo in interface RecoveryManagerpublic Set<RecoveryManager.InDoubtTxInfo> getInDoubtTransactionInfoFromCluster()
RecoveryManagerSet containing all the in-doubt transactions from the cluster, including the local node. This does
not include transactions that are prepared successfully and for which the originator is still in the cluster.getInDoubtTransactionInfoFromCluster in interface RecoveryManagerRecoveryManager.InDoubtTxInfopublic void registerInDoubtTransaction(RecoveryAwareRemoteTransaction remoteTransaction)
public RecoveryAwareRemoteTransaction getPreparedTransaction(Xid xid)
RecoveryManagergetPreparedTransaction in interface RecoveryManagerpublic String forceTransactionCompletion(Xid xid, boolean commit)
RecoveryManagerforceTransactionCompletion in interface RecoveryManagerxid - tx to commit or rollbackcommit - if true tx is committed, if false it is rolled backpublic String forceTransactionCompletionFromCluster(Xid xid, Address where, boolean commit)
RecoveryManagerRecoveryManager.forceTransactionCompletion(javax.transaction.xa.Xid, boolean) on the specified node.forceTransactionCompletionFromCluster in interface RecoveryManagerpublic boolean isTransactionPrepared(GlobalTransaction globalTx)
RecoveryManagerisTransactionPrepared in interface RecoveryManagerpublic ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> getInDoubtTransactionsMap()
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.