public class PartitionHandlingManagerImpl extends Object implements PartitionHandlingManager
| Modifier and Type | Field and Description |
|---|---|
protected DistributionManager |
distributionManager |
| 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,
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) |
protected void |
doCheck(Object key,
boolean isWrite,
long flagBitSet) |
AvailabilityMode |
getAvailabilityMode() |
CacheTopology |
getLastStableTopology() |
Collection<GlobalTransaction> |
getPartialTransactions() |
protected PartitionHandling |
getPartitionHandling() |
protected boolean |
isBulkOperationAllowed(boolean isWrite) |
protected boolean |
isKeyOperationAllowed(boolean isWrite,
long flagBitSet,
LocalizedCacheTopology cacheTopology,
Object key)
Check if a read/write operation is allowed with the actual members
|
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) |
void |
start() |
protected DistributionManager distributionManager
public void start()
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.protected void doCheck(Object key, boolean isWrite, long flagBitSet)
protected boolean isKeyOperationAllowed(boolean isWrite,
long flagBitSet,
LocalizedCacheTopology cacheTopology,
Object key)
isWrite - false for reads, true for writesflagBitSet - reads with the Flag.FORCE_WRITE_LOCK are treated as writescacheTopology - actual members, or null for bulk operationskey - key owners, or null for bulk operationsprotected boolean isBulkOperationAllowed(boolean isWrite)
protected PartitionHandling getPartitionHandling()
Copyright © 2021 JBoss by Red Hat. All rights reserved.