T - the type of elements handled by this coderpublic abstract class CustomCoder<T> extends AtomicCoder<T> implements Serializable
Coders that encodes itself via java
serialization.
To complete an implementation, subclasses must implement Coder.encode(T, java.io.OutputStream, com.google.cloud.dataflow.sdk.coders.Coder.Context)
and Coder.decode(java.io.InputStream, com.google.cloud.dataflow.sdk.coders.Coder.Context) methods. Anonymous subclasses must furthermore override
getEncodingId().
Not to be confused with SerializableCoder that encodes objects that implement the
Serializable interface.
Coder.Context, Coder.NonDeterministicException| Constructor and Description |
|---|
CustomCoder() |
| Modifier and Type | Method and Description |
|---|---|
com.google.cloud.dataflow.sdk.util.CloudObject |
asCloudObject()
Returns the
CloudObject that represents this Coder. |
String |
getEncodingId()
A unique identifier for the binary format written by
Coder.encode(T, java.io.OutputStream, com.google.cloud.dataflow.sdk.coders.Coder.Context). |
static CustomCoder<?> |
of(String typeId,
String encodingId,
String type,
String serializedCoder) |
void |
verifyDeterministic()
As a
DeterministicStandardCoder is presumed deterministic, this
method does nothing. |
getCoderArguments, getInstanceComponentsconsistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodedElementByteSize, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministicpublic static CustomCoder<?> of(String typeId, String encodingId, String type, String serializedCoder)
public com.google.cloud.dataflow.sdk.util.CloudObject asCloudObject()
CoderCloudObject that represents this Coder.asCloudObject in interface Coder<T>asCloudObject in class StandardCoder<T>public void verifyDeterministic()
throws Coder.NonDeterministicException
DeterministicStandardCoderDeterministicStandardCoder is presumed deterministic, this
method does nothing.verifyDeterministic in interface Coder<T>verifyDeterministic in class DeterministicStandardCoder<T>Coder.NonDeterministicException - if this coder is not deterministic.public String getEncodingId()
StandardCoderCoder.encode(T, java.io.OutputStream, com.google.cloud.dataflow.sdk.coders.Coder.Context). If a subclass is
modified to write a new format, it is imperative that this method be overridden to return
a distinct value.
By default, this is an empty string so only the fully qualified name of the class is used.
getEncodingId in interface Coder<T>getEncodingId in class StandardCoder<T>StandardCoder.getAllowedEncodings()