K
- Type of a key in upstream
data.V
- Type of a value in upstream
data.C
- Type of a partition context
.D
- Type of a partition data
.public class CacheBasedDataset<K,V,C extends Serializable,D extends AutoCloseable> extends Object implements Dataset<C,D>
upstream
and as reliable storage for
partition context
as well.Constructor and Description |
---|
CacheBasedDataset(Ignite ignite,
IgniteCache<K,V> upstreamCache,
IgniteBiPredicate<K,V> filter,
IgniteCache<Integer,C> datasetCache,
PartitionDataBuilder<K,V,C,D> partDataBuilder,
UUID datasetId)
Constructs a new instance of dataset based on Ignite Cache, which is used as
upstream and as reliable storage for
partition context as well. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
<R> R |
compute(IgniteBiFunction<D,Integer,R> map,
IgniteBinaryOperator<R> reduce,
R identity)
Applies the specified
map function to every partition data and partition index in the dataset
and then reduces map results to final result by using the reduce function. |
<R> R |
computeWithCtx(IgniteTriFunction<C,D,Integer,R> map,
IgniteBinaryOperator<R> reduce,
R identity)
Applies the specified
map function to every partition data , context and partition
index in the dataset and then reduces map results to final result by using the reduce function. |
IgniteCache<Integer,C> |
getDatasetCache() |
IgniteCache<K,V> |
getUpstreamCache() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, compute, compute, compute, compute, computeWithCtx, computeWithCtx, computeWithCtx, computeWithCtx, computeWithCtx, wrap
public CacheBasedDataset(Ignite ignite, IgniteCache<K,V> upstreamCache, IgniteBiPredicate<K,V> filter, IgniteCache<Integer,C> datasetCache, PartitionDataBuilder<K,V,C,D> partDataBuilder, UUID datasetId)
upstream
and as reliable storage for
partition context
as well.ignite
- Ignite instance.upstreamCache
- Ignite Cache with upstream
data.filter
- Filter for upstream
data.datasetCache
- Ignite Cache with partition context
.partDataBuilder
- Partition data
builder.datasetId
- Dataset ID.public <R> R computeWithCtx(IgniteTriFunction<C,D,Integer,R> map, IgniteBinaryOperator<R> reduce, R identity)
map
function to every partition data
, context
and partition
index in the dataset and then reduces map
results to final result by using the reduce
function.computeWithCtx
in interface Dataset<C extends Serializable,D extends AutoCloseable>
R
- Type of a result.map
- Function applied to every partition data
, context
and partition index.reduce
- Function applied to results of map
to get final result.identity
- Identity.public <R> R compute(IgniteBiFunction<D,Integer,R> map, IgniteBinaryOperator<R> reduce, R identity)
map
function to every partition data
and partition index in the dataset
and then reduces map
results to final result by using the reduce
function.compute
in interface Dataset<C extends Serializable,D extends AutoCloseable>
R
- Type of a result.map
- Function applied to every partition data
and partition index.reduce
- Function applied to results of map
to get final result.identity
- Identity.public void close()
close
in interface AutoCloseable
public IgniteCache<K,V> getUpstreamCache()
public IgniteCache<Integer,C> getDatasetCache()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019