T
- the type of the value@Internal public abstract class WindowedValue<T> extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
WindowedValue.FullWindowedValueCoder<T>
Coder for
WindowedValue . |
static class |
WindowedValue.ParamWindowedValueCoder<T>
A parameterized coder for
WindowedValue . |
static interface |
WindowedValue.SingleWindowedValue
A
WindowedValue which holds exactly single window per value. |
static class |
WindowedValue.ValueOnlyWindowedValueCoder<T>
Deprecated.
Use ParamWindowedValueCoder instead, it is a general purpose implementation of the
same concept but makes timestamp, windows and pane info configurable.
|
static class |
WindowedValue.WindowedValueCoder<T>
Abstract class for
WindowedValue coder. |
Constructor and Description |
---|
WindowedValue() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(@Nullable java.lang.Object other) |
java.lang.Iterable<WindowedValue<T>> |
explodeWindows()
Returns a collection of
WindowedValues identical to this one, except each
is in exactly one of the windows that this WindowedValue is in. |
static <T> WindowedValue.FullWindowedValueCoder<T> |
getFullCoder(Coder<T> valueCoder,
Coder<? extends BoundedWindow> windowCoder)
Returns the
Coder to use for a WindowedValue<T> , using the given valueCoder and
windowCoder. |
abstract PaneInfo |
getPane()
Returns the pane of this
WindowedValue in its window. |
static <T> WindowedValue.ParamWindowedValueCoder<T> |
getParamWindowedValueCoder(Coder<T> valueCoder)
Returns the
ParamWindowedValueCoder from the given valueCoder. |
abstract org.joda.time.Instant |
getTimestamp()
Returns the timestamp of this
WindowedValue . |
abstract T |
getValue()
Returns the value of this
WindowedValue . |
static <T> WindowedValue.ValueOnlyWindowedValueCoder<T> |
getValueOnlyCoder(Coder<T> valueCoder)
Returns the
ValueOnlyCoder from the given valueCoder. |
abstract java.util.Collection<? extends BoundedWindow> |
getWindows()
Returns the windows of this
WindowedValue . |
int |
hashCode() |
boolean |
isSingleWindowedValue()
Returns
true if this WindowedValue has exactly one window. |
static <T> WindowedValue<T> |
of(T value,
org.joda.time.Instant timestamp,
BoundedWindow window,
PaneInfo pane)
Returns a
WindowedValue with the given value, timestamp, and window. |
static <T> WindowedValue<T> |
of(T value,
org.joda.time.Instant timestamp,
java.util.Collection<? extends BoundedWindow> windows,
PaneInfo pane)
Returns a
WindowedValue with the given value, timestamp, and windows. |
static <T> WindowedValue<T> |
timestampedValueInGlobalWindow(T value,
org.joda.time.Instant timestamp)
Returns a
WindowedValue with the given value and timestamp, GlobalWindow and
default pane. |
static <T> WindowedValue<T> |
timestampedValueInGlobalWindow(T value,
org.joda.time.Instant timestamp,
PaneInfo paneInfo)
Returns a
WindowedValue with the given value, timestamp, and pane in the GlobalWindow . |
abstract java.lang.String |
toString() |
static <T> WindowedValue<T> |
valueInGlobalWindow(T value)
Returns a
WindowedValue with the given value in the GlobalWindow using the
default timestamp and pane. |
static <T> WindowedValue<T> |
valueInGlobalWindow(T value,
PaneInfo pane)
Returns a
WindowedValue with the given value in the GlobalWindow using the
default timestamp and the specified pane. |
abstract <NewT> WindowedValue<NewT> |
withValue(NewT value)
Returns a new
WindowedValue that is a copy of this one, but with a different value,
which may have a new type NewT . |
public static <T> WindowedValue<T> of(T value, org.joda.time.Instant timestamp, java.util.Collection<? extends BoundedWindow> windows, PaneInfo pane)
WindowedValue
with the given value, timestamp, and windows.public static <T> WindowedValue<T> of(T value, org.joda.time.Instant timestamp, BoundedWindow window, PaneInfo pane)
WindowedValue
with the given value, timestamp, and window.public static <T> WindowedValue<T> valueInGlobalWindow(T value)
WindowedValue
with the given value in the GlobalWindow
using the
default timestamp and pane.public static <T> WindowedValue<T> valueInGlobalWindow(T value, PaneInfo pane)
WindowedValue
with the given value in the GlobalWindow
using the
default timestamp and the specified pane.public static <T> WindowedValue<T> timestampedValueInGlobalWindow(T value, org.joda.time.Instant timestamp)
WindowedValue
with the given value and timestamp, GlobalWindow
and
default pane.public static <T> WindowedValue<T> timestampedValueInGlobalWindow(T value, org.joda.time.Instant timestamp, PaneInfo paneInfo)
WindowedValue
with the given value, timestamp, and pane in the GlobalWindow
.public abstract <NewT> WindowedValue<NewT> withValue(NewT value)
WindowedValue
that is a copy of this one, but with a different value,
which may have a new type NewT
.public abstract T getValue()
WindowedValue
.public abstract org.joda.time.Instant getTimestamp()
WindowedValue
.public abstract java.util.Collection<? extends BoundedWindow> getWindows()
WindowedValue
.public abstract PaneInfo getPane()
WindowedValue
in its window.public boolean isSingleWindowedValue()
true
if this WindowedValue has exactly one window.public java.lang.Iterable<WindowedValue<T>> explodeWindows()
WindowedValues
identical to this one, except each
is in exactly one of the windows that this WindowedValue
is in.public boolean equals(@Nullable java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public abstract java.lang.String toString()
toString
in class java.lang.Object
public static <T> WindowedValue.FullWindowedValueCoder<T> getFullCoder(Coder<T> valueCoder, Coder<? extends BoundedWindow> windowCoder)
Coder
to use for a WindowedValue<T>
, using the given valueCoder and
windowCoder.public static <T> WindowedValue.ValueOnlyWindowedValueCoder<T> getValueOnlyCoder(Coder<T> valueCoder)
ValueOnlyCoder
from the given valueCoder.public static <T> WindowedValue.ParamWindowedValueCoder<T> getParamWindowedValueCoder(Coder<T> valueCoder)
ParamWindowedValueCoder
from the given valueCoder.