Google Cloud Dataflow SDK for Java, version 1.9.1
com.google.cloud.dataflow.sdk.coders
Class EntityCoder
- java.lang.Object
-
- com.google.cloud.dataflow.sdk.coders.StandardCoder<T>
-
- com.google.cloud.dataflow.sdk.coders.DeterministicStandardCoder<T>
-
- com.google.cloud.dataflow.sdk.coders.AtomicCoder<DatastoreV1.Entity>
-
- com.google.cloud.dataflow.sdk.coders.EntityCoder
-
- All Implemented Interfaces:
- Coder<DatastoreV1.Entity>, Serializable
Deprecated.useProtoCoder
instead.
@Deprecated public class EntityCoder extends AtomicCoder<DatastoreV1.Entity>
ACoder
forDatastoreV1.Entity
objects based on their encoded Protocol Buffer form.- 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 Deprecated Methods Modifier and Type Method and Description DatastoreV1.Entity
decode(InputStream inStream, Coder.Context context)
Deprecated.Decodes a value of typeT
from the given input stream in the given context.void
encode(DatastoreV1.Entity value, OutputStream outStream, Coder.Context context)
Deprecated.Encodes the given value of typeT
onto the given output stream in the given context.protected long
getEncodedElementByteSize(DatastoreV1.Entity value, Coder.Context context)
Deprecated.Returns the size in bytes of the encoded value using this coder.static EntityCoder
of()
Deprecated.void
verifyDeterministic()
Deprecated.ThrowCoder.NonDeterministicException
if the coding is not deterministic.-
Methods inherited from class com.google.cloud.dataflow.sdk.coders.AtomicCoder
getCoderArguments, getInstanceComponents
-
Methods inherited from class com.google.cloud.dataflow.sdk.coders.StandardCoder
asCloudObject, consistentWithEquals, equals, getAllowedEncodings, getComponents, getEncodingId, hashCode, isRegisterByteSizeObserverCheap, registerByteSizeObserver, structuralValue, toString, verifyDeterministic, verifyDeterministic
-
-
-
-
Method Detail
-
of
public static EntityCoder of()
Deprecated.
-
encode
public void encode(DatastoreV1.Entity value, OutputStream outStream, Coder.Context context) throws IOException, CoderException
Deprecated.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 DatastoreV1.Entity decode(InputStream inStream, Coder.Context context) throws IOException
Deprecated.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
-
getEncodedElementByteSize
protected long getEncodedElementByteSize(DatastoreV1.Entity value, Coder.Context context) throws Exception
Deprecated.Description copied from class:StandardCoder
Returns the size in bytes of the encoded value using this coder.- Overrides:
getEncodedElementByteSize
in classStandardCoder<DatastoreV1.Entity>
- Throws:
Exception
-
verifyDeterministic
public void verifyDeterministic() throws Coder.NonDeterministicException
Deprecated.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.
- Specified by:
verifyDeterministic
in interfaceCoder<DatastoreV1.Entity>
- Overrides:
verifyDeterministic
in classDeterministicStandardCoder<DatastoreV1.Entity>
- Throws:
NonDeterministicException
- always. A Datastore kind can hold arbitraryObject
instances, which makes the encoding non-deterministic.Coder.NonDeterministicException
- if this coder is not deterministic.
- two values that compare as equal (via
-
-