Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.values
Class TimestampedValue.TimestampedValueCoder<T>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.coders.StandardCoder<TimestampedValue<T>>
-
- com.google.cloud.dataflow.sdk.values.TimestampedValue.TimestampedValueCoder<T>
-
- All Implemented Interfaces:
- Coder<TimestampedValue<T>>, Serializable
- Enclosing class:
- TimestampedValue<V>
public static class TimestampedValue.TimestampedValueCoder<T> extends StandardCoder<TimestampedValue<T>>
ACoder
forTimestampedValue
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.cloud.dataflow.sdk.coders.Coder
Coder.Context, Coder.NonDeterministicException
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description TimestampedValue<T>
decode(InputStream inStream, Coder.Context context)
Decodes a value of typeT
from the given input stream in the given context.void
encode(TimestampedValue<T> windowedElem, OutputStream outStream, Coder.Context context)
Encodes the given value of typeT
onto the given output stream in the given context.List<? extends Coder<?>>
getCoderArguments()
If this is aCoder
for a parameterized type, returns the list ofCoder
s being used for each of the parameters, or returnsnull
if this cannot be done or this is not a parameterized type.static <T> List<Object>
getInstanceComponents(TimestampedValue<T> exampleValue)
static <T> TimestampedValue.TimestampedValueCoder<T>
of(Coder<T> valueCoder)
static TimestampedValue.TimestampedValueCoder<?>
of(List<Object> components)
void
verifyDeterministic()
ThrowCoder.NonDeterministicException
if the coding is not deterministic.-
Methods inherited from class com.google.cloud.dataflow.sdk.coders.StandardCoder
asCloudObject, consistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodedElementByteSize, getEncodingId, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministic
-
-
-
-
Method Detail
-
of
public static <T> TimestampedValue.TimestampedValueCoder<T> of(Coder<T> valueCoder)
-
of
public static TimestampedValue.TimestampedValueCoder<?> of(List<Object> components)
-
encode
public void encode(TimestampedValue<T> windowedElem, OutputStream outStream, Coder.Context context) throws IOException
Description copied from interface:Coder
Encodes the given value of typeT
onto the given output stream in the given context.- Throws:
IOException
- if writing to theOutputStream
fails for some reasonCoderException
- if the value could not be encoded for some reason
-
decode
public TimestampedValue<T> decode(InputStream inStream, Coder.Context context) throws IOException
Description copied from interface:Coder
Decodes a value of typeT
from the given input stream in the given context. Returns the decoded value.- Throws:
IOException
- if reading from theInputStream
fails for some reasonCoderException
- if the value could not be decoded for some reason
-
verifyDeterministic
public void verifyDeterministic() throws Coder.NonDeterministicException
Description copied from interface:Coder
ThrowCoder.NonDeterministicException
if the coding is not deterministic.In order for a
Coder
to be considered deterministic, the following must be true:- two values that compare as equal (via
Object.equals()
orComparable.compareTo()
, if supported) have the same encoding. - the
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.
- Throws:
Coder.NonDeterministicException
- if this coder is not deterministic.
- two values that compare as equal (via
-
getCoderArguments
public List<? extends Coder<?>> getCoderArguments()
Description copied from interface:Coder
If this is aCoder
for a parameterized type, returns the list ofCoder
s being used for each of the parameters, or returnsnull
if this cannot be done or this is not a parameterized type.
-
getInstanceComponents
public static <T> List<Object> getInstanceComponents(TimestampedValue<T> exampleValue)
-
-