Class WatermarkEstimators.MonotonicallyIncreasing
- java.lang.Object
-
- org.apache.beam.sdk.transforms.splittabledofn.WatermarkEstimators.MonotonicallyIncreasing
-
- All Implemented Interfaces:
TimestampObservingWatermarkEstimator<org.joda.time.Instant>
,WatermarkEstimator<org.joda.time.Instant>
- Enclosing class:
- WatermarkEstimators
public static class WatermarkEstimators.MonotonicallyIncreasing extends java.lang.Object implements TimestampObservingWatermarkEstimator<org.joda.time.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 Constructor Description MonotonicallyIncreasing(org.joda.time.Instant watermark)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.joda.time.Instant
currentWatermark()
Return estimated output watermark.org.joda.time.Instant
getState()
Get current state of theWatermarkEstimator
instance, which can be used to recreate theWatermarkEstimator
when processing the restriction.void
observeTimestamp(org.joda.time.Instant timestamp)
Update watermark estimate with latest output timestamp.
-
-
-
Method Detail
-
observeTimestamp
public void observeTimestamp(org.joda.time.Instant timestamp)
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<org.joda.time.Instant>
-
currentWatermark
public org.joda.time.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<org.joda.time.Instant>
-
getState
public org.joda.time.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<org.joda.time.Instant>
-
-