Package com.tangosol.util
Class ConverterCollections.ConverterAsyncNamedCache<FK,TK,FV,TV>
java.lang.Object
com.tangosol.util.ConverterCollections.ConverterAsyncNamedCache<FK,TK,FV,TV>
- All Implemented Interfaces:
AsyncNamedCache<TK,,TV> AsyncNamedMap<TK,TV>
- Enclosing class:
ConverterCollections
public static class ConverterCollections.ConverterAsyncNamedCache<FK,TK,FV,TV>
extends Object
implements AsyncNamedCache<TK,TV>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.net.AsyncNamedMap
AsyncNamedMap.Complete, AsyncNamedMap.Option, AsyncNamedMap.OrderBy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AsyncNamedMap<FK, FV> The underlying AsyncNamedMap.The Converter used to pass keys down to the Map.The Converter used to view keys stored in the Map.The Converter used to pass keys down to the Map.The Converter used to view values stored in the Map.protected final ConverterCollections.ConverterNamedCache<FK, TK, FV, TV> A converter version of the underlyingNamedCache.Fields inherited from interface com.tangosol.net.AsyncNamedMap
ANY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R> CompletableFuture<R> aggregate(Filter<?> filter, InvocableMap.EntryAggregator<? super TK, ? super TV, R> aggregator) Perform an aggregating operation asynchronously against the set of entries that are selected by the given Filter.<R> CompletableFuture<R> aggregate(Collection<? extends TK> collKeys, InvocableMap.EntryAggregator<? super TK, ? super TV, R> aggregator) Perform an aggregating operation asynchronously against the entries specified by the passed keys.Return theNamedCacheinstance thisAsyncNamedCacheis based on.Return theNamedCacheinstance thisAsyncNamedCacheis based on.instantiateCallback(Consumer<? super Map.Entry<? extends TK, ? extends R>> callback) instantiateMap(Map<FK, R> mapResult) <R> CompletableFuture<R> invoke(TK key, InvocableMap.EntryProcessor<TK, TV, R> processor) Invoke the passed EntryProcessor against the Entry specified by the passed key asynchronously, returning aCompletableFuturethat can be used to obtain the result of the invocation.<R> CompletableFuture<Map<TK, R>> invokeAll(Filter<?> filter, InvocableMap.EntryProcessor<TK, TV, R> processor) Invoke the passed EntryProcessor against the set of entries that are selected by the given Filter asynchronously, returning aCompletableFuturethat can be used to obtain the result of the invocation for each entry.<R> CompletableFuture<Void> invokeAll(Filter<?> filter, InvocableMap.EntryProcessor<TK, TV, R> processor, Consumer<? super Map.Entry<? extends TK, ? extends R>> callback) Invoke the passed EntryProcessor against the set of entries that are selected by the given Filter asynchronously, returning aCompletableFuturethat can be used to determine if the operation completed successfully.<R> CompletableFuture<Map<TK, R>> invokeAll(Collection<? extends TK> collKeys, InvocableMap.EntryProcessor<TK, TV, R> processor) Invoke the passed EntryProcessor against the entries specified by the passed keys asynchronously, returning aCompletableFuturethat can be used to obtain the result of the invocation for each entry.<R> CompletableFuture<Void> invokeAll(Collection<? extends TK> collKeys, InvocableMap.EntryProcessor<TK, TV, R> processor, Consumer<? super Map.Entry<? extends TK, ? extends R>> callback) Invoke the passed EntryProcessor against the entries specified by the passed keys asynchronously, returning aCompletableFuturethat can be used to determine if the operation completed successfully.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tangosol.net.AsyncNamedCache
put, putAllMethods inherited from interface com.tangosol.net.AsyncNamedMap
aggregate, clear, compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, entrySet, entrySet, entrySet, entrySet, entrySet, entrySet, get, getAll, getAll, getAll, getAll, getAll, getAll, getOrDefault, invokeAll, invokeAll, invokeAll, invokeAll, invokeAll, isEmpty, keySet, keySet, keySet, keySet, merge, put, putAll, putIfAbsent, remove, remove, removeAll, removeAll, replace, replace, replaceAll, replaceAll, replaceAll, size, values, values, values, values, values
-
Field Details
-
m_asyncNamedCache
The underlying AsyncNamedMap. -
m_namedCache
A converter version of the underlyingNamedCache. -
m_convKeyUp
The Converter used to view keys stored in the Map. -
m_convKeyDown
The Converter used to pass keys down to the Map. -
m_convValUp
The Converter used to view values stored in the Map. -
m_convValDown
The Converter used to pass keys down to the Map.
-
-
Constructor Details
-
ConverterAsyncNamedCache
public ConverterAsyncNamedCache(AsyncNamedCache<FK, FV> cache, Converter<FK, TK> convKeyUp, Converter<TK, FK> convKeyDown, Converter<FV, TV> convValUp, Converter<TV, FV> convValDown) Constructor.- Parameters:
cache- the underlyingAsyncNamedCacheconvKeyUp- the Converter to view the underlying AsyncNamedMap's keys throughconvKeyDown- the Converter to use to pass keys down to the underlying AsyncNamedMapconvValUp- the Converter to view the underlying AsyncNamedMap's values throughconvValDown- the Converter to use to pass values down to the underlying AsyncNamedMap
-
-
Method Details
-
getNamedMap
Description copied from interface:AsyncNamedMapReturn theNamedCacheinstance thisAsyncNamedCacheis based on.- Specified by:
getNamedMapin interfaceAsyncNamedMap<FK,TK> - Returns:
- the
NamedCacheinstance thisAsyncNamedCacheis based on
-
getNamedCache
Description copied from interface:AsyncNamedCacheReturn theNamedCacheinstance thisAsyncNamedCacheis based on.- Specified by:
getNamedCachein interfaceAsyncNamedCache<FK,TK> - Returns:
- the
NamedCacheinstance thisAsyncNamedCacheis based on
-
invoke
Description copied from interface:AsyncNamedMapInvoke the passed EntryProcessor against the Entry specified by the passed key asynchronously, returning aCompletableFuturethat can be used to obtain the result of the invocation.- Specified by:
invokein interfaceAsyncNamedMap<FK,TK> - Type Parameters:
R- the type of value returned by the EntryProcessor- Parameters:
key- the key to process; it is not required to exist within the Mapprocessor- the EntryProcessor to use to process the specified key- Returns:
- a
CompletableFuturethat can be used to obtain the result of the invocation
-
invokeAll
public <R> CompletableFuture<Map<TK,R>> invokeAll(Collection<? extends TK> collKeys, InvocableMap.EntryProcessor<TK, TV, R> processor) Description copied from interface:AsyncNamedMapInvoke the passed EntryProcessor against the entries specified by the passed keys asynchronously, returning aCompletableFuturethat can be used to obtain the result of the invocation for each entry.- Specified by:
invokeAllin interfaceAsyncNamedMap<FK,TK> - Type Parameters:
R- the type of value returned by the EntryProcessor- Parameters:
collKeys- the keys to process; these keys are not required to exist within the Mapprocessor- the EntryProcessor to use to process the specified keys- Returns:
- a
CompletableFuturethat can be used to obtain the result of the invocation for each entry
-
invokeAll
public <R> CompletableFuture<Map<TK,R>> invokeAll(Filter<?> filter, InvocableMap.EntryProcessor<TK, TV, R> processor) Description copied from interface:AsyncNamedMapInvoke the passed EntryProcessor against the set of entries that are selected by the given Filter asynchronously, returning aCompletableFuturethat can be used to obtain the result of the invocation for each entry.- Specified by:
invokeAllin interfaceAsyncNamedMap<FK,TK> - Type Parameters:
R- the type of value returned by the EntryProcessor- Parameters:
filter- a Filter that results in the set of keys to be processedprocessor- the EntryProcessor to use to process the specified keys- Returns:
- a
CompletableFuturethat can be used to obtain the result of the invocation for each entry
-
invokeAll
public <R> CompletableFuture<Void> invokeAll(Collection<? extends TK> collKeys, InvocableMap.EntryProcessor<TK, TV, R> processor, Consumer<? super Map.Entry<? extends TK, ? extends R>> callback) Description copied from interface:AsyncNamedMapInvoke the passed EntryProcessor against the entries specified by the passed keys asynchronously, returning aCompletableFuturethat can be used to determine if the operation completed successfully.Instead of collecting and returning the complete result, this method will stream partial results of the processor execution to the specified partial result callback, which allows for a much lower memory overhead.
Note: the callback implementation must be thread-safe as it may be called by multiple worker threads in cases where Coherence splits the operation over multiple partitions.- Specified by:
invokeAllin interfaceAsyncNamedMap<FK,TK> - Type Parameters:
R- the type of value returned by the EntryProcessor- Parameters:
collKeys- the keys to process; these keys are not required to exist within the Mapprocessor- the EntryProcessor to use to process the specified keyscallback- a user-defined callback that will be called for each partial result- Returns:
- a
CompletableFuturethat can be used to determine if the operation completed successfully
-
invokeAll
public <R> CompletableFuture<Void> invokeAll(Filter<?> filter, InvocableMap.EntryProcessor<TK, TV, R> processor, Consumer<? super Map.Entry<? extends TK, ? extends R>> callback) Description copied from interface:AsyncNamedMapInvoke the passed EntryProcessor against the set of entries that are selected by the given Filter asynchronously, returning aCompletableFuturethat can be used to determine if the operation completed successfully.Instead of collecting and returning the complete result, this method will stream partial results of the processor execution to the specified partial result callback, which allows for a much lower memory overhead.
Note: the callback implementation must be thread-safe as it may be called by multiple worker threads in cases where Coherence splits the operation over multiple partitions.- Specified by:
invokeAllin interfaceAsyncNamedMap<FK,TK> - Type Parameters:
R- the type of value returned by the EntryProcessor- Parameters:
filter- a Filter that results in the set of keys to be processedprocessor- the EntryProcessor to use to process the specified keyscallback- a user-defined callback that will be called for each partial result- Returns:
- a
CompletableFuturethat can be used to determine if the operation completed successfully
-
aggregate
public <R> CompletableFuture<R> aggregate(Collection<? extends TK> collKeys, InvocableMap.EntryAggregator<? super TK, ? super TV, R> aggregator) Description copied from interface:AsyncNamedMapPerform an aggregating operation asynchronously against the entries specified by the passed keys.- Specified by:
aggregatein interfaceAsyncNamedMap<FK,TK> - Type Parameters:
R- the type of value returned by the EntryAggregator- Parameters:
collKeys- the Collection of keys that specify the entries within this Map to aggregate acrossaggregator- the EntryAggregator that is used to aggregate across the specified entries of this Map- Returns:
- a
CompletableFuturethat can be used to obtain the result of the aggregation
-
aggregate
public <R> CompletableFuture<R> aggregate(Filter<?> filter, InvocableMap.EntryAggregator<? super TK, ? super TV, R> aggregator) Description copied from interface:AsyncNamedMapPerform an aggregating operation asynchronously against the set of entries that are selected by the given Filter.- Specified by:
aggregatein interfaceAsyncNamedMap<FK,TK> - Type Parameters:
R- the type of value returned by the EntryAggregator- Parameters:
filter- the Filter that is used to select entries within this Map to aggregate acrossaggregator- the EntryAggregator that is used to aggregate across the selected entries of this Map- Returns:
- a
CompletableFuturethat can be used to obtain the result of the aggregation
-
instantiateMap
-
instantiateCallback
-