Class StringAnnotatedStoreSchemaCache

java.lang.Object
com.linkedin.davinci.replication.merge.StringAnnotatedStoreSchemaCache

public class StringAnnotatedStoreSchemaCache extends Object
This class serves as the annotated schema cache for merge conflict resolution purpose in Active/Active replication. String in Avro string array and map key will be deserialized into Utf8 instead of Java String and this will result in incorrect and inefficient processing during collection merge operations. This class wraps schema repository and annotates value schema, update schema, superset schema and RMD schema to be used by MergeConflictResolver and RmdSerDe only. The MergeConflictResolver will process all string array and map field in Java string correctly and no internal Utf8.toString() is needed.
  • Constructor Details

  • Method Details

    • getValueSchema

      public SchemaEntry getValueSchema(int id)
      Retrieve value schema and annotate its top-level string array and map fields. The annotation will only be done once in the repository's lifetime as the result is cached.
    • getSupersetOrLatestValueSchema

      public SchemaEntry getSupersetOrLatestValueSchema()
      Retrieve the superset schema (if exists) or the latest value schema and return corresponding annotated value schema. The annotation will only be done once in the repository's lifetime as the result is cached.
    • getSupersetSchema

      public SchemaEntry getSupersetSchema()
      Retrieve the superset schema (if exists) and return corresponding annotated value schema. The annotation will only be done once in the repository's lifetime as the result is cached.
    • getDerivedSchema

      public DerivedSchemaEntry getDerivedSchema(int valueSchemaId, int partialUpdateProtocolId)
      Retrieve update schema and annotate top-level string array and map field's field update and collection merge operations. The annotation will only be done once in the repository's lifetime as the result is cached.
    • getRmdSchema

      public RmdSchemaEntry getRmdSchema(int valueSchemaId, int rmdSchemaProtocolId)
      Retrieve RMD schema and annotate map field and string array field's deleted elements list field. The annotation will only be done once in the repository's lifetime as the result is cached.