org.apache.ignite.ml.dataset

## Interface PartitionContextBuilder<K,V,C extends Serializable>

- Type Parameters:
    `K` - Type of a key in `upstream` data.
    `V` - Type of a value in `upstream` data.
    `C` - Type of a partition `context`.
  All Superinterfaces:
    Serializable
  All Known Implementing Classes:
    EmptyContextBuilder
  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 PartitionContextBuilder<K,V,C extends Serializable>
      extends Serializable

  Builder that accepts a partition `upstream` data and makes partition `context`. This builder is used to build a partition `context` and assumed to be called only once for every partition during a dataset initialization.
  See Also:
    `EmptyContextBuilder`

- - ### Method Summary

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

- - ### Method Detail

    - #### build

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

      Builds a new partition `context` from an `upstream` data. 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.
      Returns:
        Partition `context`.

    - #### build

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

      Builds a new partition `context` from an `upstream` data. 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.
      Returns:
        Partition `context`.

    - #### andThen

          default <C2 extends Serializable> PartitionContextBuilder<K,V,C2> andThen(IgniteFunction<C,C2> fun)

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

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022