com.google.cloud.dataflow.sdk.transforms.windowing

## Class OutputTimeFns

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.windowing.OutputTimeFns

    @Experimental(value=OUTPUT_TIME)
    public class OutputTimeFns
    extends Object

(Experimental) Static utility methods and provided implementations for `OutputTimeFn`.

### Constructor Summary

Constructors
Constructor and Description
`OutputTimeFns()`

### Method Summary

All Methods Static Methods Concrete Methods
`static Instant` `combineOutputTimes(OutputTimeFn<?> outputTimeFn, Iterable<? extends Instant> outputTimes)` Applies the given `OutputTimeFn` to the given output times, obtaining the output time for a value computed.
`static OutputTimeFn<BoundedWindow>` `outputAtEarliestInputTimestamp()` The policy of outputting at the earliest of the input timestamps for non-late input data that led to a computed value.
`static OutputTimeFn<BoundedWindow>` `outputAtEndOfWindow()` The policy of outputting with timestamps at the end of the window.
`static OutputTimeFn<BoundedWindow>` `outputAtLatestInputTimestamp()` The policy of holding the watermark to the latest of the input timestamps for non-late input data that led to a computed value.

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

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

### Constructor Detail

#### OutputTimeFns

    public OutputTimeFns()

### Method Detail

#### outputAtEarliestInputTimestamp

    public static OutputTimeFn<BoundedWindow> outputAtEarliestInputTimestamp()

The policy of outputting at the earliest of the input timestamps for non-late input data that led to a computed value.

For example, suppose v1 through vn are all on-time elements being aggregated via some function `f` into `f`(v1, ..., vn. When emitted, the output timestamp of the result will be the earliest of the event time timestamps

If data arrives late, it has no effect on the output timestamp.

#### outputAtLatestInputTimestamp

    public static OutputTimeFn<BoundedWindow> outputAtLatestInputTimestamp()

The policy of holding the watermark to the latest of the input timestamps for non-late input data that led to a computed value.

For example, suppose v1 through vn are all on-time elements being aggregated via some function `f` into `f`(v1, ..., vn. When emitted, the output timestamp of the result will be the latest of the event time timestamps

If data arrives late, it has no effect on the output timestamp.

#### outputAtEndOfWindow

    public static OutputTimeFn<BoundedWindow> outputAtEndOfWindow()

The policy of outputting with timestamps at the end of the window.

Note that this output timestamp depends only on the window. See {#link dependsOnlyOnWindow()}.

When windows merge, instead of using `OutputTimeFn.combine(org.joda.time.Instant, org.joda.time.Instant)` to obtain an output timestamp for the results in the new window, it is mandatory to obtain a new output timestamp from `OutputTimeFn.assignOutputTime(org.joda.time.Instant, W)` with the new window and an arbitrary timestamp (because it is guaranteed that the timestamp is irrelevant).

For non-merging window functions, this `OutputTimeFn` works transparently.

#### combineOutputTimes

    public static Instant combineOutputTimes(OutputTimeFn<?> outputTimeFn,
                                             Iterable<? extends Instant> outputTimes)

Applies the given `OutputTimeFn` to the given output times, obtaining the output time for a value computed. See `OutputTimeFn.combine(org.joda.time.Instant, org.joda.time.Instant)` for a full specification.

Throws:
  `IllegalArgumentException` - if `outputTimes` is empty.