K
- key type (identifies entries to remove)public interface Invalidate<K>
"Invalidate" means: Remove from the cache, and discard any changes that have been made in this cache or any backing cache. In particular, if changes have been persisted to disk, remove those as well.
This interface is extended both by the caches and by CacheRemover
.
See AbstractCache
and CacheRemover
, for more specific
documentation for each case.
Modifier and Type | Field and Description |
---|---|
static long |
defaultParallelismThreshold
TODO: Should do some benchmarks.
|
Modifier and Type | Method and Description |
---|---|
void |
invalidate(K key)
Removes and discards the entry with the specified
key . |
default void |
invalidateAll()
Removes and discards all entries.
|
void |
invalidateAll(long parallelismThreshold)
Removes and discards all entries.
|
void |
invalidateIf(long parallelismThreshold,
Predicate<K> condition)
Removes and discards all entries with keys matching
condition . |
default void |
invalidateIf(Predicate<K> condition)
Removes and discards all entries with keys matching
condition . |
static final long defaultParallelismThreshold
void invalidate(K key)
key
.
See AbstractCache.invalidate(Object)
,
CacheRemover.invalidate(Object)
.
key
- key of the entry to removevoid invalidateIf(long parallelismThreshold, Predicate<K> condition)
condition
.
See AbstractCache.invalidateIf(long, Predicate)
,
CacheRemover.invalidateIf(long, Predicate)
.
condition
- condition on keys of entries to removeparallelismThreshold
- the (estimated) number of entries in the cache needed for this
operation to be executed in parallelvoid invalidateAll(long parallelismThreshold)
See AbstractCache.invalidateAll(long)
,
CacheRemover.invalidateAll(long)
.
parallelismThreshold
- the (estimated) number of entries in the cache needed for this
operation to be executed in paralleldefault void invalidateIf(Predicate<K> condition)
condition
.
(Calls invalidateIf(long, Predicate)
with
defaultParallelismThreshold
.)condition
- condition on keys of entries to removedefault void invalidateAll()
invalidateAll(long)
with defaultParallelismThreshold
.)Copyright © 2015–2022 ImgLib2. All rights reserved.