Interface RecoveryManager
-
- All Known Implementing Classes:
RecoveryManagerImpl
public interface RecoveryManagerRecoveryManager is the component responsible with managing recovery related information and the functionality associated with it. Refer to this document for details on the design of recovery.- Since:
- 5.0
- Author:
- Mircea.Markus@jboss.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceRecoveryManager.RecoveryIteratorStateful structure allowing prepared-tx retrieval in a batch-oriented manner, as required byXAResource.recover(int).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CompletionStage<String>forceTransactionCompletion(org.infinispan.commons.tx.XidImpl xid, boolean commit)Replays the given transaction by re-running the prepare and commit.StringforceTransactionCompletionFromCluster(org.infinispan.commons.tx.XidImpl xid, Address where, boolean commit)This method invokesforceTransactionCompletion(XidImpl, boolean)on the specified node.Set<InDoubtTxInfo>getInDoubtTransactionInfo()Same asgetInDoubtTransactionInfoFromCluster(), but only returns transactions from the local node.Set<InDoubtTxInfo>getInDoubtTransactionInfoFromCluster()Returns aSetcontaining all the in-doubt transactions from the cluster, including the local node.List<org.infinispan.commons.tx.XidImpl>getInDoubtTransactions()Local call that returns a list containing:RecoveryAwareTransactiongetPreparedTransaction(org.infinispan.commons.tx.XidImpl xid)Local call returning the remote transaction identified by the supplied xid or null.RecoveryManager.RecoveryIteratorgetPreparedTransactionsFromCluster()Returns the list of transactions in prepared state from both local and remote cluster nodes.booleanisTransactionPrepared(GlobalTransaction globalTx)Checks both internal state and transaction table's state for the given tx.voidregisterInDoubtTransaction(RecoveryAwareRemoteTransaction tx)RecoveryAwareTransactionremoveRecoveryInformation(Long internalId)Same asremoveRecoveryInformation(XidImpl)but identifies the tx by its internal id.CompletionStage<Void>removeRecoveryInformation(Collection<Address> where, org.infinispan.commons.tx.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.RecoveryAwareTransactionremoveRecoveryInformation(org.infinispan.commons.tx.XidImpl xid)Remove recovery information stored on this node (doesn't involve rpc).CompletionStage<Void>removeRecoveryInformationFromCluster(Collection<Address> where, long internalId)Same asremoveRecoveryInformation(Collection, XidImpl, GlobalTransaction, boolean)but the transaction is identified by its internal id, and not by its xid.
-
-
-
Method Detail
-
getPreparedTransactionsFromCluster
RecoveryManager.RecoveryIterator getPreparedTransactionsFromCluster()
Returns the list of transactions in prepared state from both local and remote cluster nodes. Implementation can take advantage of several optimisations:- 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.
-
getInDoubtTransactionInfoFromCluster
Set<InDoubtTxInfo> getInDoubtTransactionInfoFromCluster()
Returns aSetcontaining 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.- See Also:
InDoubtTxInfo
-
getInDoubtTransactionInfo
Set<InDoubtTxInfo> getInDoubtTransactionInfo()
Same asgetInDoubtTransactionInfoFromCluster(), but only returns transactions from the local node.
-
removeRecoveryInformation
CompletionStage<Void> removeRecoveryInformation(Collection<Address> where, org.infinispan.commons.tx.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.- Parameters:
where- on which nodes should this be executed.xid- the list of xids to be removed.gtx- the global transactionfromCluster-trueto remove the recovery information from all cluster.
-
removeRecoveryInformationFromCluster
CompletionStage<Void> removeRecoveryInformationFromCluster(Collection<Address> where, long internalId)
Same asremoveRecoveryInformation(Collection, XidImpl, GlobalTransaction, boolean)but the transaction is identified by its internal id, and not by its xid.
-
getInDoubtTransactions
List<org.infinispan.commons.tx.XidImpl> getInDoubtTransactions()
Local call that returns a list containing:- 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
-
getPreparedTransaction
RecoveryAwareTransaction getPreparedTransaction(org.infinispan.commons.tx.XidImpl xid)
Local call returning the remote transaction identified by the supplied xid or null.
-
forceTransactionCompletion
CompletionStage<String> forceTransactionCompletion(org.infinispan.commons.tx.XidImpl xid, boolean commit)
Replays the given transaction by re-running the prepare and commit. This call expects the transaction to exist on this node either as a local or remote transaction.- Parameters:
xid- tx to commit or rollbackcommit- if true tx is committed, if false it is rolled back
-
forceTransactionCompletionFromCluster
String forceTransactionCompletionFromCluster(org.infinispan.commons.tx.XidImpl xid, Address where, boolean commit)
This method invokesforceTransactionCompletion(XidImpl, boolean)on the specified node.
-
isTransactionPrepared
boolean isTransactionPrepared(GlobalTransaction globalTx)
Checks both internal state and transaction table's state for the given tx. If it finds it, returns true if tx is prepared.
-
removeRecoveryInformation
RecoveryAwareTransaction removeRecoveryInformation(Long internalId)
Same asremoveRecoveryInformation(XidImpl)but identifies the tx by its internal id.
-
removeRecoveryInformation
RecoveryAwareTransaction removeRecoveryInformation(org.infinispan.commons.tx.XidImpl xid)
Remove recovery information stored on this node (doesn't involve rpc).
-
registerInDoubtTransaction
void registerInDoubtTransaction(RecoveryAwareRemoteTransaction tx)
-
-