Clemens Valiente
07/10/2024, 3:09 AMD. Draco O'Brien
07/10/2024, 8:16 AMD. Draco O'Brien
07/10/2024, 8:17 AMD. Draco O'Brien
07/10/2024, 8:19 AMpublic class MyProcessFunction extends KeyedProcessFunction<Key, InputType, OutputType> {
@Override
public void processElement(InputType value, Context ctx, Collector<OutputType> out) {
// register a timer to fire at the next watermark
long timestamp = ctx.timestamp();
ctx.timerService().registerEventTimeTimer(ctx.timerService().currentWatermark() + 1);
}
@Override
public void onTimer(long timestamp, OnTimerContext ctx, Collector<OutputType> out) {
// called when the timer fires, effectively at the watermark you set
// access the current watermark via ctx.timerService().currentWatermark()
}
}D. Draco O'Brien
07/10/2024, 8:24 AM