W - The kind of BoundedWindow the hold is for.public class WatermarkHold<W extends BoundedWindow> extends Object implements Serializable
| Constructor and Description |
|---|
WatermarkHold(WindowingStrategy<?,W> windowingStrategy) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHold(ReduceFn.ProcessValueContext c,
boolean isLate)
Update the watermark hold to include the timestamp of the value in
c. |
StateContents<org.joda.time.Instant> |
extractAndRelease(ReduceFn.Context c)
Get information from the watermark hold for outputting.
|
void |
holdForFinal(ReduceFn.Context c) |
void |
holdForOnTime(ReduceFn.Context c) |
void |
releaseFinal(ReduceFn.Context c) |
void |
releaseOnTime(ReduceFn.Context c) |
public WatermarkHold(WindowingStrategy<?,W> windowingStrategy)
public void addHold(ReduceFn.ProcessValueContext c, boolean isLate)
c.
If the value was not late, then the input watermark must be less than the timestamp, and we
can use WindowFn.getOutputTime(org.joda.time.Instant, W) to determine the appropriate output time.
If the value was late, we pessimistically assume the worst and attempt to hold the watermark
to BoundedWindow.maxTimestamp() plus WindowingStrategy.getAllowedLateness().
That allows us to output the result at BoundedWindow.maxTimestamp() without being
dropped.
public StateContents<org.joda.time.Instant> extractAndRelease(ReduceFn.Context c)
The output timestamp is the minimum of getOutputTimestamp applied to the non-late elements that arrived in the current pane.
public void holdForOnTime(ReduceFn.Context c)
public void holdForFinal(ReduceFn.Context c)
public void releaseOnTime(ReduceFn.Context c)
public void releaseFinal(ReduceFn.Context c)