Package com.linkedin.venice.serializer
Class SerializerDeserializerFactory
- java.lang.Object
-
- com.linkedin.venice.serializer.SerializerDeserializerFactory
-
- Direct Known Subclasses:
FastSerializerDeserializerFactory
,MapOrderPreservingSerDeFactory
public class SerializerDeserializerFactory extends java.lang.Object
For one given store, the client only needs the followings: 1. OneAvroSerializer
for key serialization; 2. MultipleAvroGenericDeserializer
/AvroSpecificDeserializer
for value deserialization; By using this implementation, we can reuse the serializer/deserializer to improve the performance of key serialization/value deserialization.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SerializerDeserializerFactory.SchemaPairAndClassContainer
-
Constructor Summary
Constructors Constructor Description SerializerDeserializerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V> RecordDeserializer<V>
getAvroGenericDeserializer(org.apache.avro.Schema schema)
This function is assuming that both writer and reader are using the same schema.static <V> RecordDeserializer<V>
getAvroGenericDeserializer(org.apache.avro.Schema writer, org.apache.avro.Schema reader)
static <K> RecordSerializer<K>
getAvroGenericSerializer(org.apache.avro.Schema schema)
static <K> RecordSerializer<K>
getAvroGenericSerializer(org.apache.avro.Schema schema, boolean buffered)
static <V extends org.apache.avro.specific.SpecificRecord>
RecordDeserializer<V>getAvroSpecificDeserializer(java.lang.Class<V> c)
This function is assuming that both writer and reader are using the same schema defined in {@param c}.static <V extends org.apache.avro.specific.SpecificRecord>
RecordDeserializer<V>getAvroSpecificDeserializer(org.apache.avro.Schema writer, java.lang.Class<V> c)
protected static <V extends org.apache.avro.specific.SpecificRecord>
RecordDeserializer<V>getAvroSpecificDeserializerInternal(org.apache.avro.Schema writer, java.lang.Class<V> c, java.util.function.Function<SerializerDeserializerFactory.SchemaPairAndClassContainer,AvroSpecificDeserializer<? extends org.apache.avro.specific.SpecificRecord>> deserializerGenerator)
static <K> RecordDeserializer<K>
getVsonDeserializer(org.apache.avro.Schema writer, org.apache.avro.Schema reader)
static <K> RecordSerializer<K>
getVsonSerializer(org.apache.avro.Schema schema)
-
-
-
Method Detail
-
getAvroGenericSerializer
public static <K> RecordSerializer<K> getAvroGenericSerializer(org.apache.avro.Schema schema)
-
getAvroGenericSerializer
public static <K> RecordSerializer<K> getAvroGenericSerializer(org.apache.avro.Schema schema, boolean buffered)
-
getVsonSerializer
public static <K> RecordSerializer<K> getVsonSerializer(org.apache.avro.Schema schema)
-
getVsonDeserializer
public static <K> RecordDeserializer<K> getVsonDeserializer(org.apache.avro.Schema writer, org.apache.avro.Schema reader)
-
getAvroGenericDeserializer
public static <V> RecordDeserializer<V> getAvroGenericDeserializer(org.apache.avro.Schema writer, org.apache.avro.Schema reader)
-
getAvroGenericDeserializer
public static <V> RecordDeserializer<V> getAvroGenericDeserializer(org.apache.avro.Schema schema)
This function is assuming that both writer and reader are using the same schema.- Type Parameters:
V
-- Parameters:
schema
-- Returns:
-
getAvroSpecificDeserializer
public static <V extends org.apache.avro.specific.SpecificRecord> RecordDeserializer<V> getAvroSpecificDeserializer(java.lang.Class<V> c)
This function is assuming that both writer and reader are using the same schema defined in {@param c}.- Type Parameters:
V
-- Parameters:
c
-- Returns:
-
getAvroSpecificDeserializer
public static <V extends org.apache.avro.specific.SpecificRecord> RecordDeserializer<V> getAvroSpecificDeserializer(org.apache.avro.Schema writer, java.lang.Class<V> c)
-
getAvroSpecificDeserializerInternal
protected static <V extends org.apache.avro.specific.SpecificRecord> RecordDeserializer<V> getAvroSpecificDeserializerInternal(org.apache.avro.Schema writer, java.lang.Class<V> c, java.util.function.Function<SerializerDeserializerFactory.SchemaPairAndClassContainer,AvroSpecificDeserializer<? extends org.apache.avro.specific.SpecificRecord>> deserializerGenerator)
-
-