Class ZKStore

  • All Implemented Interfaces:
    DataModelBackedStructure<StoreProperties>, Store

    public class ZKStore
    extends AbstractStore
    implements DataModelBackedStructure<StoreProperties>
    Class defines the store of Venice.

    This class is NOT thread safe. Concurrency request to ZKStore instance should be controlled in repository level. When adding fields to Store Metadata (stored in ZK or metadata system store), you need to modify avro schema in this folder: venice-common/src/main/resources/avro/StoreMeta/StoreMetaValue Before we enable the zk shared metadata system schema store auto creation: ConfigKeys.CONTROLLER_ZK_SHARED_META_SYSTEM_SCHEMA_STORE_AUTO_CREATION_ENABLED, we could continue to modify v1 schema. But once this is enabled, we need to evolve the value schema by adding a new version, and DON'T EVER CHANGE THE EXISTING SCHEMA WITHOUT CAREFUL CONSIDERATION!!! Also make sure json serialization still works. So the steps will become the following when you want to add a new field to Store Metadata: 1. Evolve the value schema of metadata system schema mentioned by the above section, and always have a default for the newly added fields. 2. Add getter/setter methods to Store. When you want to add a simple field to Store metadata, you just need to create getter/setter for the new field. When you try to add a method starting with 'get', the default json serialization will do serialization by this method, which could produce some unexpected serialization result, so if it is not for serialization purpose, please specify JsonIgnore to ignore the method, whose name is starting with 'get'. TODO: we need to refactor this class to separate Store operations from Store POJO, which is being used by JSON TODO: Since metadata keeps increasing, maybe we would like to refactor it to builder pattern. TODO: In the future, we could consider to use avro json serialization directly to make it simpler.