Class StringAnnotatedStoreSchemaCache
- java.lang.Object
-
- com.linkedin.davinci.replication.merge.StringAnnotatedStoreSchemaCache
-
public class StringAnnotatedStoreSchemaCache extends java.lang.ObjectThis 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 intoUtf8instead 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 byMergeConflictResolverandRmdSerDeonly. TheMergeConflictResolverwill process all string array and map field in Java string correctly and no internalUtf8.toString()is needed.
-
-
Constructor Summary
Constructors Constructor Description StringAnnotatedStoreSchemaCache(java.lang.String storeName, ReadOnlySchemaRepository internalSchemaRepo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DerivedSchemaEntrygetDerivedSchema(int valueSchemaId, int partialUpdateProtocolId)Retrieve update schema and annotate top-level string array and map field's field update and collection merge operations.RmdSchemaEntrygetRmdSchema(int valueSchemaId, int rmdSchemaProtocolId)Retrieve RMD schema and annotate map field and string array field's deleted elements list field.SchemaEntrygetSupersetOrLatestValueSchema()Retrieve the superset schema (if exists) or the latest value schema and return corresponding annotated value schema.SchemaEntrygetSupersetSchema()Retrieve the superset schema (if exists) and return corresponding annotated value schema.SchemaEntrygetValueSchema(int id)Retrieve value schema and annotate its top-level string array and map fields.
-
-
-
Constructor Detail
-
StringAnnotatedStoreSchemaCache
public StringAnnotatedStoreSchemaCache(java.lang.String storeName, ReadOnlySchemaRepository internalSchemaRepo)
-
-
Method Detail
-
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.
-
-