Package com.linkedin.venice.serializer
Class SerializerDeserializerFactory
java.lang.Object
com.linkedin.venice.serializer.SerializerDeserializerFactory
- Direct Known Subclasses:
FastSerializerDeserializerFactory
,MapOrderPreservingSerDeFactory
For one given store, the client only needs the followings:
1. One
AvroSerializer
for key serialization;
2. Multiple AvroGenericDeserializer
/ 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
Modifier and TypeClassDescriptionstatic class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <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>This function is assuming that both writer and reader are using the same schema defined in .static <V extends org.apache.avro.specific.SpecificRecord>
RecordDeserializer<V>getAvroSpecificDeserializer
(org.apache.avro.Schema writer, Class<V> c) protected static <V extends org.apache.avro.specific.SpecificRecord>
RecordDeserializer<V>getAvroSpecificDeserializerInternal
(org.apache.avro.Schema writer, Class<V> c, 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)
-
Constructor Details
-
SerializerDeserializerFactory
public SerializerDeserializerFactory()
-
-
Method Details
-
getAvroGenericSerializer
-
getAvroGenericSerializer
public static <K> RecordSerializer<K> getAvroGenericSerializer(org.apache.avro.Schema schema, boolean buffered) -
getVsonSerializer
-
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
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(Class<V> c) This function is assuming that both writer and reader are using the same schema defined in .- Type Parameters:
V
-- Parameters:
c
-- Returns:
-
getAvroSpecificDeserializer
public static <V extends org.apache.avro.specific.SpecificRecord> RecordDeserializer<V> getAvroSpecificDeserializer(org.apache.avro.Schema writer, Class<V> c) -
getAvroSpecificDeserializerInternal
protected static <V extends org.apache.avro.specific.SpecificRecord> RecordDeserializer<V> getAvroSpecificDeserializerInternal(org.apache.avro.Schema writer, Class<V> c, Function<SerializerDeserializerFactory.SchemaPairAndClassContainer, AvroSpecificDeserializer<? extends org.apache.avro.specific.SpecificRecord>> deserializerGenerator)
-