Class SnapshotWindowFn

All Implemented Interfaces:
Serializable, HasDisplayData

public class SnapshotWindowFn extends NonMergingWindowFn<Object,IntervalWindow>
A WindowFn that assigns each element to a 1-millisecond IntervalWindow anchored at the element's event timestamp.

We set the element's timestamp as its snapshot commit timestamp. All tasks/records from the same snapshot land in the same window.

With the per-snapshot watermark from WatchForSnapshotsSdf, the CoGroupByKey fires when a snapshot is fully drained. The watermark advances past the snapshot's commit time only after every downstream stage has finished processing that snapshot's records.

Two snapshots committed within the same millisecond may collapse into the same window. But that's okay because ReadFromChangelogs includes snapshot sequence number in the key before routing to the CoGBK, so it won't produce incorrect joins.

See Also: