public interface Watermark
Watermark represents a checkpoint in data processing, and indicates that all data up to specific point has
been pulled from some source. Implementations of this interface are responsible for defining data structures in order
to track this state.
A Watermark will be serialized in WorkUnits and
WorkUnitStates. The toJson() method will be used to serialize the
Watermark into a JsonElement.
| Modifier and Type | Method and Description |
|---|---|
short |
calculatePercentCompletion(Watermark lowWatermark,
Watermark highWatermark)
This method must return a value from [0, 100].
|
com.google.gson.JsonElement |
toJson()
Convert this
Watermark into a JsonElement. |
com.google.gson.JsonElement toJson()
Watermark into a JsonElement.JsonElement representing this Watermark.short calculatePercentCompletion(Watermark lowWatermark, Watermark highWatermark)
Watermark values, where the lowWatermark is the starting point, and the highWatermark is the goal, what
is the percent completion of this Watermark.lowWatermark - is the starting Watermark for the percent completion calculation. So if this.equals(lowWatermark) is true, this method should return 0.highWatermark - is the end value Watermark for the percent completion calculation. So if this.equals(highWatermark) is true, this method should return 100.Watermark.