Package com.linkedin.venice.schema.rmd
Class RmdSchemaGenerator
java.lang.Object
com.linkedin.venice.schema.rmd.RmdSchemaGenerator
This is simply a wrapper class to delegate the actual schema generation to version specific adapter.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.avro.Schema
generateMetadataSchema
(String schemaStr, int version) static org.apache.avro.Schema
generateMetadataSchema
(org.apache.avro.Schema schema) Generate the latest replication metadata schema.static org.apache.avro.Schema
generateMetadataSchema
(org.apache.avro.Schema schema, int version) static ByteBuffer
generateRecordLevelTimestampMetadata
(org.apache.avro.Schema schema, Long timestamp) Generate an RMD payload with contains only a record level timestamp for a given metadata schemastatic int
-
Method Details
-
generateMetadataSchema
-
generateMetadataSchema
public static org.apache.avro.Schema generateMetadataSchema(org.apache.avro.Schema schema) Generate the latest replication metadata schema.- Parameters:
schema
- source schema from which replication metadata schema is generated- Returns:
- Generated replication metadata schema
-
generateRecordLevelTimestampMetadata
public static ByteBuffer generateRecordLevelTimestampMetadata(org.apache.avro.Schema schema, Long timestamp) Generate an RMD payload with contains only a record level timestamp for a given metadata schema- Parameters:
schema
- metadata schema. This schema MUST contain a root level timestamp fieldtimestamp
- the timestamp to place in the record- Returns:
- a bytebuffer containing the serialized metadata payload with the passed timestamp
-
getLatestVersion
public static int getLatestVersion() -
generateMetadataSchema
public static org.apache.avro.Schema generateMetadataSchema(org.apache.avro.Schema schema, int version)
-