Class PaneInfo
java.lang.Object
org.apache.beam.sdk.transforms.windowing.PaneInfo
Provides information about the pane an element belongs to. Every pane is implicitly associated
with a window. Panes are observable only via the
DoFn.ProcessContext.pane() method of the
context passed to a DoFn.ProcessElement method.
Note: This does not uniquely identify a pane, and should not be used for comparisons.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA Coder for encoding PaneInfo instances.static enumEnumerates the possibilities for the timing of this pane firing related to the input and output watermarks for its computation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PaneInfoPaneInfoto use for elements on (and before) initial window assignment (including elements read from sources) before they have passed through aGroupByKeyand are associated with a particular trigger firing.static final PaneInfoPaneInfoto use when there will be exactly one firing and it is on time. -
Method Summary
Modifier and TypeMethodDescriptionstatic PaneInfocreatePane(boolean isFirst, boolean isLast, PaneInfo.Timing timing) static PaneInfocreatePane(boolean isFirst, boolean isLast, PaneInfo.Timing timing, long index, long onTimeIndex) Factory method to create aPaneInfowith the specified parameters.static PaneInfocreatePane(boolean isFirst, boolean isLast, PaneInfo.Timing timing, long index, long onTimeIndex, boolean containsElementMetadata) Factory method to create aPaneInfowith the specified parameters.static PaneInfodecodePane(byte encodedPane) booleanlonggetIndex()The zero-based index of this trigger firing that produced this pane.longThe zero-based index of this trigger firing among non-speculative panes.Return the timing of this pane.inthashCode()booleanbooleanisFirst()Return true if this is the first pane produced for the associated window.booleanisLast()Return true if this is the last pane that will be produced in the associated window.booleanReturn true if there is no timing information for the currentPaneInfo.toString()withElementMetadata(boolean elementMetadata)
-
Field Details
-
NO_FIRING
PaneInfoto use for elements on (and before) initial window assignment (including elements read from sources) before they have passed through aGroupByKeyand are associated with a particular trigger firing. -
ON_TIME_AND_ONLY_FIRING
PaneInfoto use when there will be exactly one firing and it is on time.
-
-
Method Details
-
createPane
-
createPane
public static PaneInfo createPane(boolean isFirst, boolean isLast, PaneInfo.Timing timing, long index, long onTimeIndex) Factory method to create aPaneInfowith the specified parameters. -
createPane
public static PaneInfo createPane(boolean isFirst, boolean isLast, PaneInfo.Timing timing, long index, long onTimeIndex, boolean containsElementMetadata) Factory method to create aPaneInfowith the specified parameters. -
decodePane
-
isUnknown
public boolean isUnknown()Return true if there is no timing information for the currentPaneInfo. This typically indicates that the current element has not been assigned to windows or passed through an operation that executes triggers yet. -
isFirst
public boolean isFirst()Return true if this is the first pane produced for the associated window. -
isElementMetadata
public boolean isElementMetadata() -
withElementMetadata
-
isLast
public boolean isLast()Return true if this is the last pane that will be produced in the associated window. -
getTiming
Return the timing of this pane. -
getIndex
public long getIndex()The zero-based index of this trigger firing that produced this pane.This will return 0 for the first time the timer fires, 1 for the next time, etc.
A given (key, window, pane-index) is guaranteed to be unique in the output of a group-by-key operation.
-
getNonSpeculativeIndex
public long getNonSpeculativeIndex()The zero-based index of this trigger firing among non-speculative panes.This will return 0 for the first non-
PaneInfo.Timing.EARLYtimer firing, 1 for the next one, etc.Always -1 for speculative data.
-
hashCode
public int hashCode() -
equals
-
toString
-