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 class
Coder forWindowedValue
.static class
A parameterized coder forWindowedValue
.static interface
AWindowedValues
which holds exactly single window per value.static class
Deprecated.Use ParamWindowedValueCoder instead, it is a general purpose implementation of the same concept but makes timestamp, windows and pane info configurable.static class
Abstract class forWindowedValue
coder. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
equals
(@Nullable WindowedValue<T> left, @Nullable WindowedValue<T> right) static <T> WindowedValues.FullWindowedValueCoder
<T> getFullCoder
(Coder<T> valueCoder, Coder<? extends BoundedWindow> windowCoder) Returns theCoder
to use for aWindowedValue<T>
, using the given valueCoder and windowCoder.static <T> WindowedValues.ParamWindowedValueCoder
<T> getParamWindowedValueCoder
(Coder<T> valueCoder) Returns theParamWindowedValueCoder
from the given valueCoder.static <T> WindowedValues.ValueOnlyWindowedValueCoder
<T> getValueOnlyCoder
(Coder<T> valueCoder) Returns theValueOnlyCoder
from the given valueCoder.static <T> int
hashCode
(WindowedValue<T> windowedValue) static <T> WindowedValue
<T> of
(T value, Instant timestamp, Collection<? extends BoundedWindow> windows, PaneInfo paneInfo) Returns aWindowedValue
with the given value, timestamp, and windows.static <T> WindowedValue
<T> of
(T value, Instant timestamp, BoundedWindow window, PaneInfo paneInfo) Returns aWindowedValue
with the given value, timestamp, and window.static <T> WindowedValue
<T> timestampedValueInGlobalWindow
(T value, Instant timestamp) Returns aWindowedValue
with the given value and timestamp,GlobalWindow
and default pane.static <T> WindowedValue
<T> timestampedValueInGlobalWindow
(T value, Instant timestamp, PaneInfo paneInfo) Returns aWindowedValue
with the given value, timestamp, and pane in theGlobalWindow
.static <T> WindowedValue
<T> valueInGlobalWindow
(T value) Returns aWindowedValue
with the given value in theGlobalWindow
using the default timestamp and pane.static <T> WindowedValue
<T> valueInGlobalWindow
(T value, PaneInfo paneInfo) Returns aWindowedValue
with the given value in theGlobalWindow
using the default timestamp and the specified pane.static <OldT,
NewT>
WindowedValue<NewT> withValue
(WindowedValue<OldT> windowedValue, NewT newValue) Returns a newWindowedValue
that is a copy of this one, but with a different value, which may have a new typeNewT
.
-
Method Details
-
of
public static <T> WindowedValue<T> of(T value, Instant timestamp, Collection<? extends BoundedWindow> windows, PaneInfo paneInfo) Returns aWindowedValue
with the given value, timestamp, and windows. -
of
public static <T> WindowedValue<T> of(T value, Instant timestamp, BoundedWindow window, PaneInfo paneInfo) Returns aWindowedValue
with the given value, timestamp, and window. -
valueInGlobalWindow
Returns aWindowedValue
with the given value in theGlobalWindow
using the default timestamp and pane. -
valueInGlobalWindow
Returns aWindowedValue
with the given value in theGlobalWindow
using the default timestamp and the specified pane. -
timestampedValueInGlobalWindow
Returns aWindowedValue
with the given value and timestamp,GlobalWindow
and default pane. -
timestampedValueInGlobalWindow
public static <T> WindowedValue<T> timestampedValueInGlobalWindow(T value, Instant timestamp, PaneInfo paneInfo) Returns aWindowedValue
with the given value, timestamp, and pane in theGlobalWindow
. -
withValue
public static <OldT,NewT> WindowedValue<NewT> withValue(WindowedValue<OldT> windowedValue, NewT newValue) Returns a newWindowedValue
that 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 theCoder
to use for aWindowedValue<T>
, using the given valueCoder and windowCoder. -
getValueOnlyCoder
public static <T> WindowedValues.ValueOnlyWindowedValueCoder<T> getValueOnlyCoder(Coder<T> valueCoder) Returns theValueOnlyCoder
from the given valueCoder. -
getParamWindowedValueCoder
public static <T> WindowedValues.ParamWindowedValueCoder<T> getParamWindowedValueCoder(Coder<T> valueCoder) Returns theParamWindowedValueCoder
from the given valueCoder.
-