Interface PartitionHandlingManager

All Known Implementing Classes:
AvailablePartitionHandlingManager, PartitionHandlingManagerImpl, ScatteredPartitionHandlingManagerImpl

public interface PartitionHandlingManager
Since:
7.0
Author:
Dan Berindei
  • Method Details

    • getAvailabilityMode

      AvailabilityMode getAvailabilityMode()
    • setAvailabilityMode

      CompletionStage<Void> setAvailabilityMode(AvailabilityMode availabilityMode)
    • checkWrite

      void checkWrite(Object key)
    • checkRead

      void checkRead(Object key, long flagBitSet)
    • checkClear

      void checkClear()
    • checkBulkRead

      void checkBulkRead()
    • getLastStableTopology

      @Deprecated CacheTopology getLastStableTopology()
      Deprecated.
    • addPartialRollbackTransaction

      boolean addPartialRollbackTransaction(GlobalTransaction globalTransaction, Collection<Address> affectedNodes, Collection<Object> lockedKeys)
      Adds a partially aborted transaction.

      The transaction should be registered when it is not sure if the abort happens successfully in all the affected nodes.

      Parameters:
      globalTransaction - the global transaction.
      affectedNodes - the nodes involved in the transaction and they must abort the transaction.
      lockedKeys - the keys locally locked.
      Returns:
      true if the PartitionHandlingManager will handle it, false otherwise.
    • addPartialCommit2PCTransaction

      boolean addPartialCommit2PCTransaction(GlobalTransaction globalTransaction, Collection<Address> affectedNodes, Collection<Object> lockedKeys, Map<Object,IncrementableEntryVersion> newVersions)
      Adds a partially committed transaction.

      The transaction is committed in the second phase and it is register if it is not sure that the transaction was committed successfully in all the affected nodes.

      Parameters:
      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.
      Returns:
      true if the PartitionHandlingManager will handle it, false otherwise.
    • addPartialCommit1PCTransaction

      boolean addPartialCommit1PCTransaction(GlobalTransaction globalTransaction, Collection<Address> affectedNodes, Collection<Object> lockedKeys, List<org.infinispan.commands.write.WriteCommand> modifications)
      Adds a partially committed transaction.

      The transaction is committed in one phase and it is register if it is not sure that the transaction was committed successfully in all the affected nodes.

      Parameters:
      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.
      Returns:
      true if the PartitionHandlingManager will handle it, false otherwise.
    • isTransactionPartiallyCommitted

      boolean isTransactionPartiallyCommitted(GlobalTransaction globalTransaction)
      It checks if the transaction resources (for example locks) can be released.

      The transaction resource can't be released when the transaction is partially committed.

      Parameters:
      globalTransaction - the transaction.
      Returns:
      true if the resources can be released, false otherwise.
    • getPartialTransactions

      Collection<GlobalTransaction> getPartialTransactions()
      Returns:
      a collection of partial committed or aborted transactions.
    • canRollbackTransactionAfterOriginatorLeave

      boolean canRollbackTransactionAfterOriginatorLeave(GlobalTransaction globalTransaction)
      It checks if the transaction can be aborted when the originator leaves the cluster.

      The only case in which it is not possible to abort is when partition handling is enabled and the originator didn't leave gracefully. The transaction will complete when the partition heals.

      Parameters:
      globalTransaction - the global transaction.
      Returns:
      true if the transaction can be aborted, false otherwise.
    • onTopologyUpdate

      void onTopologyUpdate(CacheTopology cacheTopology)
      Notifies the PartitionHandlingManager that the cache topology was update.

      It detects when the partition is merged and tries to complete all the partially completed transactions.

      Parameters:
      cacheTopology - the new cache topology.