public class CacheUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CacheUtils.CacheEntry<K,V>
Cache entry support.
|
| Constructor and Description |
|---|
CacheUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <A> Collection<A> |
bcast(String cacheName,
IgniteCallable<A> call) |
static <A> Collection<A> |
bcast(String cacheName,
Ignite ignite,
IgniteCallable<A> call)
Broadcast callable to data nodes of given cache.
|
static void |
bcast(String cacheName,
Ignite ignite,
IgniteRunnable run) |
static void |
bcast(String cacheName,
IgniteRunnable run)
Broadcast runnable to data nodes of given cache.
|
static <K,V,A> A |
distributedFold(String cacheName,
IgniteBiFunction<javax.cache.Cache.Entry<K,V>,A,A> folder,
IgnitePredicate<K> keyFilter,
BinaryOperator<A> accumulator,
IgniteSupplier<A> zeroValSupp)
Distributed version of fold operation.
|
static <K,V,A> Collection<A> |
fold(String cacheName,
IgniteBiFunction<CacheUtils.CacheEntry<K,V>,A,A> folder)
Currently fold supports only commutative operations.
|
static <K,V,A> Collection<A> |
fold(String cacheName,
IgniteBiFunction<CacheUtils.CacheEntry<K,V>,A,A> folder,
IgnitePredicate<K> keyFilter)
Currently fold supports only commutative operations.
|
protected static <K,V> void |
foreach(String cacheName,
IgniteConsumer<CacheUtils.CacheEntry<K,V>> fun,
IgnitePredicate<K> keyFilter) |
protected static <K> ClusterGroup |
getClusterGroupForGivenKey(String cacheName,
K k) |
static Ignite |
ignite()
Gets local Ignite instance.
|
static <K,V> void |
map(String cacheName,
KeyMapper<K> keyMapper,
ValueMapper<V> valMapper,
IgniteFunction<Double,Double> mapper) |
static <K,V> double |
max(String cacheName,
KeyMapper<K> keyMapper,
ValueMapper<V> valMapper) |
static <K,V> double |
min(String cacheName,
KeyMapper<K> keyMapper,
ValueMapper<V> valMapper) |
static <K,V,A,W> A |
reduce(String cacheName,
Ignite ignite,
IgniteTriFunction<W,javax.cache.Cache.Entry<K,V>,A,A> acc,
IgniteSupplier<W> supp,
IgniteSupplier<Iterable<javax.cache.Cache.Entry<K,V>>> entriesGen,
IgniteBinaryOperator<A> comb,
IgniteSupplier<A> zeroValSupp)
Distributed version of fold operation.
|
static <K,V,A,W> A |
reduce(String cacheName,
IgniteTriFunction<W,javax.cache.Cache.Entry<K,V>,A,A> acc,
IgniteSupplier<W> supp,
IgniteSupplier<Iterable<javax.cache.Cache.Entry<K,V>>> entriesGen,
IgniteBinaryOperator<A> comb,
IgniteSupplier<A> zeroValSupp)
Distributed version of fold operation.
|
static <K,V> void |
sparseMap(UUID matrixUuid,
IgniteDoubleFunction<Double> mapper,
String cacheName) |
static <K,V> void |
sparseMapForVector(UUID vectorUuid,
IgniteDoubleFunction<V> mapper,
String cacheName) |
static <K,V> double |
sparseMax(UUID matrixUuid,
String cacheName) |
static <K,V> double |
sparseMin(UUID matrixUuid,
String cacheName) |
static <K,V> double |
sparseSum(UUID matrixUuid,
String cacheName) |
static <K,V> double |
sum(String cacheName,
KeyMapper<K> keyMapper,
ValueMapper<V> valMapper) |
static <K,V> void |
update(String cacheName,
Ignite ignite,
IgniteBiFunction<Ignite,javax.cache.Cache.Entry<K,V>,Stream<javax.cache.Cache.Entry<K,V>>> fun,
IgniteSupplier<Set<K>> keysGen) |
static <K,V> void |
update(String cacheName,
Ignite ignite,
IgniteConsumer<javax.cache.Cache.Entry<K,V>> fun,
IgniteSupplier<Set<K>> keysGen) |
public static Ignite ignite()
protected static <K> ClusterGroup getClusterGroupForGivenKey(String cacheName, K k)
K - Key type.cacheName - Cache name.k - Key into the cache.public static <K,V> double sum(String cacheName, KeyMapper<K> keyMapper, ValueMapper<V> valMapper)
K - Cache key object type.V - Cache value object type.cacheName - Cache name.keyMapper - KeyMapper to validate cache key.valMapper - ValueMapper to obtain double value for given cache key.public static <K,V> double sparseSum(UUID matrixUuid, String cacheName)
matrixUuid - Matrix UUID.public static <K,V> double min(String cacheName, KeyMapper<K> keyMapper, ValueMapper<V> valMapper)
K - Cache key object type.V - Cache value object type.cacheName - Cache name.keyMapper - KeyMapper to validate cache key.valMapper - ValueMapper to obtain double value for given cache key.public static <K,V> double sparseMin(UUID matrixUuid, String cacheName)
matrixUuid - Matrix UUID.public static <K,V> double sparseMax(UUID matrixUuid, String cacheName)
matrixUuid - Matrix UUID.public static <K,V> double max(String cacheName, KeyMapper<K> keyMapper, ValueMapper<V> valMapper)
K - Cache key object type.V - Cache value object type.cacheName - Cache name.keyMapper - KeyMapper to validate cache key.valMapper - ValueMapper to obtain double value for given cache key.public static <K,V> void map(String cacheName, KeyMapper<K> keyMapper, ValueMapper<V> valMapper, IgniteFunction<Double,Double> mapper)
K - Cache key object type.V - Cache value object type.cacheName - Cache name.keyMapper - KeyMapper to validate cache key.valMapper - ValueMapper to obtain double value for given cache key.mapper - Mapping IgniteFunction.public static <K,V> void sparseMap(UUID matrixUuid, IgniteDoubleFunction<Double> mapper, String cacheName)
matrixUuid - Matrix UUID.mapper - Mapping IgniteFunction.protected static <K,V> void foreach(String cacheName, IgniteConsumer<CacheUtils.CacheEntry<K,V>> fun, IgnitePredicate<K> keyFilter)
K - Cache key object type.V - Cache value object type.cacheName - Cache name.fun - An operation that accepts a cache entry and processes it.keyFilter - Cache keys filter.public static <K,V> void update(String cacheName, Ignite ignite, IgniteBiFunction<Ignite,javax.cache.Cache.Entry<K,V>,Stream<javax.cache.Cache.Entry<K,V>>> fun, IgniteSupplier<Set<K>> keysGen)
K - Cache key object type.V - Cache value object type.cacheName - Cache name.fun - An operation that accepts a cache entry and processes it.ignite - Ignite.keysGen - Keys generator.public static <K,V> void update(String cacheName, Ignite ignite, IgniteConsumer<javax.cache.Cache.Entry<K,V>> fun, IgniteSupplier<Set<K>> keysGen)
K - Cache key object type.V - Cache value object type.cacheName - Cache name.fun - An operation that accepts a cache entry and processes it.ignite - Ignite.keysGen - Keys generator.public static <K,V,A> Collection<A> fold(String cacheName, IgniteBiFunction<CacheUtils.CacheEntry<K,V>,A,A> folder)
K - Cache key object type.V - Cache value object type.A - Fold result type.cacheName - Cache name.folder - Fold function operating over cache entries.public static <K,V,A> Collection<A> fold(String cacheName, IgniteBiFunction<CacheUtils.CacheEntry<K,V>,A,A> folder, IgnitePredicate<K> keyFilter)
K - Cache key object type.V - Cache value object type.A - Fold result type.cacheName - Cache name.folder - Fold function operating over cache entries.public static <K,V,A> A distributedFold(String cacheName, IgniteBiFunction<javax.cache.Cache.Entry<K,V>,A,A> folder, IgnitePredicate<K> keyFilter, BinaryOperator<A> accumulator, IgniteSupplier<A> zeroValSupp)
cacheName - Cache name.folder - Folder.keyFilter - Key filter.accumulator - Accumulator.zeroValSupp - Zero value supplier.public static <K,V,A,W> A reduce(String cacheName, Ignite ignite, IgniteTriFunction<W,javax.cache.Cache.Entry<K,V>,A,A> acc, IgniteSupplier<W> supp, IgniteSupplier<Iterable<javax.cache.Cache.Entry<K,V>>> entriesGen, IgniteBinaryOperator<A> comb, IgniteSupplier<A> zeroValSupp)
cacheName - Cache name.ignite - igniteacc - Accumulatorsupp - supplierentriesGen - entries generatorcomb - combinerzeroValSupp - Zero value supplier.public static <K,V,A,W> A reduce(String cacheName, IgniteTriFunction<W,javax.cache.Cache.Entry<K,V>,A,A> acc, IgniteSupplier<W> supp, IgniteSupplier<Iterable<javax.cache.Cache.Entry<K,V>>> entriesGen, IgniteBinaryOperator<A> comb, IgniteSupplier<A> zeroValSupp)
cacheName - Cache name.acc - Accumulatorsupp - supplierentriesGen - entries generatorcomb - combinerzeroValSupp - Zero value supplierpublic static void bcast(String cacheName, Ignite ignite, IgniteRunnable run)
cacheName - Cache name.run - Runnable to broadcast to cache nodes for given cache name.public static void bcast(String cacheName, IgniteRunnable run)
cacheName - Cache name.run - Runnable.public static <A> Collection<A> bcast(String cacheName, IgniteCallable<A> call)
A - Type returned by the callable.cacheName - Cache name.call - IgniteCallable to broadcast to cache nodes for given cache name.public static <A> Collection<A> bcast(String cacheName, Ignite ignite, IgniteCallable<A> call)
A - Type of callable result.cacheName - Cache name.ignite - Ignite instance.call - Callable to broadcast.public static <K,V> void sparseMapForVector(UUID vectorUuid, IgniteDoubleFunction<V> mapper, String cacheName)
vectorUuid - Matrix UUID.mapper - Mapping IgniteFunction.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.6.0 Release Date : July 10 2018