T - type of element coder can handle@Experimental
public class KryoCoder<T>
extends org.apache.beam.sdk.coders.CustomCoder<T>
KryoCoderProvider to get more
details about usage.| Modifier and Type | Method and Description |
|---|---|
T |
decode(java.io.InputStream inStream) |
void |
encode(T value,
java.io.OutputStream outStream) |
boolean |
equals(@Nullable java.lang.Object other) |
int |
hashCode() |
static <T> KryoCoder<T> |
of()
Create a new
KryoCoder with default KryoOptions. |
static <T> KryoCoder<T> |
of(KryoRegistrar... registrars)
Create a new
KryoCoder with default KryoOptions. |
static <T> KryoCoder<T> |
of(java.util.List<KryoRegistrar> registrars)
Create a new
KryoCoder with default KryoOptions. |
static <T> KryoCoder<T> |
of(org.apache.beam.sdk.options.PipelineOptions pipelineOptions)
Create a new
KryoCoder. |
static <T> KryoCoder<T> |
of(org.apache.beam.sdk.options.PipelineOptions pipelineOptions,
KryoRegistrar... registrars)
Create a new
KryoCoder. |
static <T> KryoCoder<T> |
of(org.apache.beam.sdk.options.PipelineOptions pipelineOptions,
java.util.List<KryoRegistrar> registrars)
Create a new
KryoCoder. |
void |
verifyDeterministic() |
KryoCoder<T> |
withRegistrar(KryoRegistrar registrar)
Create a new
KryoCoder instance with the user provided registrar. |
public static <T> KryoCoder<T> of()
KryoCoder with default KryoOptions.public static <T> KryoCoder<T> of(KryoRegistrar... registrars)
KryoCoder with default KryoOptions.T - type of element this class should decode/encode Kryo instance used by
returned KryoCoderregistrars - KryoRegistrars which are used to register classes with underlying
kryo instanceKryoCoderpublic static <T> KryoCoder<T> of(java.util.List<KryoRegistrar> registrars)
KryoCoder with default KryoOptions.T - type of element this class should decode/encode Kryo instance used by
returned KryoCoderregistrars - KryoRegistrars which are used to register classes with underlying
kryo instanceKryoCoderpublic static <T> KryoCoder<T> of(org.apache.beam.sdk.options.PipelineOptions pipelineOptions)
KryoCoder.T - type of element this class should decode/encode Kryo instance used by
returned KryoCoderpipelineOptions - Options used for coder setup. See KryoOptions for more details.KryoCoderpublic static <T> KryoCoder<T> of(org.apache.beam.sdk.options.PipelineOptions pipelineOptions, KryoRegistrar... registrars)
KryoCoder.T - type of element this class should decode/encode Kryo instance used by
returned KryoCoderpipelineOptions - Options used for coder setup. See KryoOptions for more details.registrars - KryoRegistrars which are used to register classes with underlying
kryo instanceKryoCoderpublic static <T> KryoCoder<T> of(org.apache.beam.sdk.options.PipelineOptions pipelineOptions, java.util.List<KryoRegistrar> registrars)
KryoCoder.T - type of element this class should decode/encode Kryo instance used by
returned KryoCoderpipelineOptions - Options used for coder setup. See KryoOptions for more details.registrars - KryoRegistrars which are used to register classes with underlying
kryo instanceKryoCoderpublic void encode(T value, java.io.OutputStream outStream) throws java.io.IOException
encode in class org.apache.beam.sdk.coders.Coder<T>java.io.IOExceptionpublic T decode(java.io.InputStream inStream) throws java.io.IOException
decode in class org.apache.beam.sdk.coders.Coder<T>java.io.IOExceptionpublic void verifyDeterministic()
throws org.apache.beam.sdk.coders.Coder.NonDeterministicException
verifyDeterministic in class org.apache.beam.sdk.coders.CustomCoder<T>org.apache.beam.sdk.coders.Coder.NonDeterministicExceptionpublic KryoCoder<T> withRegistrar(KryoRegistrar registrar)
KryoCoder instance with the user provided registrar.registrar - registrar to append to list of already registered registrars.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(@Nullable java.lang.Object other)
equals in class java.lang.Object