com.google.cloud.dataflow.sdk.transforms

## Interface CombineFnBase.PerKeyCombineFn<K,InputT,AccumT,OutputT>

Type Parameters:
  `K` - type of keys
  `InputT` - type of input values
  `AccumT` - type of mutable accumulator values
  `OutputT` - type of output values

All Superinterfaces:
  HasDisplayData, Serializable

All Known Implementing Classes:
  Combine.KeyedCombineFn, CombineFns.ComposedKeyedCombineFn, CombineFns.ComposedKeyedCombineFnWithContext, CombineWithContext.KeyedCombineFnWithContext

Enclosing class:
  CombineFnBase

    public static interface CombineFnBase.PerKeyCombineFn<K,InputT,AccumT,OutputT>
    extends Serializable, HasDisplayData

A `PerKeyCombineFn<K, InputT, AccumT, OutputT>` specifies how to combine a collection of input values of type `InputT`, associated with a key of type `K`, into a single output value of type `OutputT`. It does this via one or more intermediate mutable accumulator values of type `AccumT`.

Do not implement this interface directly. Extends `Combine.KeyedCombineFn` and `CombineWithContext.KeyedCombineFnWithContext` instead.

### Method Summary

All Methods Instance Methods Abstract Methods
`CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT>` `forKey(K key, Coder<K> keyCoder)` Returns the a regular `CombineFnBase.GlobalCombineFn` that operates on a specific key.
`Coder<AccumT>` `getAccumulatorCoder(CoderRegistry registry, Coder<K> keyCoder, Coder<InputT> inputCoder)` Returns the `Coder` to use for accumulator `AccumT` values, or null if it is not able to be inferred.
`Coder<OutputT>` `getDefaultOutputCoder(CoderRegistry registry, Coder<K> keyCoder, Coder<InputT> inputCoder)` Returns the `Coder` to use by default for output `OutputT` values, or null if it is not able to be inferred.

### Methods inherited from interface com.google.cloud.dataflow.sdk.transforms.display.HasDisplayData

`populateDisplayData`

### Method Detail

#### getAccumulatorCoder

    Coder<AccumT> getAccumulatorCoder(CoderRegistry registry,
                                      Coder<K> keyCoder,
                                      Coder<InputT> inputCoder)
                               throws CannotProvideCoderException

Returns the `Coder` to use for accumulator `AccumT` values, or null if it is not able to be inferred.

By default, uses the knowledge of the `Coder` being used for `K` keys and input `InputT` values and the enclosing `Pipeline`'s `CoderRegistry` to try to infer the Coder for `AccumT` values.

This is the Coder used to send data through a communication-intensive shuffle step, so a compact and efficient representation may have significant performance benefits.

Throws:
  `CannotProvideCoderException`

#### getDefaultOutputCoder

    Coder<OutputT> getDefaultOutputCoder(CoderRegistry registry,
                                         Coder<K> keyCoder,
                                         Coder<InputT> inputCoder)
                                  throws CannotProvideCoderException

Returns the `Coder` to use by default for output `OutputT` values, or null if it is not able to be inferred.

By default, uses the knowledge of the `Coder` being used for `K` keys and input `InputT` values and the enclosing `Pipeline`'s `CoderRegistry` to try to infer the Coder for `OutputT` values.

Throws:
  `CannotProvideCoderException`

#### forKey

    CombineFnBase.GlobalCombineFn<InputT,AccumT,OutputT> forKey(K key,
                                                                Coder<K> keyCoder)

Returns the a regular `CombineFnBase.GlobalCombineFn` that operates on a specific key.