Google Cloud Dataflow SDK for Java, version 1.9.1
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 forOutputTimeFn
.
-
-
Constructor Summary
Constructors Constructor and Description OutputTimeFns()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static Instant
combineOutputTimes(OutputTimeFn<?> outputTimeFn, Iterable<? extends Instant> outputTimes)
Applies the givenOutputTimeFn
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.
-
-
-
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
intof
(v1, ..., vn. When emitted, the output timestamp of the result will be the earliest of the event time timestampsIf 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
intof
(v1, ..., vn. When emitted, the output timestamp of the result will be the latest of the event time timestampsIf 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 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 fromOutputTimeFn.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 givenOutputTimeFn
to the given output times, obtaining the output time for a value computed. SeeOutputTimeFn.combine(org.joda.time.Instant, org.joda.time.Instant)
for a full specification.- Throws:
IllegalArgumentException
- ifoutputTimes
is empty.
-
-