Class RmdSerDe
- java.lang.Object
-
- com.linkedin.davinci.replication.merge.RmdSerDe
-
public class RmdSerDe extends java.lang.Object
This class is responsible for serialization and deserialization related tasks. Specifically 3 things: 1. Deserialize RMD from bytes. 2. Serialize RMD record to bytes. 3. Get RMD schema given its value schema ID.
-
-
Constructor Summary
Constructors Constructor Description RmdSerDe(StringAnnotatedStoreSchemaCache annotatedStoreSchemaCache, int rmdVersionId)
RmdSerDe(StringAnnotatedStoreSchemaCache annotatedStoreSchemaCache, int rmdVersionId, boolean fastAvroEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.avro.generic.GenericRecord
deserializeRmdBytes(int writerSchemaID, int readerSchemaID, java.nio.ByteBuffer rmdBytes)
Given a value schema ID {@param valueSchemaID} and RMD bytes {@param rmdBytes}, find the RMD schema that corresponds to the given value schema ID and use that RMD schema to deserialize RMD bytes in a RMD record.void
deserializeValueSchemaIdPrependedRmdBytes(byte[] valueSchemaIdPrependedBytes, RmdWithValueSchemaId rmdWithValueSchemaId)
This method takes in the RMD bytes with prepended value schema ID and aRmdWithValueSchemaId
container object.org.apache.avro.Schema
getRmdSchema(int valueSchemaId)
java.nio.ByteBuffer
serializeRmdRecord(int valueSchemaId, org.apache.avro.generic.GenericRecord rmdRecord)
-
-
-
Constructor Detail
-
RmdSerDe
public RmdSerDe(StringAnnotatedStoreSchemaCache annotatedStoreSchemaCache, int rmdVersionId)
-
RmdSerDe
public RmdSerDe(StringAnnotatedStoreSchemaCache annotatedStoreSchemaCache, int rmdVersionId, boolean fastAvroEnabled)
-
-
Method Detail
-
deserializeValueSchemaIdPrependedRmdBytes
public void deserializeValueSchemaIdPrependedRmdBytes(byte[] valueSchemaIdPrependedBytes, RmdWithValueSchemaId rmdWithValueSchemaId)
This method takes in the RMD bytes with prepended value schema ID and aRmdWithValueSchemaId
container object. It will deserialize the RMD bytes into RMD record and fill the passed-in container.
-
deserializeRmdBytes
public org.apache.avro.generic.GenericRecord deserializeRmdBytes(int writerSchemaID, int readerSchemaID, java.nio.ByteBuffer rmdBytes)
Given a value schema ID {@param valueSchemaID} and RMD bytes {@param rmdBytes}, find the RMD schema that corresponds to the given value schema ID and use that RMD schema to deserialize RMD bytes in a RMD record.
-
serializeRmdRecord
public java.nio.ByteBuffer serializeRmdRecord(int valueSchemaId, org.apache.avro.generic.GenericRecord rmdRecord)
-
getRmdSchema
public org.apache.avro.Schema getRmdSchema(int valueSchemaId)
-
-