com.google.cloud.dataflow.sdk.transforms

## Class CombineFns

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.CombineFns

    public class CombineFns
    extends Object

Static utility methods that create combine function instances.

### Nested Class Summary

Nested Classes
`static class` `CombineFns.CoCombineResult` A tuple of outputs produced by a composed combine functions.
`static class` `CombineFns.ComposeCombineFnBuilder` A builder class to construct a composed `CombineFnBase.GlobalCombineFn`.
`static class` `CombineFns.ComposedCombineFn<DataT>` A composed `Combine.CombineFn` that applies multiple `CombineFns`.
`static class` `CombineFns.ComposedCombineFnWithContext<DataT>` A composed `CombineWithContext.CombineFnWithContext` that applies multiple `CombineFnWithContexts`.
`static class` `CombineFns.ComposedKeyedCombineFn<DataT,K>` A composed `Combine.KeyedCombineFn` that applies multiple `KeyedCombineFns`.
`static class` `CombineFns.ComposedKeyedCombineFnWithContext<DataT,K>` A composed `CombineWithContext.KeyedCombineFnWithContext` that applies multiple `KeyedCombineFnWithContexts`.
`static class` `CombineFns.ComposeKeyedCombineFnBuilder` A builder class to construct a composed `CombineFnBase.PerKeyCombineFn`.

### Constructor Summary

Constructors
Constructor and Description
`CombineFns()`

### Method Summary

All Methods Static Methods Concrete Methods
`static CombineFns.ComposeCombineFnBuilder` `compose()` Returns a `CombineFns.ComposeCombineFnBuilder` to construct a composed `CombineFnBase.GlobalCombineFn`.
`static CombineFns.ComposeKeyedCombineFnBuilder` `composeKeyed()` Returns a `CombineFns.ComposeKeyedCombineFnBuilder` to construct a composed `CombineFnBase.PerKeyCombineFn`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CombineFns

    public CombineFns()

### Method Detail

#### composeKeyed

    public static CombineFns.ComposeKeyedCombineFnBuilder composeKeyed()

Returns a `CombineFns.ComposeKeyedCombineFnBuilder` to construct a composed `CombineFnBase.PerKeyCombineFn`.

The same `TupleTag` cannot be used in a composition multiple times.

Example:

    { @code
     PCollection<KV<K, Integer>> latencies = ...;

     TupleTag<Integer> maxLatencyTag = new TupleTag<Integer>();
     TupleTag<Double> meanLatencyTag = new TupleTag<Double>();

     SimpleFunction<Integer, Integer> identityFn =
         new SimpleFunction<Integer, Integer>() {

#### compose

    public static CombineFns.ComposeCombineFnBuilder compose()

Returns a `CombineFns.ComposeCombineFnBuilder` to construct a composed `CombineFnBase.GlobalCombineFn`.

The same `TupleTag` cannot be used in a composition multiple times.

Example:

    { @code
     PCollection<Integer> globalLatencies = ...;

     TupleTag<Integer> maxLatencyTag = new TupleTag<Integer>();
     TupleTag<Double> meanLatencyTag = new TupleTag<Double>();

     SimpleFunction<Integer, Integer> identityFn =
         new SimpleFunction<Integer, Integer>() {