Package org.apache.beam.sdk.values
Class WindowedValues
java.lang.Object
org.apache.beam.sdk.values.WindowedValues
Implementations of
WindowedValue and static utility methods.
These are primarily intended for internal use by Beam SDK developers and runner developers. Backwards incompatible changes will likely occur.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classCoder forWindowedValue.static classA parameterized coder forWindowedValue.static interfaceAWindowedValueswhich holds exactly single window per value.static classDeprecated.Use ParamWindowedValueCoder instead, it is a general purpose implementation of the same concept but makes timestamp, windows and pane info configurable.static classAbstract class forWindowedValuecoder. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> WindowedValues.Builder<T> builder()static <T> WindowedValues.Builder<T> builder(WindowedValue<T> template) Create a Builder that takes element metadata from the provideed delegate.static <T> booleanequals(@Nullable WindowedValue<T> left, @Nullable WindowedValue<T> right) static <T> WindowedValues.FullWindowedValueCoder<T> getFullCoder(Coder<T> valueCoder, Coder<? extends BoundedWindow> windowCoder) Returns theCoderto use for aWindowedValue<T>, using the given valueCoder and windowCoder.static <T> WindowedValues.ParamWindowedValueCoder<T> getParamWindowedValueCoder(Coder<T> valueCoder) Returns theParamWindowedValueCoderfrom the given valueCoder.static <T> WindowedValues.ValueOnlyWindowedValueCoder<T> getValueOnlyCoder(Coder<T> valueCoder) Returns theValueOnlyCoderfrom the given valueCoder.static <T> inthashCode(WindowedValue<T> windowedValue) static <T> WindowedValue<T> of(T value, Instant timestamp, Collection<? extends BoundedWindow> windows, PaneInfo paneInfo) static <T> WindowedValue<T> of(T value, Instant timestamp, Collection<? extends BoundedWindow> windows, PaneInfo paneInfo, @Nullable String currentRecordId, @Nullable Long currentRecordOffset) Returns aWindowedValuewith the given value, timestamp, and windows.static <T> WindowedValue<T> of(T value, Instant timestamp, BoundedWindow window, PaneInfo paneInfo) Returns aWindowedValuewith the given value, timestamp, and window.static <T> WindowedValue<T> timestampedValueInGlobalWindow(T value, Instant timestamp) Returns aWindowedValuewith the given value and timestamp,GlobalWindowand default pane.static <T> WindowedValue<T> timestampedValueInGlobalWindow(T value, Instant timestamp, PaneInfo paneInfo) Returns aWindowedValuewith the given value, timestamp, and pane in theGlobalWindow.static <T> WindowedValue<T> valueInGlobalWindow(T value) Returns aWindowedValuewith the given value in theGlobalWindowusing the default timestamp and pane.static <T> WindowedValue<T> valueInGlobalWindow(T value, PaneInfo paneInfo) Returns aWindowedValuewith the given value in theGlobalWindowusing the default timestamp and the specified pane.static <OldT,NewT>
WindowedValue<NewT> withValue(WindowedValue<OldT> windowedValue, NewT newValue) Returns a newWindowedValuethat is a copy of this one, but with a different value, which may have a new typeNewT.
-
Method Details
-
builder
-
builder
Create a Builder that takes element metadata from the provideed delegate. -
of
public static <T> WindowedValue<T> of(T value, Instant timestamp, Collection<? extends BoundedWindow> windows, PaneInfo paneInfo) -
of
public static <T> WindowedValue<T> of(T value, Instant timestamp, Collection<? extends BoundedWindow> windows, PaneInfo paneInfo, @Nullable String currentRecordId, @Nullable Long currentRecordOffset) Returns aWindowedValuewith the given value, timestamp, and windows. -
of
public static <T> WindowedValue<T> of(T value, Instant timestamp, BoundedWindow window, PaneInfo paneInfo) Returns aWindowedValuewith the given value, timestamp, and window. -
valueInGlobalWindow
Returns aWindowedValuewith the given value in theGlobalWindowusing the default timestamp and pane. -
valueInGlobalWindow
Returns aWindowedValuewith the given value in theGlobalWindowusing the default timestamp and the specified pane. -
timestampedValueInGlobalWindow
Returns aWindowedValuewith the given value and timestamp,GlobalWindowand default pane. -
timestampedValueInGlobalWindow
public static <T> WindowedValue<T> timestampedValueInGlobalWindow(T value, Instant timestamp, PaneInfo paneInfo) Returns aWindowedValuewith the given value, timestamp, and pane in theGlobalWindow. -
withValue
public static <OldT,NewT> WindowedValue<NewT> withValue(WindowedValue<OldT> windowedValue, NewT newValue) Returns a newWindowedValuethat is a copy of this one, but with a different value, which may have a new typeNewT. -
equals
-
hashCode
-
getFullCoder
public static <T> WindowedValues.FullWindowedValueCoder<T> getFullCoder(Coder<T> valueCoder, Coder<? extends BoundedWindow> windowCoder) Returns theCoderto use for aWindowedValue<T>, using the given valueCoder and windowCoder. -
getValueOnlyCoder
public static <T> WindowedValues.ValueOnlyWindowedValueCoder<T> getValueOnlyCoder(Coder<T> valueCoder) Returns theValueOnlyCoderfrom the given valueCoder. -
getParamWindowedValueCoder
public static <T> WindowedValues.ParamWindowedValueCoder<T> getParamWindowedValueCoder(Coder<T> valueCoder) Returns theParamWindowedValueCoderfrom the given valueCoder.
-