org.apache.ignite.ml.dataset

## Interface PartitionDataBuilder<K,V,C extends Serializable,D extends AutoCloseable>

- Type Parameters:
    `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`.
  All Superinterfaces:
    Serializable
  All Known Implementing Classes:
    BootstrappedDatasetBuilder, DecisionTreeDataBuilder, FeatureMatrixWithLabelsOnHeapDataBuilder, KNNPartitionDataBuilder, LabeledDatasetPartitionDataBuilderOnHeap, LabelPartitionDataBuilderOnHeap, RecommendationBinaryDatasetDataBuilder, RecommendationDatasetDataBuilder, SimpleDatasetDataBuilder, SimpleLabeledDatasetDataBuilder
  Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

      @FunctionalInterface
      public interface PartitionDataBuilder<K,V,C extends Serializable,D extends AutoCloseable>
      extends Serializable

  Builder that accepts a partition `upstream` data and partition `context` and makes partition `data`. This builder is used to build a partition `data` and assumed to be called in all cases when partition `data` not found on the node that performs computation (it might be the result of a previous node failure or rebalancing).
  See Also:
    `SimpleDatasetDataBuilder`, `SimpleLabeledDatasetDataBuilder`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default <D2 extends AutoCloseable> PartitionDataBuilder<K,V,C,D2>` | `andThen(IgniteBiFunction<D,C,D2> fun)` Makes a composed partition `data` builder that first builds a `data` and then applies the specified function on the result.
    `D` | `build(LearningEnvironment env, Iterator<UpstreamEntry<K,V>> upstreamData, long upstreamDataSize, C ctx)` Builds a new partition `data` from a partition `upstream` data and partition `context`.
    `default D` | `build(LearningEnvironment env, Stream<UpstreamEntry<K,V>> upstreamData, long upstreamDataSize, C ctx)` Builds a new partition `data` from a partition `upstream` data and partition `context`.

- - ### Method Detail

    - #### build

          D build(LearningEnvironment env,
                  Iterator<UpstreamEntry<K,V>> upstreamData,
                  long upstreamDataSize,
                  C ctx)

      Builds a new partition `data` from a partition `upstream` data and partition `context`. Important: there is no guarantee that there will be no more than one UpstreamEntry with given key, UpstreamEntry should be thought rather as a container saving all data from upstream, but omitting uniqueness constraint. This constraint is omitted to allow upstream data transformers in `DatasetBuilder` replicating entries. For example it can be useful for bootstrapping.
      Parameters:
        `env` - Learning environment.
        `upstreamData` - Partition `upstream` data.
        `upstreamDataSize` - Partition `upstream` data size.
        `ctx` - Partition `context`.
      Returns:
        Partition `data`.

    - #### build

          default D build(LearningEnvironment env,
                          Stream<UpstreamEntry<K,V>> upstreamData,
                          long upstreamDataSize,
                          C ctx)

      Builds a new partition `data` from a partition `upstream` data and partition `context`. Important: there is no guarantee that there will be no more than one UpstreamEntry with given key, UpstreamEntry should be thought rather as a container saving all data from upstream, but omitting uniqueness constraint. This constraint is omitted to allow upstream data transformers in `DatasetBuilder` replicating entries. For example it can be useful for bootstrapping.
      Parameters:
        `env` - Learning environment.
        `upstreamData` - Partition `upstream` data.
        `upstreamDataSize` - Partition `upstream` data size.
        `ctx` - Partition `context`.
      Returns:
        Partition `data`.

    - #### andThen

          default <D2 extends AutoCloseable> PartitionDataBuilder<K,V,C,D2> andThen(IgniteBiFunction<D,C,D2> fun)

      Makes a composed partition `data` builder that first builds a `data` and then applies the specified function on the result.
      Type Parameters:
        `D2` - New type of a partition `data`.
      Parameters:
        `fun` - Function that applied after first partition `data` is built.
      Returns:
        Composed partition `data` builder.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022