Google Cloud Dataflow SDK for Java, version 1.9.1
Package com.google.cloud.dataflow.sdk.coders
Coders
to specify how data is encoded to and decoded from byte strings.See: Description
-
Interface Summary Interface Description Coder<T> ACoder<T>
defines how to encode and decode values of typeT
into byte streams.CoderFactory ACoderFactory
creates coders and decomposes values.CoderProvider ACoderProvider
may create aCoder
for any concrete class.DelegateCoder.CodingFunction<InputT,OutputT> ACodingFunction<InputT, OutputT>
is a serializable function fromInputT
toOutputT
that may throw anyException
. -
Class Summary Class Description AtomicCoder<T> AvroCoder<T> ACoder
using Avro binary format.BigEndianIntegerCoder ABigEndianIntegerCoder
encodesIntegers
in 4 bytes, big-endian.BigEndianLongCoder ABigEndianLongCoder
encodesLong
s in 8 bytes, big-endian.ByteArrayCoder ACoder
forbyte[]
.ByteCoder ByteStringCoder ACoder
forByteString
objects based on their encoded Protocol Buffer form.Coder.Context The context in which encoding or decoding is being done.Coder.NonDeterministicException Exception thrown byCoder.verifyDeterministic()
if the encoding is not deterministic, including details of why the encoding is not deterministic.CoderFactories Static utility methods for creating and working withCoder
s.CoderProviders Static utility methods for working withCoderProviders
.CoderRegistry ACoderRegistry
allows registering the defaultCoder
to use for a Java class, and looking up and instantiating the defaultCoder
for a Java type.CollectionCoder<T> CustomCoder<T> An abstract base class for writing aCoder
class that encodes itself via Java serialization.DelegateCoder<T,IntermediateT> ADelegateCoder<T, IntermediateT>
wraps aCoder
forIntermediateT
and encodes/decodes values of typeT
by converting to/fromIntermediateT
and then encoding/decoding using the underlyingCoder<IntermediateT>
.DeterministicStandardCoder<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.DoubleCoder ADoubleCoder
encodesDouble
values in 8 bytes using Java serialization.DurationCoder EntityCoder Deprecated useProtoCoder
instead.InstantCoder IterableCoder<T> IterableLikeCoder<T,IterableT extends Iterable<T>> An abstract base class with functionality for assembling aCoder
for a class that implementsIterable
.JAXBCoder<T> A coder for JAXB annotated objects.KvCoder<K,V> AKvCoder
encodesKV
s.KvCoderBase<T> Deprecated ListCoder<T> MapCoder<K,V> MapCoderBase<T> Deprecated NullableCoder<T> ANullableCoder
encodes nullable values of typeT
using a nestedCoder<T>
that does not toleratenull
values.Proto2Coder<T extends com.google.protobuf.Message> Deprecated UseProtoCoder
.SerializableCoder<T extends Serializable> ACoder
for Java classes that implementSerializable
.SetCoder<T> StandardCoder<T> An abstract base class to implement aCoder
that defines equality, hashing, and printing via the class name and recursively usingStandardCoder.getComponents()
.StringDelegateCoder<T> ACoder
that wraps aCoder<String>
and encodes/decodes values via string representations.StringUtf8Coder StructuralByteArray A wrapper around a byte[] that uses structural, value-based equality rather than byte[]'s normal object identity.TableRowJsonCoder TextualIntegerCoder ACoder
that encodesInteger Integers
as the ASCII bytes of their textual, decimal, representation.VarIntCoder VarLongCoder VoidCoder -
Enum Summary Enum Description CannotProvideCoderException.ReasonCode Indicates the reason thatCoder
inference failed. -
Exception Summary Exception Description CannotProvideCoderException The exception thrown when aCoderProvider
cannot provide aCoder
that has been requested.CoderException AnException
thrown if there is a problem encoding or decoding a value. -
Annotation Types Summary Annotation Type Description DefaultCoder TheDefaultCoder
annotation specifies a defaultCoder
class to handle encoding and decoding instances of the annotated class.
Package com.google.cloud.dataflow.sdk.coders Description
Coders
to specify how data is encoded to and decoded from byte strings.
During execution of a Pipeline, elements in a
PCollection
may need to be encoded into byte strings.
This happens both at the beginning and end of a pipeline when data is read from and written to
persistent storage and also during execution of a pipeline when elements are communicated between
machines.
Exactly when PCollection elements are encoded during execution depends on which
PipelineRunner
is being used and how that runner
chooses to execute the pipeline. As such, Dataflow requires that all PCollections have an
appropriate Coder in case it becomes necessary. In many cases, the Coder can be inferred from
the available Java type
information and the Pipeline's CoderRegistry
. It
can be specified per PCollection via
PCollection.setCoder(Coder)
or per type using the
DefaultCoder
annotation.
This package provides a number of coders for common types like Integer
,
String
, and List
, as well as coders like
AvroCoder
that can be used to encode many custom
types.