T - the type to be serializedpublic class AvroSerializationSchema<T> extends Object implements org.apache.flink.api.common.serialization.SerializationSchema<T>
| 限定符 | 构造器和说明 |
|---|---|
protected |
AvroSerializationSchema(Class<T> recordClazz,
org.apache.avro.Schema schema)
Creates an Avro deserialization schema.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
checkAvroInitialized() |
boolean |
equals(Object o) |
static AvroSerializationSchema<org.apache.avro.generic.GenericRecord> |
forGeneric(org.apache.avro.Schema schema)
Creates
AvroSerializationSchema that serializes GenericRecord using provided
schema. |
static <T extends org.apache.avro.specific.SpecificRecord> |
forSpecific(Class<T> tClass)
Creates
AvroSerializationSchema that serializes SpecificRecord using provided
schema. |
protected org.apache.avro.generic.GenericDatumWriter<T> |
getDatumWriter() |
protected org.apache.avro.io.BinaryEncoder |
getEncoder() |
protected ByteArrayOutputStream |
getOutputStream() |
org.apache.avro.Schema |
getSchema() |
int |
hashCode() |
byte[] |
serialize(T object) |
protected AvroSerializationSchema(Class<T> recordClazz, @Nullable org.apache.avro.Schema schema)
recordClazz - class to serialize. Should be one of: SpecificRecord, GenericRecord.schema - writer Avro schema. Should be provided if recordClazz is GenericRecordpublic static <T extends org.apache.avro.specific.SpecificRecord> AvroSerializationSchema<T> forSpecific(Class<T> tClass)
AvroSerializationSchema that serializes SpecificRecord using provided
schema.tClass - the type to be serializedpublic static AvroSerializationSchema<org.apache.avro.generic.GenericRecord> forGeneric(org.apache.avro.Schema schema)
AvroSerializationSchema that serializes GenericRecord using provided
schema.schema - the schema that will be used for serializationpublic org.apache.avro.Schema getSchema()
protected org.apache.avro.io.BinaryEncoder getEncoder()
protected org.apache.avro.generic.GenericDatumWriter<T> getDatumWriter()
protected ByteArrayOutputStream getOutputStream()
public byte[] serialize(T object)
serialize 在接口中 org.apache.flink.api.common.serialization.SerializationSchema<T>protected void checkAvroInitialized()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.