Interface ConditionalRemover<K,V>

Type Parameters:
K - The key's type stored in the RemoteCache.
V - The value's type stored in the RemoteCache.
All Known Implementing Classes:
ByRealmIdQueryConditionalRemover, ClientSessionQueryConditionalRemover, EmptyConditionalRemover, UserSessionQueryConditionalRemover

public interface ConditionalRemover<K,V>
It handles conditional remove operations.

This class is preferred to remove an unknown amount of entries by its key and/or value state. The implement may use queries (delete statements) or perform a full cache scan to find the entries to remove.

The method willRemove(Updater) is invoked by RemoteChangeLogTransaction before perform any change tracked by the Updater. This is an optimization to prevent sending changes that would be removed by this ConditionalRemover.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    executeRemovals(org.infinispan.client.hotrod.RemoteCache<K,V> cache, org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage)
    Executes the conditional removes in the RemoteCache.
    boolean
    willRemove(K key, V value)
     
    default boolean
    willRemove(Updater<K,V> updater)
     
  • Method Details

    • willRemove

      boolean willRemove(K key, V value)
      Parameters:
      key - The entry's key to test.
      value - The entry's value to test.
      Returns:
      true if the entry will be removed from the RemoteCache.
    • willRemove

      default boolean willRemove(Updater<K,V> updater)
      Parameters:
      updater - The Updater to test.
      Returns:
      true if the entry tracked by the Updater will be removed from the RemoteCache.
    • executeRemovals

      void executeRemovals(org.infinispan.client.hotrod.RemoteCache<K,V> cache, org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage)
      Executes the conditional removes in the RemoteCache.
      Parameters:
      cache - The RemoteCache to perform the remove operations.
      stage - The AggregateCompletionStage to add any incomplete tasks.