com.google.cloud.dataflow.sdk.transforms

## Class Min

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

    public class Min
    extends Object

`PTransform`s for computing the minimum of the elements in a `PCollection`, or the minimum of the values associated with each key in a `PCollection` of `KV`s.

Example 1: get the minimum of a `PCollection` of `Double`s.

     PCollection<Double> input = ...;
     PCollection<Double> min = input.apply(Min.doublesGlobally());

Example 2: calculate the minimum of the `Integer`s associated with each unique key (which is of type `String`).

     PCollection<KV<String, Integer>> input = ...;
     PCollection<KV<String, Integer>> minPerKey = input
         .apply(Min.<String>integersPerKey());

### Nested Class Summary

Nested Classes
`static class` `Min.MinDoubleFn` A `CombineFn` that computes the minimum of a collection of `Double`s, useful as an argument to `Combine.globally(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)` or `Combine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)`.
`static class` `Min.MinFn<T>` A `CombineFn` that computes the maximum of a collection of elements of type `T` using an arbitrary `Comparator`, useful as an argument to `Combine.globally(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)` or `Combine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)`.
`static class` `Min.MinIntegerFn` A `CombineFn` that computes the minimum of a collection of `Integer`s, useful as an argument to `Combine.globally(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)` or `Combine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)`.
`static class` `Min.MinLongFn` A `CombineFn` that computes the minimum of a collection of `Long`s, useful as an argument to `Combine.globally(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)` or `Combine.perKey(com.google.cloud.dataflow.sdk.transforms.SerializableFunction<java.lang.Iterable<V>, V>)`.

### Method Summary

All Methods Static Methods Concrete Methods
`static Combine.Globally<Double,Double>` `doublesGlobally()` Returns a `PTransform` that takes an input `PCollection<Double>` and returns a `PCollection<Double>` whose contents is the minimum of the input `PCollection`'s elements, or `Double.POSITIVE_INFINITY` if there are no elements.
`static <K> Combine.PerKey<K,Double,Double>` `doublesPerKey()` Returns a `PTransform` that takes an input `PCollection<KV<K, Double>>` and returns a `PCollection<KV<K, Double>>` that contains an output element mapping each distinct key in the input `PCollection` to the minimum of the values associated with that key in the input `PCollection`.
`static <T extends Comparable<? super T>> Combine.Globally<T,T>` `globally()` Returns a `PTransform` that takes an input `PCollection<T>` and returns a `PCollection<T>` whose contents is the minimum according to the natural ordering of `T` of the input `PCollection`'s elements, or `null` if there are no elements.
`static <T,ComparatorT extends Comparator<? super T> & Serializable> Combine.Globally<T,T>` `globally(ComparatorT comparator)` Returns a `PTransform` that takes an input `PCollection<T>` and returns a `PCollection<T>` whose contents is the minimum of the input `PCollection`'s elements, or `null` if there are no elements.
`static Combine.Globally<Integer,Integer>` `integersGlobally()` Returns a `PTransform` that takes an input `PCollection<Integer>` and returns a `PCollection<Integer>` whose contents is a single value that is the minimum of the input `PCollection`'s elements, or `Integer.MAX_VALUE` if there are no elements.
`static <K> Combine.PerKey<K,Integer,Integer>` `integersPerKey()` Returns a `PTransform` that takes an input `PCollection<KV<K, Integer>>` and returns a `PCollection<KV<K, Integer>>` that contains an output element mapping each distinct key in the input `PCollection` to the minimum of the values associated with that key in the input `PCollection`.
`static Combine.Globally<Long,Long>` `longsGlobally()` Returns a `PTransform` that takes an input `PCollection<Long>` and returns a `PCollection<Long>` whose contents is the minimum of the input `PCollection`'s elements, or `Long.MAX_VALUE` if there are no elements.
`static <K> Combine.PerKey<K,Long,Long>` `longsPerKey()` Returns a `PTransform` that takes an input `PCollection<KV<K, Long>>` and returns a `PCollection<KV<K, Long>>` that contains an output element mapping each distinct key in the input `PCollection` to the minimum of the values associated with that key in the input `PCollection`.
`static <K,T extends Comparable<? super T>> Combine.PerKey<K,T,T>` `perKey()` Returns a `PTransform` that takes an input `PCollection<KV<K, T>>` and returns a `PCollection<KV<K, T>>` that contains an output element mapping each distinct key in the input `PCollection` to the minimum according to the natural ordering of `T` of the values associated with that key in the input `PCollection`.
`static <K,T,ComparatorT extends Comparator<? super T> & Serializable> Combine.PerKey<K,T,T>` `perKey(ComparatorT comparator)` Returns a `PTransform` that takes an input `PCollection<KV<K, T>>` and returns a `PCollection<KV<K, T>>` that contains one output element per key mapping each to the minimum of the values associated with that key in the input `PCollection`.

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

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

### Method Detail

#### integersGlobally

    public static Combine.Globally<Integer,Integer> integersGlobally()

Returns a `PTransform` that takes an input `PCollection<Integer>` and returns a `PCollection<Integer>` whose contents is a single value that is the minimum of the input `PCollection`'s elements, or `Integer.MAX_VALUE` if there are no elements.

#### integersPerKey

    public static <K> Combine.PerKey<K,Integer,Integer> integersPerKey()

Returns a `PTransform` that takes an input `PCollection<KV<K, Integer>>` and returns a `PCollection<KV<K, Integer>>` that contains an output element mapping each distinct key in the input `PCollection` to the minimum of the values associated with that key in the input `PCollection`.

See `Combine.PerKey` for how this affects timestamps and windowing.

#### longsGlobally

    public static Combine.Globally<Long,Long> longsGlobally()

Returns a `PTransform` that takes an input `PCollection<Long>` and returns a `PCollection<Long>` whose contents is the minimum of the input `PCollection`'s elements, or `Long.MAX_VALUE` if there are no elements.

#### longsPerKey

    public static <K> Combine.PerKey<K,Long,Long> longsPerKey()

Returns a `PTransform` that takes an input `PCollection<KV<K, Long>>` and returns a `PCollection<KV<K, Long>>` that contains an output element mapping each distinct key in the input `PCollection` to the minimum of the values associated with that key in the input `PCollection`.

See `Combine.PerKey` for how this affects timestamps and windowing.

#### doublesGlobally

    public static Combine.Globally<Double,Double> doublesGlobally()

Returns a `PTransform` that takes an input `PCollection<Double>` and returns a `PCollection<Double>` whose contents is the minimum of the input `PCollection`'s elements, or `Double.POSITIVE_INFINITY` if there are no elements.

#### doublesPerKey

    public static <K> Combine.PerKey<K,Double,Double> doublesPerKey()

Returns a `PTransform` that takes an input `PCollection<KV<K, Double>>` and returns a `PCollection<KV<K, Double>>` that contains an output element mapping each distinct key in the input `PCollection` to the minimum of the values associated with that key in the input `PCollection`.

See `Combine.PerKey` for how this affects timestamps and windowing.

#### globally

    public static <T extends Comparable<? super T>> Combine.Globally<T,T> globally()

Returns a `PTransform` that takes an input `PCollection<T>` and returns a `PCollection<T>` whose contents is the minimum according to the natural ordering of `T` of the input `PCollection`'s elements, or `null` if there are no elements.

#### perKey

    public static <K,T extends Comparable<? super T>> Combine.PerKey<K,T,T> perKey()

Returns a `PTransform` that takes an input `PCollection<KV<K, T>>` and returns a `PCollection<KV<K, T>>` that contains an output element mapping each distinct key in the input `PCollection` to the minimum according to the natural ordering of `T` of the values associated with that key in the input `PCollection`.

See `Combine.PerKey` for how this affects timestamps and windowing.

#### globally

    public static <T,ComparatorT extends Comparator<? super T> & Serializable> Combine.Globally<T,T> globally(ComparatorT comparator)

Returns a `PTransform` that takes an input `PCollection<T>` and returns a `PCollection<T>` whose contents is the minimum of the input `PCollection`'s elements, or `null` if there are no elements.

#### perKey

    public static <K,T,ComparatorT extends Comparator<? super T> & Serializable> Combine.PerKey<K,T,T> perKey(ComparatorT comparator)

Returns a `PTransform` that takes an input `PCollection<KV<K, T>>` and returns a `PCollection<KV<K, T>>` that contains one output element per key mapping each to the minimum of the values associated with that key in the input `PCollection`.

See `Combine.PerKey` for how this affects timestamps and windowing.