Class StringAnnotatedStoreSchemaCache
java.lang.Object
com.linkedin.davinci.replication.merge.StringAnnotatedStoreSchemaCache
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 Summary
ConstructorDescriptionStringAnnotatedStoreSchemaCache
(String storeName, ReadOnlySchemaRepository internalSchemaRepo) -
Method Summary
Modifier and TypeMethodDescriptiongetDerivedSchema
(int valueSchemaId, int partialUpdateProtocolId) Retrieve update schema and annotate top-level string array and map field's field update and collection merge operations.getRmdSchema
(int valueSchemaId, int rmdSchemaProtocolId) Retrieve RMD schema and annotate map field and string array field's deleted elements list field.Retrieve the superset schema (if exists) or the latest value schema and return corresponding annotated value schema.Retrieve the superset schema (if exists) and return corresponding annotated value schema.getValueSchema
(int id) Retrieve value schema and annotate its top-level string array and map fields.
-
Constructor Details
-
StringAnnotatedStoreSchemaCache
public StringAnnotatedStoreSchemaCache(String storeName, ReadOnlySchemaRepository internalSchemaRepo)
-
-
Method Details
-
getValueSchema
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
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
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
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
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.
-