Class RmdSchemaGeneratorV1

java.lang.Object
com.linkedin.venice.schema.rmd.v1.RmdSchemaGeneratorV1

public class RmdSchemaGeneratorV1 extends Object
This class helps in generating a active-active metadata schema to hold update timestamps and offsets from a value schema of a store . If the value schema is a RECORD then the generated schema will be a RECORD having a UNION field and an array. The UNION will consists of 1 record to hold a single timestamp field for the entire record. This timestamp indicates when the full record was last update as a whole. The other field of the UNION will be a RECORD consisting of 1 timestamp field for each field of the original record. These timestamps will indicate when a particular field was updated through Partial update operations. The array field contains the offsets of messages in remote colos which tried to update this record. If the value schema is not RECORD then the generated schema will be a RECORD to hold a single timestamp field, and the same offset array. This timestamp indicates when the full record was last update as a whole. Currently nested fields are not supported.
  • Field Details

    • METADATA_RECORD_SUFFIX

      protected static final String METADATA_RECORD_SUFFIX
      See Also:
    • NAME_SPACE

      protected static final String NAME_SPACE
      See Also:
    • LONG_TYPE_TIMESTAMP_SCHEMA

      public static final org.apache.avro.Schema LONG_TYPE_TIMESTAMP_SCHEMA
    • OFFSET_VECTOR_SCHEMA

      protected static final org.apache.avro.Schema OFFSET_VECTOR_SCHEMA
  • Constructor Details

    • RmdSchemaGeneratorV1

      public RmdSchemaGeneratorV1()
  • Method Details

    • generateMetadataSchema

      public org.apache.avro.Schema generateMetadataSchema(String valueSchemaStr)
    • generateMetadataSchema

      public org.apache.avro.Schema generateMetadataSchema(org.apache.avro.Schema originalSchema)
    • generateMetadataSchemaFromRecord

      public org.apache.avro.Schema generateMetadataSchemaFromRecord(org.apache.avro.Schema recordSchema, String namespace)
    • validateSchemaType

      protected void validateSchemaType(org.apache.avro.Schema schema, org.apache.avro.Schema.Type expectedType)