Class SnapshotWindowFn
java.lang.Object
org.apache.beam.sdk.transforms.windowing.WindowFn<Object,IntervalWindow>
org.apache.beam.sdk.transforms.windowing.NonMergingWindowFn<Object,IntervalWindow>
org.apache.beam.sdk.io.iceberg.cdc.SnapshotWindowFn
- All Implemented Interfaces:
Serializable,HasDisplayData
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.windowing.WindowFn
WindowFn.AssignContext, WindowFn.MergeContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGiven a timestamp and element, returns the set of windows into which it should be placed.booleanReturns the defaultWindowMappingFnto use to map main input windows to side input windows.inthashCode()booleanisCompatible(WindowFn<?, ?> other) Returns whether this performs the same merging as the givenWindowFn.Returns theCoderused for serializing the windows used by this windowFn.Methods inherited from class org.apache.beam.sdk.transforms.windowing.NonMergingWindowFn
isNonMerging, mergeWindowsMethods inherited from class org.apache.beam.sdk.transforms.windowing.WindowFn
assignsToOneWindow, getWindowTypeDescriptor, populateDisplayData, verifyCompatibility
-
Constructor Details
-
SnapshotWindowFn
public SnapshotWindowFn()
-
-
Method Details
-
assignWindows
Description copied from class:WindowFnGiven a timestamp and element, returns the set of windows into which it should be placed.- Specified by:
assignWindowsin classWindowFn<Object,IntervalWindow>
-
isCompatible
Description copied from class:WindowFnReturns whether this performs the same merging as the givenWindowFn.- Specified by:
isCompatiblein classWindowFn<Object,IntervalWindow>
-
windowCoder
Description copied from class:WindowFnReturns theCoderused for serializing the windows used by this windowFn.- Specified by:
windowCoderin classWindowFn<Object,IntervalWindow>
-
getDefaultWindowMappingFn
Description copied from class:WindowFnReturns the defaultWindowMappingFnto use to map main input windows to side input windows. This should accept arbitrary main input windows, and produce aBoundedWindowthat can be produced by thisWindowFn.- Specified by:
getDefaultWindowMappingFnin classWindowFn<Object,IntervalWindow>
-
equals
-
hashCode
public int hashCode()
-