public static class WindowedValue.FullWindowedValueCoder<T> extends WindowedValue.WindowedValueCoder<T>
WindowedValue.Coder.Context, Coder.NonDeterministicException| Modifier and Type | Method and Description |
|---|---|
CloudObject |
asCloudObject()
Returns the
CloudObject that represents this Coder. |
WindowedValue<T> |
decode(InputStream inStream,
Coder.Context context)
Decodes a value of type
T from the given input stream in
the given context. |
void |
encode(WindowedValue<T> windowedElem,
OutputStream outStream,
Coder.Context context)
Encodes the given value of type
T onto the given output stream
in the given context. |
List<? extends Coder<?>> |
getCoderArguments()
If this is a
Coder for a parameterized type, returns the
list of Coders being used for each of the parameters, or
returns null if this cannot be done or this is not a
parameterized type. |
List<? extends Coder<?>> |
getComponents()
Returns the list of
Coders that are components of this
Coder. |
Coder<? extends BoundedWindow> |
getWindowCoder() |
Coder<Collection<? extends BoundedWindow>> |
getWindowsCoder() |
static <T> WindowedValue.FullWindowedValueCoder<T> |
of(Coder<T> valueCoder,
Coder<? extends BoundedWindow> windowCoder) |
static WindowedValue.FullWindowedValueCoder<?> |
of(List<Coder<?>> components) |
void |
registerByteSizeObserver(WindowedValue<T> value,
ElementByteSizeObserver observer,
Coder.Context context)
Notifies ElementByteSizeObserver about the byte size of the
encoded value using this coder.
|
void |
verifyDeterministic()
Throw
Coder.NonDeterministicException if the coding is not deterministic. |
<V> WindowedValue.WindowedValueCoder<V> |
withValueCoder(Coder<V> valueCoder)
Returns a new
WindowedValueCoder that is a copy of this one,
but with a different value coder. |
getValueCoderconsistentWithEquals, equals, getAllowedEncodings, getEncodedElementByteSize, getEncodingId, hashCode, isRegisterByteSizeObserverCheap, structuralValue, toString, verifyDeterministic, verifyDeterministicpublic static <T> WindowedValue.FullWindowedValueCoder<T> of(Coder<T> valueCoder, Coder<? extends BoundedWindow> windowCoder)
public static WindowedValue.FullWindowedValueCoder<?> of(List<Coder<?>> components)
public Coder<? extends BoundedWindow> getWindowCoder()
public Coder<Collection<? extends BoundedWindow>> getWindowsCoder()
public <V> WindowedValue.WindowedValueCoder<V> withValueCoder(Coder<V> valueCoder)
WindowedValue.WindowedValueCoderWindowedValueCoder that is a copy of this one,
but with a different value coder.withValueCoder in class WindowedValue.WindowedValueCoder<T>public void encode(WindowedValue<T> windowedElem, OutputStream outStream, Coder.Context context) throws CoderException, IOException
CoderT onto the given output stream
in the given context.CoderException - if the value could not be encoded for some reasonIOException - if writing to the OutputStream fails
for some reasonpublic WindowedValue<T> decode(InputStream inStream, Coder.Context context) throws CoderException, IOException
CoderT from the given input stream in
the given context. Returns the decoded value.CoderException - if the value could not be decoded for some reasonIOException - if reading from the InputStream fails
for some reasonpublic void verifyDeterministic()
throws Coder.NonDeterministicException
CoderCoder.NonDeterministicException if the coding is not deterministic.
In order for a Coder to be considered deterministic,
the following must be true:
Object.equals()
or Comparable.compareTo(), if supported) have the same
encoding.
Coder always produces a canonical encoding, which is the
same for an instance of an object even if produced on different
computers at different times.
Coder.NonDeterministicException - if this coder is not deterministic.public void registerByteSizeObserver(WindowedValue<T> value, ElementByteSizeObserver observer, Coder.Context context) throws Exception
StandardCoderregisterByteSizeObserver in interface Coder<WindowedValue<T>>registerByteSizeObserver in class StandardCoder<WindowedValue<T>>Exceptionpublic CloudObject asCloudObject()
CoderCloudObject that represents this Coder.asCloudObject in interface Coder<WindowedValue<T>>asCloudObject in class StandardCoder<WindowedValue<T>>public List<? extends Coder<?>> getCoderArguments()
CoderCoder for a parameterized type, returns the
list of Coders being used for each of the parameters, or
returns null if this cannot be done or this is not a
parameterized type.public List<? extends Coder<?>> getComponents()
StandardCoderCoders that are components of this
Coder. Returns an empty list if this is an AtomicCoder (or
other Coder with no components).getComponents in class StandardCoder<WindowedValue<T>>