Class WatermarkEstimators.MonotonicallyIncreasing
java.lang.Object
org.apache.beam.sdk.transforms.splittabledofn.WatermarkEstimators.MonotonicallyIncreasing
- All Implemented Interfaces:
TimestampObservingWatermarkEstimator<Instant>
,WatermarkEstimator<Instant>
- Enclosing class:
WatermarkEstimators
public static class WatermarkEstimators.MonotonicallyIncreasing
extends Object
implements TimestampObservingWatermarkEstimator<Instant>
A watermark estimator that observes timestamps of records output from a DoFn reporting the
timestamp of the last element seen as the current watermark.
Note that this watermark estimator expects output timestamps in monotonically increasing order. If they are not, then the watermark will advance based upon the last observed timestamp as long as it is greater then any previously reported watermark.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn estimated output watermark.getState()
Get current state of theWatermarkEstimator
instance, which can be used to recreate theWatermarkEstimator
when processing the restriction.void
observeTimestamp
(Instant timestamp) Update watermark estimate with latest output timestamp.
-
Constructor Details
-
MonotonicallyIncreasing
-
-
Method Details
-
observeTimestamp
Description copied from interface:TimestampObservingWatermarkEstimator
Update watermark estimate with latest output timestamp. This is called with the timestamp of every element output from the DoFn.- Specified by:
observeTimestamp
in interfaceTimestampObservingWatermarkEstimator<Instant>
-
currentWatermark
Description copied from interface:WatermarkEstimator
Return estimated output watermark. This method must return monotonically increasing watermarks across instances that are constructed from prior state.- Specified by:
currentWatermark
in interfaceWatermarkEstimator<Instant>
-
getState
Description copied from interface:WatermarkEstimator
Get current state of theWatermarkEstimator
instance, which can be used to recreate theWatermarkEstimator
when processing the restriction. SeeDoFn.NewWatermarkEstimator
for additional details.The internal state of the estimator must not be mutated by this method.
The state returned must not be mutated.
- Specified by:
getState
in interfaceWatermarkEstimator<Instant>
-