T - The type to be serialized.public class AvroSerializer<T>
extends org.apache.flink.api.common.typeutils.TypeSerializer<T>
The serializer supports:
Important: This serializer is NOT THREAD SAFE, because it reuses the data encoders and decoders which have buffers that would be shared between the threads if used concurrently
| Modifier and Type | Class and Description |
|---|---|
static class |
AvroSerializer.AvroSchemaSerializerConfigSnapshot<T>
Deprecated.
|
| Constructor and Description |
|---|
AvroSerializer(Class<T> type)
Creates a new AvroSerializer for the type indicated by the given class.
|
AvroSerializer(Class<T> type,
Class<? extends T> typeToInstantiate)
Deprecated.
Use
AvroSerializer(Class) instead. |
AvroSerializer(Class<T> type,
org.apache.avro.Schema schema)
Creates a new AvroSerializer for the type indicated by the given class.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canEqual(Object obj) |
void |
copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target) |
T |
copy(T from) |
T |
copy(T from,
T reuse) |
T |
createInstance() |
T |
deserialize(org.apache.flink.core.memory.DataInputView source) |
T |
deserialize(T reuse,
org.apache.flink.core.memory.DataInputView source) |
org.apache.flink.api.common.typeutils.TypeSerializer<T> |
duplicate() |
boolean |
equals(Object obj) |
int |
getLength() |
Class<T> |
getType() |
int |
hashCode() |
boolean |
isImmutableType() |
void |
serialize(T value,
org.apache.flink.core.memory.DataOutputView target) |
org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T> |
snapshotConfiguration() |
String |
toString() |
public AvroSerializer(Class<T> type)
SpecificRecord or reflection serializer.
For serializing GenericData.Record use AvroSerializer(Class, Schema)public AvroSerializer(Class<T> type, org.apache.avro.Schema schema)
GenericData.Record.
For SpecificRecord or reflection serializer use
AvroSerializer(Class)@Deprecated public AvroSerializer(Class<T> type, Class<? extends T> typeToInstantiate)
AvroSerializer(Class) instead.public boolean isImmutableType()
isImmutableType in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public int getLength()
getLength in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public T createInstance()
createInstance in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public void serialize(T value, org.apache.flink.core.memory.DataOutputView target) throws IOException
serialize in class org.apache.flink.api.common.typeutils.TypeSerializer<T>IOExceptionpublic T deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize in class org.apache.flink.api.common.typeutils.TypeSerializer<T>IOExceptionpublic T deserialize(T reuse, org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize in class org.apache.flink.api.common.typeutils.TypeSerializer<T>IOExceptionpublic T copy(T from)
copy in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public T copy(T from, T reuse)
copy in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public void copy(org.apache.flink.core.memory.DataInputView source,
org.apache.flink.core.memory.DataOutputView target)
throws IOException
copy in class org.apache.flink.api.common.typeutils.TypeSerializer<T>IOExceptionpublic org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T> snapshotConfiguration()
snapshotConfiguration in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public org.apache.flink.api.common.typeutils.TypeSerializer<T> duplicate()
duplicate in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public int hashCode()
hashCode in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public boolean equals(Object obj)
equals in class org.apache.flink.api.common.typeutils.TypeSerializer<T>public boolean canEqual(Object obj)
canEqual in class org.apache.flink.api.common.typeutils.TypeSerializer<T>Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.