Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.coders
Class DeterministicStandardCoder<T>
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.coders.StandardCoder<T>
-
- com.google.cloud.dataflow.sdk.coders.DeterministicStandardCoder<T>
-
- Type Parameters:
T
- the type of the values being transcoded
- All Implemented Interfaces:
- Coder<T>, Serializable
- Direct Known Subclasses:
- AtomicCoder
public abstract class DeterministicStandardCoder<T> extends StandardCoder<T>
ADeterministicStandardCoder
is aStandardCoder
that is deterministic, in the sense that for objects considered equal according toObject.equals(Object)
, the encoded bytes are also equal.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.cloud.dataflow.sdk.coders.Coder
Coder.Context, Coder.NonDeterministicException
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
DeterministicStandardCoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description 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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.cloud.dataflow.sdk.coders.Coder
decode, encode, getCoderArguments
-
-
-
-
Method Detail
-
verifyDeterministic
public void verifyDeterministic() throws Coder.NonDeterministicException
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:
NonDeterministicException
- never, unless overridden. ADeterministicStandardCoder
is presumed deterministic.Coder.NonDeterministicException
- if this coder is not deterministic.
- two values that compare as equal (via
-
-