public class LocalEntryRetriever<K,V> extends Object implements EntryRetriever<K,V>
Modifier and Type | Class and Description |
---|---|
protected static interface |
LocalEntryRetriever.BatchHandler<K,C> |
protected class |
LocalEntryRetriever.DataContainerIterator<C> |
protected class |
LocalEntryRetriever.Itr<C> |
protected class |
LocalEntryRetriever.ItrQueuerHandler<C> |
protected class |
LocalEntryRetriever.KeyValueActionForCacheLoaderTask |
protected class |
LocalEntryRetriever.PartitionListener |
protected static class |
LocalEntryRetriever.PassivationListener<K,V> |
EntryRetriever.SegmentListener
Modifier and Type | Field and Description |
---|---|
protected int |
batchSize |
protected Cache<K,V> |
cache |
protected ComponentRegistry |
componentRegistry |
protected DataContainer<K,V> |
dataContainer |
protected InternalEntryFactory |
entryFactory |
protected ExecutorService |
executorService |
protected Equivalence<K> |
keyEquivalence |
protected Log |
log |
protected LocalEntryRetriever.PartitionListener |
partitionListener |
protected PersistenceManager |
persistenceManager |
protected long |
timeout |
protected TimeService |
timeService |
protected TimeUnit |
unit |
protected Executor |
withinThreadExecutor |
Constructor and Description |
---|
LocalEntryRetriever(int batchSize,
long timeout,
TimeUnit unit) |
Modifier and Type | Method and Description |
---|---|
void |
inject(DataContainer<K,V> dataContainer,
PersistenceManager persistenceManager,
ExecutorService executorService,
TimeService timeService,
InternalEntryFactory entryFactory,
Cache<K,V> cache,
Configuration config,
ComponentRegistry componentRegistry) |
<C> void |
receiveResponse(UUID identifier,
Address origin,
Set<Integer> completedSegments,
Set<Integer> inDoubtSegments,
Collection<CacheEntry<K,C>> entries,
CacheException e)
This method is invoked on the local node who started the iteration process for each batch of values.
|
protected <C> void |
registerIterator(LocalEntryRetriever.Itr<C> itr,
Set<Flag> flags) |
<C> CloseableIterator<CacheEntry<K,C>> |
retrieveEntries(KeyValueFilter<? super K,? super V> filter,
Converter<? super K,? super V,? extends C> converter,
Set<Flag> flags,
EntryRetriever.SegmentListener listener)
This is invoked locally on the node that requested the iteration process.
|
protected boolean |
shouldUseLoader(Set<Flag> flags) |
void |
start() |
<C> void |
startRetrievingValues(UUID identifier,
Address origin,
Set<Integer> segments,
Set<K> keysToFilter,
KeyValueFilter<? super K,? super V> filter,
Converter<? super K,? super V,C> converter,
Set<Flag> flags)
This method is intended to be ran remotely on a node who has segments that the values have been requested.
|
protected static <T> T |
unwrapMarshalledvalue(T value) |
protected <C> void |
wireFilterAndConverterDependencies(KeyValueFilter<? super K,? super V> filter,
Converter<? super K,? super V,C> converter) |
protected final Log log
protected final int batchSize
protected final long timeout
protected final TimeUnit unit
protected DataContainer<K,V> dataContainer
protected PersistenceManager persistenceManager
protected ExecutorService executorService
protected ComponentRegistry componentRegistry
protected TimeService timeService
protected InternalEntryFactory entryFactory
protected Equivalence<K> keyEquivalence
protected final Executor withinThreadExecutor
protected final LocalEntryRetriever.PartitionListener partitionListener
public LocalEntryRetriever(int batchSize, long timeout, TimeUnit unit)
public void inject(DataContainer<K,V> dataContainer, PersistenceManager persistenceManager, ExecutorService executorService, TimeService timeService, InternalEntryFactory entryFactory, Cache<K,V> cache, Configuration config, ComponentRegistry componentRegistry)
public void start()
public <C> void startRetrievingValues(UUID identifier, Address origin, Set<Integer> segments, Set<K> keysToFilter, KeyValueFilter<? super K,? super V> filter, Converter<? super K,? super V,C> converter, Set<Flag> flags)
EntryRetriever
startRetrievingValues
in interface EntryRetriever<K,V>
C
- The resulting type of the Converteridentifier
- The unique identifier of the iteration requestorigin
- The node that sent the iteration requestsegments
- The segments this node wantskeysToFilter
- The keys to filter out (can be null
)filter
- The filter to be applied to determine if a value should be usedconverter
- The converter to run on the values retrieved before returningprotected <C> void wireFilterAndConverterDependencies(KeyValueFilter<? super K,? super V> filter, Converter<? super K,? super V,C> converter)
public <C> void receiveResponse(UUID identifier, Address origin, Set<Integer> completedSegments, Set<Integer> inDoubtSegments, Collection<CacheEntry<K,C>> entries, CacheException e)
EntryRetriever
completedSegments
or inDoubtSegments
is not empty (not both could be as well) then the
iteration process on this node is complete.receiveResponse
in interface EntryRetriever<K,V>
C
- The type of entries values sent backidentifier
- The unique identifier of the iteration requestorigin
- The node where the response came fromcompletedSegments
- Which segments have been completedinDoubtSegments
- Which segments are now in doubt due to a rehashentries
- The entries retrievede
- If an exception handled while processing the data on the remote nodeprotected <C> void registerIterator(LocalEntryRetriever.Itr<C> itr, Set<Flag> flags)
public <C> CloseableIterator<CacheEntry<K,C>> retrieveEntries(KeyValueFilter<? super K,? super V> filter, Converter<? super K,? super V,? extends C> converter, Set<Flag> flags, EntryRetriever.SegmentListener listener)
EntryRetriever
retrieveEntries
in interface EntryRetriever<K,V>
C
- The type of the resulting values from the converterfilter
- An optional filter that will be ran on each key/value to determine if it should be returned.converter
- An optional converter that will be ran on each key/value that will be returned to transform
the value to a different value if desiredflags
- An optional set of flags to modify behavior. For example Flag.CACHE_MODE_LOCAL
will prevent
the retriever from retrieving remote values and Flag.SKIP_CACHE_LOAD
will prevent the
retriever from getting values from the configured loader if present.listener
- An optional segment listener that can be used to tell the invoker when segments and the iteration
process is completedprotected static <T> T unwrapMarshalledvalue(T value)
Copyright © 2016 JBoss, a division of Red Hat. All rights reserved.