Class HelixReadWriteSchemaRepository

  • All Implemented Interfaces:
    ReadOnlySchemaRepository, ReadWriteSchemaRepository, VeniceResource

    public class HelixReadWriteSchemaRepository
    extends java.lang.Object
    implements ReadWriteSchemaRepository
    This class is used to add schema entries for stores. There are 4 types of schema entries 1. Key schema ZK Path: ${cluster_name}/Stores/${store_name}/key-schema/1 Each store only has 1 key schema and the schema is immutable. 2. Value schema ZK Path: ${cluster_name}/Stores/${store_name}/value-schema/${value_schema_id} Value schemas are evolvable. Stores can have multiple value schemas and each value schema is forwards/backwards compatible with others. 3. Derived schema ZK Path: ${cluster_name}/Stores/${store_name}/derived-schema/${value_schema_id}_${derived_schema_id} Each value schema can have multiple derived schemas. check out DerivedSchemaEntry for more details. 3. Replication metadata schema * ZK Path: ${cluster_name}/Stores/${store_name}/timestamp-metadata-schema/${value_schema_id}-${replication_metadata_version_id} * Check out SchemaEntrySerializer and DerivedSchemaEntrySerializer to see how schemas are ser-ded. ReadWriteSchemaRepository doesn't cache existing schemas locally and it always queries ZK for currently values. This is a different behavior compared to ReadOnlyStoreRepository where values always get cached and future update callbacks are registered. Notice: Users should not instantiate this class elsewhere than in the leader Controller and there should be always only 1 ReadWriteSchemaRepository per cluster. Instantiating multiple ReadWriteSchemaRepository will lead to race conditions in ZK.