public class RecoveryManagerImpl extends Object implements RecoveryManager
RecoveryManager
RecoveryManager.RecoveryIterator
Constructor and Description |
---|
RecoveryManagerImpl(ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> recoveryHolder,
String cacheName) |
Modifier and Type | Method and Description |
---|---|
CompletionStage<String> |
forceTransactionCompletion(XidImpl xid,
boolean commit)
Replays the given transaction by re-running the prepare and commit.
|
String |
forceTransactionCompletionFromCluster(XidImpl xid,
Address where,
boolean commit)
This method invokes
RecoveryManager.forceTransactionCompletion(XidImpl, boolean) on the specified node. |
Set<InDoubtTxInfo> |
getInDoubtTransactionInfo()
Same as
RecoveryManager.getInDoubtTransactionInfoFromCluster() , but only returns transactions from the local node. |
Set<InDoubtTxInfo> |
getInDoubtTransactionInfoFromCluster()
Returns a
Set containing all the in-doubt transactions from the cluster, including the local node. |
List<XidImpl> |
getInDoubtTransactions()
Local call that returns a list containing:
|
ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> |
getInDoubtTransactionsMap() |
RecoveryAwareRemoteTransaction |
getPreparedTransaction(XidImpl 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,
ComponentRef<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) |
CompletionStage<Void> |
removeRecoveryInformation(Collection<Address> lockOwners,
XidImpl xid,
GlobalTransaction gtx,
boolean fromCluster)
Removes from the specified nodes (or all nodes if the value of 'where' is null) the recovery information
associated with these Xids.
|
RecoveryAwareTransaction |
removeRecoveryInformation(Long internalId)
Same as
RecoveryManager.removeRecoveryInformation(XidImpl) but identifies the tx by its internal id. |
RecoveryAwareTransaction |
removeRecoveryInformation(XidImpl xid)
Remove recovery information stored on this node (doesn't involve rpc).
|
CompletionStage<Void> |
removeRecoveryInformationFromCluster(Collection<Address> where,
long internalId)
Same as
RecoveryManager.removeRecoveryInformation(Collection, XidImpl, GlobalTransaction, boolean)
but the transaction is identified by its internal id, and not by its xid. |
public RecoveryManagerImpl(ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> recoveryHolder, String cacheName)
public void init(RpcManager rpcManager, CommandsFactory commandsFactory, ComponentRef<TransactionTable> txTable, TransactionCoordinator txCoordinator, TransactionFactory txFactory)
public RecoveryManager.RecoveryIterator getPreparedTransactionsFromCluster()
RecoveryManager
getPreparedTransactionsFromCluster
in interface RecoveryManager
public CompletionStage<Void> removeRecoveryInformation(Collection<Address> lockOwners, XidImpl xid, GlobalTransaction gtx, boolean fromCluster)
RecoveryManager
removeRecoveryInformation
in interface RecoveryManager
lockOwners
- on which nodes should this be executed.xid
- the list of xids to be removed.gtx
- the global transactionfromCluster
- true
to remove the recovery information from all cluster.public CompletionStage<Void> removeRecoveryInformationFromCluster(Collection<Address> where, long internalId)
RecoveryManager
RecoveryManager.removeRecoveryInformation(Collection, XidImpl, GlobalTransaction, boolean)
but the transaction is identified by its internal id, and not by its xid.removeRecoveryInformationFromCluster
in interface RecoveryManager
public RecoveryAwareTransaction removeRecoveryInformation(XidImpl xid)
RecoveryManager
removeRecoveryInformation
in interface RecoveryManager
RecoveryManager.removeRecoveryInformation(Collection, XidImpl, GlobalTransaction, boolean)
public RecoveryAwareTransaction removeRecoveryInformation(Long internalId)
RecoveryManager
RecoveryManager.removeRecoveryInformation(XidImpl)
but identifies the tx by its internal id.removeRecoveryInformation
in interface RecoveryManager
public List<XidImpl> 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 RecoveryManager
RecoveryAwareRemoteTransaction.isInDoubt()
public Set<InDoubtTxInfo> getInDoubtTransactionInfo()
RecoveryManager
RecoveryManager.getInDoubtTransactionInfoFromCluster()
, but only returns transactions from the local node.getInDoubtTransactionInfo
in interface RecoveryManager
public Set<InDoubtTxInfo> getInDoubtTransactionInfoFromCluster()
RecoveryManager
Set
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 RecoveryManager
InDoubtTxInfo
public void registerInDoubtTransaction(RecoveryAwareRemoteTransaction remoteTransaction)
registerInDoubtTransaction
in interface RecoveryManager
public RecoveryAwareRemoteTransaction getPreparedTransaction(XidImpl xid)
RecoveryManager
getPreparedTransaction
in interface RecoveryManager
public CompletionStage<String> forceTransactionCompletion(XidImpl xid, boolean commit)
RecoveryManager
forceTransactionCompletion
in interface RecoveryManager
xid
- tx to commit or rollbackcommit
- if true tx is committed, if false it is rolled backpublic String forceTransactionCompletionFromCluster(XidImpl xid, Address where, boolean commit)
RecoveryManager
RecoveryManager.forceTransactionCompletion(XidImpl, boolean)
on the specified node.forceTransactionCompletionFromCluster
in interface RecoveryManager
public boolean isTransactionPrepared(GlobalTransaction globalTx)
RecoveryManager
isTransactionPrepared
in interface RecoveryManager
public ConcurrentMap<RecoveryInfoKey,RecoveryAwareRemoteTransaction> getInDoubtTransactionsMap()
Copyright © 2021 JBoss by Red Hat. All rights reserved.