Interface ConditionalRemover<K,V>
- Type Parameters:
K
- The key's type stored in theRemoteCache
.V
- The value's type stored in theRemoteCache
.
- 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 TypeMethodDescriptionvoid
executeRemovals
(org.infinispan.client.hotrod.RemoteCache<K, V> cache, org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage) Executes the conditional removes in theRemoteCache
.boolean
willRemove
(K key, V value) default boolean
willRemove
(Updater<K, V> updater)
-
Method Details
-
willRemove
- Parameters:
key
- The entry's key to test.value
- The entry's value to test.- Returns:
true
if the entry will be removed from theRemoteCache
.
-
willRemove
-
executeRemovals
void executeRemovals(org.infinispan.client.hotrod.RemoteCache<K, V> cache, org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage) Executes the conditional removes in theRemoteCache
.- Parameters:
cache
- TheRemoteCache
to perform the remove operations.stage
- TheAggregateCompletionStage
to add any incomplete tasks.
-