public interface WatermarkPolicy
Watermark
given the
event timestamps as they occur for a single input stream. Typically the
watermark will be advanced with a fixed lag
behind the top observed timestamp so far.
This object is used by source processors to determine the current watermark. The processor may choose to create several of these objects to track each source partition separately and each processor will also have their own instance. The implementation does not need to be thread-safe.
EventTimePolicy
,
EventTimeMapper
Modifier and Type | Method and Description |
---|---|
long |
getCurrentWatermark()
Called to get the current watermark.
|
static SupplierEx<WatermarkPolicy> |
limitingLag(long lag)
Maintains a watermark that lags behind the top observed timestamp by the
given amount.
|
static SupplierEx<WatermarkPolicy> |
limitingRealTimeLag(long lag)
Maintains a watermark that lags behind the real time by the given
amount.
|
void |
reportEvent(long timestamp)
Called to report the observation of an event with the given timestamp.
|
void reportEvent(long timestamp)
getCurrentWatermark()
should reflect this.timestamp
- event's timestamplong getCurrentWatermark()
@Nonnull static SupplierEx<WatermarkPolicy> limitingLag(long lag)
Note: if Jet stops receiving events at some point (e.g., at the end of a business day), the watermark will stop advancing and stay behind the most recent events. Jet will not output the results of aggregating these events until it starts receiving events again (e.g., at the start of the next business day).
lag
- the desired difference between the top observed timestamp
and the watermark@Nonnull static SupplierEx<WatermarkPolicy> limitingRealTimeLag(long lag)
lag
- the desired difference between the top observed timestamp
and the watermarkCopyright © 2024 Hazelcast, Inc.. All rights reserved.