Class RmdSchemaGeneratorV1


  • public class RmdSchemaGeneratorV1
    extends java.lang.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 Detail

      • METADATA_RECORD_SUFFIX

        protected static final java.lang.String METADATA_RECORD_SUFFIX
        See Also:
        Constant Field Values
      • 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 Detail

      • RmdSchemaGeneratorV1

        public RmdSchemaGeneratorV1()
    • Method Detail

      • generateMetadataSchema

        public org.apache.avro.Schema generateMetadataSchema​(java.lang.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,
                                                                       java.lang.String namespace)
      • validateSchemaType

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