Class WatermarkTracker
- java.lang.Object
-
- org.apache.flink.streaming.connectors.kinesis.util.WatermarkTracker
-
- All Implemented Interfaces:
Closeable,Serializable,AutoCloseable
- Direct Known Subclasses:
JobManagerWatermarkTracker
@PublicEvolving public abstract class WatermarkTracker extends Object implements Closeable, Serializable
The watermark tracker is responsible for aggregating watermarks across distributed operators.It can be used for sub tasks of a single Flink source as well as multiple heterogeneous sources or other operators.
The class essentially functions like a distributed hash table that enclosing operators can use to adopt their processing / IO rates.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classWatermarkTracker.WatermarkStateWatermark state.
-
Field Summary
Fields Modifier and Type Field Description static longDEFAULT_UPDATE_TIMEOUT_MILLIS
-
Constructor Summary
Constructors Constructor Description WatermarkTracker()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected longgetCurrentTime()protected StringgetSubtaskId()abstract longgetUpdateTimeoutCount()protected longgetUpdateTimeoutMillis()voidopen(org.apache.flink.api.common.functions.RuntimeContext context)voidsetUpdateTimeoutMillis(long updateTimeoutMillis)Subtasks that have not provided a watermark update within the configured interval will be considered idle and excluded from target watermark calculation.abstract longupdateWatermark(long localWatermark)Set the current watermark of the owning subtask and return the global low watermark based on the current state snapshot.
-
-
-
Field Detail
-
DEFAULT_UPDATE_TIMEOUT_MILLIS
public static final long DEFAULT_UPDATE_TIMEOUT_MILLIS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSubtaskId
protected String getSubtaskId()
-
getUpdateTimeoutMillis
protected long getUpdateTimeoutMillis()
-
getUpdateTimeoutCount
public abstract long getUpdateTimeoutCount()
-
setUpdateTimeoutMillis
public void setUpdateTimeoutMillis(long updateTimeoutMillis)
Subtasks that have not provided a watermark update within the configured interval will be considered idle and excluded from target watermark calculation.- Parameters:
updateTimeoutMillis-
-
updateWatermark
public abstract long updateWatermark(long localWatermark)
Set the current watermark of the owning subtask and return the global low watermark based on the current state snapshot. Periodically called by the enclosing consumer instance, which is responsible for any timer management etc.- Parameters:
localWatermark-- Returns:
-
getCurrentTime
protected long getCurrentTime()
-
open
public void open(org.apache.flink.api.common.functions.RuntimeContext context)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-