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,
UpstreamTransformerBuilder upstreamTransformerBuilder,
IgniteCache<Integer,C> datasetCache,
LearningEnvironmentBuilder envBuilder,
PartitionDataBuilder<K,V,C,D> partDataBuilder,
UUID datasetId,
boolean upstreamKeepBinary,
LearningEnvironment localLearningEnv,
int retriesCnt)
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,LearningEnvironment,R> map,
IgniteBinaryOperator<R> reduce,
R identity)
Applies the specified
map function to every partition data and LearningEnvironment
in the dataset and then reduces map results to final result by using the reduce function. |
<R> R |
computeWithCtx(IgniteTriFunction<C,D,LearningEnvironment,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, UpstreamTransformerBuilder upstreamTransformerBuilder, IgniteCache<Integer,C> datasetCache, LearningEnvironmentBuilder envBuilder, PartitionDataBuilder<K,V,C,D> partDataBuilder, UUID datasetId, boolean upstreamKeepBinary, LearningEnvironment localLearningEnv, int retriesCnt)
upstream
and as reliable storage for
partition context
as well.ignite
- Ignite instance.upstreamCache
- Ignite Cache with upstream
data.filter
- Filter for upstream
data.upstreamTransformerBuilder
- Transformer of upstream data (see description in DatasetBuilder
).datasetCache
- Ignite Cache with partition context
.partDataBuilder
- Partition data
builder.datasetId
- Dataset ID.localLearningEnv
- Local learning environment.retriesCnt
- Number of retries for the case when one of partitions not found on the node where computation is performed.public <R> R computeWithCtx(IgniteTriFunction<C,D,LearningEnvironment,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 LearningEnvironment
.reduce
- Function applied to results of map
to get final result.identity
- Identity.public <R> R compute(IgniteBiFunction<D,LearningEnvironment,R> map, IgniteBinaryOperator<R> reduce, R identity)
map
function to every partition data
and LearningEnvironment
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 LearningEnvironment
.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()
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024