Class RmdSerDe
java.lang.Object
com.linkedin.davinci.replication.merge.RmdSerDe
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
ConstructorDescriptionRmdSerDe
(StringAnnotatedStoreSchemaCache annotatedStoreSchemaCache, int rmdVersionId) RmdSerDe
(StringAnnotatedStoreSchemaCache annotatedStoreSchemaCache, int rmdVersionId, boolean fastAvroEnabled) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.avro.generic.GenericRecord
deserializeRmdBytes
(int writerSchemaID, int readerSchemaID, ByteBuffer rmdBytes) Given a value schema ID and RMD bytes , 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) serializeRmdRecord
(int valueSchemaId, org.apache.avro.generic.GenericRecord rmdRecord)
-
Constructor Details
-
RmdSerDe
-
RmdSerDe
public RmdSerDe(StringAnnotatedStoreSchemaCache annotatedStoreSchemaCache, int rmdVersionId, boolean fastAvroEnabled)
-
-
Method Details
-
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, ByteBuffer rmdBytes) Given a value schema ID and RMD bytes , 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 ByteBuffer serializeRmdRecord(int valueSchemaId, org.apache.avro.generic.GenericRecord rmdRecord) -
getRmdSchema
public org.apache.avro.Schema getRmdSchema(int valueSchemaId)
-