@ThreadSafe public interface AdvancedCacheLoader<K,V> extends CacheLoader<K,V>
CacheLoader
interface that allows processing parallel iteration over the
existing entries.Modifier and Type | Interface and Description |
---|---|
static interface |
AdvancedCacheLoader.CacheLoaderTask<K,V>
Deprecated.
since 9.3 The process method is deprecated and thus this class shouldn't be in use any more
|
static interface |
AdvancedCacheLoader.TaskContext
Deprecated.
since 9.3 The process method is no longer suggested and thus this class shouldn't be in use any more
|
Modifier and Type | Method and Description |
---|---|
default void |
process(KeyFilter<? super K> filter,
AdvancedCacheLoader.CacheLoaderTask<K,V> task,
Executor executor,
boolean fetchValue,
boolean fetchMetadata)
Deprecated.
since 9.3 This is to be removed and replaced by
publishEntries(Predicate, boolean, boolean) |
default org.reactivestreams.Publisher<MarshalledEntry<K,V>> |
publishEntries(Predicate<? super K> filter,
boolean fetchValue,
boolean fetchMetadata)
Publishes all entries from this store.
|
default org.reactivestreams.Publisher<K> |
publishKeys(Predicate<? super K> filter)
Publishes all the keys from this store.
|
int |
size()
Returns the number of elements in the store.
|
contains, init, isAvailable, load
@Deprecated default void process(KeyFilter<? super K> filter, AdvancedCacheLoader.CacheLoaderTask<K,V> task, Executor executor, boolean fetchValue, boolean fetchMetadata)
publishEntries(Predicate, boolean, boolean)
CacheLoaderTask#processEntry(MarshalledEntry, TaskContext)
is
invoked. Before passing an entry to the callback task, the entry should be validated against the filter.
Implementors should build an AdvancedCacheLoader.TaskContext
instance (implementation) that is fed to the AdvancedCacheLoader.CacheLoaderTask
on every invocation. The AdvancedCacheLoader.CacheLoaderTask
might invoke AdvancedCacheLoader.TaskContext.stop()
at any time, so implementors of this method
should verify TaskContext's state for early termination of iteration. The method should only return once the
iteration is complete or as soon as possible in the case TaskContext.stop() is invoked.filter
- to validate which entries should be feed into the task. Might be null.task
- callback to be invoked in parallel for each stored entry that passes the filter checkexecutor
- an external thread pool to be used for parallel iterationfetchValue
- whether or not to fetch the value from the persistent store. E.g. if the iteration is
intended only over the key set, no point fetching the values from the persistent store as
wellfetchMetadata
- whether or not to fetch the metadata from the persistent store. E.g. if the iteration is
intended only ove the key set, then no pint fetching the metadata from the persistent store
as wellPersistenceException
- in case of an error, e.g. communicating with the external storageint size()
PersistenceException
- in case of an error, e.g. communicating with the external storagedefault org.reactivestreams.Publisher<K> publishKeys(Predicate<? super K> filter)
Subscriber
s as desired. Keys are not retrieved until a given Subscriber requests
them from the Subscription
.
Stores will return only non expired keys
filter
- a filterdefault org.reactivestreams.Publisher<MarshalledEntry<K,V>> publishEntries(Predicate<? super K> filter, boolean fetchValue, boolean fetchMetadata)
Subscriber
s as desired. Entries are not retrieved until a given Subscriber requests
them from the Subscription
.
If fetchMetadata is true this store must guarantee to not return any expired entries.
filter
- fetchValue
- fetchMetadata
- Copyright © 2020 JBoss, a division of Red Hat. All rights reserved.