public class AvailablePartitionHandlingManager extends Object implements PartitionHandlingManager
PartitionHandlingManager implementation when the cluster is always available.| 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,
Map<Object,IncrementableEntryVersion> 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,
long flagBitSet) |
void |
checkWrite(Object key) |
AvailabilityMode |
getAvailabilityMode() |
static AvailablePartitionHandlingManager |
getInstance() |
CacheTopology |
getLastStableTopology() |
Collection<GlobalTransaction> |
getPartialTransactions() |
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. |
CompletionStage<Void> |
setAvailabilityMode(AvailabilityMode availabilityMode) |
public static AvailablePartitionHandlingManager getInstance()
public AvailabilityMode getAvailabilityMode()
getAvailabilityMode in interface PartitionHandlingManagerpublic CompletionStage<Void> setAvailabilityMode(AvailabilityMode availabilityMode)
setAvailabilityMode in interface PartitionHandlingManagerpublic void checkWrite(Object key)
checkWrite in interface PartitionHandlingManagerpublic void checkRead(Object key, long flagBitSet)
checkRead in interface PartitionHandlingManagerpublic void checkClear()
checkClear in interface PartitionHandlingManagerpublic void checkBulkRead()
checkBulkRead in interface PartitionHandlingManagerpublic CacheTopology getLastStableTopology()
getLastStableTopology in interface PartitionHandlingManagerpublic boolean addPartialRollbackTransaction(GlobalTransaction globalTransaction, Collection<Address> affectedNodes, Collection<Object> lockedKeys)
PartitionHandlingManageraddPartialRollbackTransaction in interface PartitionHandlingManagerglobalTransaction - 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, Map<Object,IncrementableEntryVersion> newVersions)
PartitionHandlingManageraddPartialCommit2PCTransaction in interface PartitionHandlingManagerglobalTransaction - 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)
PartitionHandlingManageraddPartialCommit1PCTransaction in interface PartitionHandlingManagerglobalTransaction - 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)
PartitionHandlingManagerisTransactionPartiallyCommitted in interface PartitionHandlingManagerglobalTransaction - the transaction.true if the resources can be released, false otherwise.public Collection<GlobalTransaction> getPartialTransactions()
getPartialTransactions in interface PartitionHandlingManagerpublic boolean canRollbackTransactionAfterOriginatorLeave(GlobalTransaction globalTransaction)
PartitionHandlingManagercanRollbackTransactionAfterOriginatorLeave in interface PartitionHandlingManagerglobalTransaction - the global transaction.true if the transaction can be aborted, false otherwise.public void onTopologyUpdate(CacheTopology cacheTopology)
PartitionHandlingManagerPartitionHandlingManager 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 PartitionHandlingManagercacheTopology - the new cache topology.Copyright © 2021 JBoss by Red Hat. All rights reserved.