Class SerializerDeserializerFactory

java.lang.Object
com.linkedin.venice.serializer.SerializerDeserializerFactory
Direct Known Subclasses:
FastSerializerDeserializerFactory, MapOrderPreservingSerDeFactory

public class SerializerDeserializerFactory extends Object
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.
  • Constructor Details

    • SerializerDeserializerFactory

      public SerializerDeserializerFactory()
  • Method Details

    • 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(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)