T - The type to be serialized.public class AvroSerializer<T>
extends org.apache.flink.api.common.typeutils.TypeSerializer<T>
The serializer supports:
The serializer instantiates them depending on the class of the type it should serialize.
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
| 限定符和类型 | 类和说明 |
|---|---|
static class |
AvroSerializer.AvroSchemaSerializerConfigSnapshot<T>
已过时。
|
| 构造器和说明 |
|---|
AvroSerializer(Class<T> type)
Creates a new AvroSerializer for the type indicated by the given class.
|
AvroSerializer(Class<T> type,
Class<? extends T> typeToInstantiate)
已过时。
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>public int getLength()
getLength 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>public T createInstance()
createInstance 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>public void serialize(T value, org.apache.flink.core.memory.DataOutputView target) throws IOException
serialize 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>IOExceptionpublic T deserialize(org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>IOExceptionpublic T deserialize(T reuse, org.apache.flink.core.memory.DataInputView source) throws IOException
deserialize 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>IOExceptionpublic T copy(T from, T reuse)
copy 在类中 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 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>IOExceptionpublic org.apache.flink.api.common.typeutils.TypeSerializerSnapshot<T> snapshotConfiguration()
snapshotConfiguration 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>public org.apache.flink.api.common.typeutils.TypeSerializer<T> duplicate()
duplicate 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>public int hashCode()
hashCode 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>public boolean equals(Object obj)
equals 在类中 org.apache.flink.api.common.typeutils.TypeSerializer<T>Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.