public class PartitionHandlingManagerImpl extends Object implements PartitionHandlingManager
Constructor and Description |
---|
PartitionHandlingManagerImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
addPartialCommit1PCTransaction(GlobalTransaction globalTransaction,
Collection<Address> affectedNodes,
Collection<Object> lockedKeys,
List<WriteCommand> modifications)
Adds a partially committed transaction.
|
boolean |
addPartialCommit2PCTransaction(GlobalTransaction globalTransaction,
Collection<Address> affectedNodes,
Collection<Object> lockedKeys,
EntryVersionsMap newVersions)
Adds a partially committed transaction.
|
boolean |
addPartialRollbackTransaction(GlobalTransaction globalTransaction,
Collection<Address> affectedNodes,
Collection<Object> lockedKeys)
Adds a partially aborted transaction.
|
boolean |
canRollbackTransactionAfterOriginatorLeave(GlobalTransaction globalTransaction)
It checks if the transaction can be aborted when the originator leaves the cluster.
|
void |
checkBulkRead() |
void |
checkClear() |
void |
checkRead(Object key) |
void |
checkWrite(Object key) |
AvailabilityMode |
getAvailabilityMode() |
CacheTopology |
getLastStableTopology() |
Collection<GlobalTransaction> |
getPartialTransactions() |
void |
init(DistributionManager distributionManager,
LocalTopologyManager localTopologyManager,
StateTransferManager stateTransferManager,
Cache cache,
CacheNotifier notifier,
CommandsFactory commandsFactory,
Configuration configuration,
RpcManager rpcManager,
LockManager lockManager) |
boolean |
isTransactionPartiallyCommitted(GlobalTransaction globalTransaction)
It checks if the transaction resources (for example locks) can be released.
|
void |
onTopologyUpdate(CacheTopology cacheTopology)
Notifies the
PartitionHandlingManager that the cache topology was update. |
void |
setAvailabilityMode(AvailabilityMode availabilityMode) |
void |
start() |
public void init(DistributionManager distributionManager, LocalTopologyManager localTopologyManager, StateTransferManager stateTransferManager, Cache cache, CacheNotifier notifier, CommandsFactory commandsFactory, Configuration configuration, RpcManager rpcManager, LockManager lockManager)
public void start()
public AvailabilityMode getAvailabilityMode()
getAvailabilityMode
in interface PartitionHandlingManager
public void setAvailabilityMode(AvailabilityMode availabilityMode)
setAvailabilityMode
in interface PartitionHandlingManager
public void checkWrite(Object key)
checkWrite
in interface PartitionHandlingManager
public void checkRead(Object key)
checkRead
in interface PartitionHandlingManager
public void checkClear()
checkClear
in interface PartitionHandlingManager
public void checkBulkRead()
checkBulkRead
in interface PartitionHandlingManager
public CacheTopology getLastStableTopology()
getLastStableTopology
in interface PartitionHandlingManager
public boolean addPartialRollbackTransaction(GlobalTransaction globalTransaction, Collection<Address> affectedNodes, Collection<Object> lockedKeys)
PartitionHandlingManager
addPartialRollbackTransaction
in interface PartitionHandlingManager
globalTransaction
- the global transaction.affectedNodes
- the nodes involved in the transaction and they must abort the transaction.lockedKeys
- the keys locally locked.true
if the PartitionHandlingManager
will handle it, false
otherwise.public boolean addPartialCommit2PCTransaction(GlobalTransaction globalTransaction, Collection<Address> affectedNodes, Collection<Object> lockedKeys, EntryVersionsMap newVersions)
PartitionHandlingManager
addPartialCommit2PCTransaction
in interface PartitionHandlingManager
globalTransaction
- the global transaction.affectedNodes
- the nodes involved in the transaction and they must commit it.lockedKeys
- the keys locally locked.newVersions
- the updated versions. Only used when versioning is enabled.true
if the PartitionHandlingManager
will handle it, false
otherwise.public boolean addPartialCommit1PCTransaction(GlobalTransaction globalTransaction, Collection<Address> affectedNodes, Collection<Object> lockedKeys, List<WriteCommand> modifications)
PartitionHandlingManager
addPartialCommit1PCTransaction
in interface PartitionHandlingManager
globalTransaction
- the global transaction.affectedNodes
- the nodes involved in the transaction and they must commit it.lockedKeys
- the keys locally locked.modifications
- the transaction's modification log.true
if the PartitionHandlingManager
will handle it, false
otherwise.public boolean isTransactionPartiallyCommitted(GlobalTransaction globalTransaction)
PartitionHandlingManager
isTransactionPartiallyCommitted
in interface PartitionHandlingManager
globalTransaction
- the transaction.true
if the resources can be released, false
otherwise.public Collection<GlobalTransaction> getPartialTransactions()
getPartialTransactions
in interface PartitionHandlingManager
public boolean canRollbackTransactionAfterOriginatorLeave(GlobalTransaction globalTransaction)
PartitionHandlingManager
canRollbackTransactionAfterOriginatorLeave
in interface PartitionHandlingManager
globalTransaction
- the global transaction.true
if the transaction can be aborted, false
otherwise.public void onTopologyUpdate(CacheTopology cacheTopology)
PartitionHandlingManager
PartitionHandlingManager
that the cache topology was update.
It detects when the partition is merged and tries to complete all the partially completed transactions.onTopologyUpdate
in interface PartitionHandlingManager
cacheTopology
- the new cache topology.Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.