Package com.linkedin.venice.helix
Class HelixReadOnlyStoreConfigRepository
java.lang.Object
com.linkedin.venice.helix.HelixReadOnlyStoreConfigRepository
- All Implemented Interfaces:
ReadOnlyStoreConfigRepository
,VeniceResource
public class HelixReadOnlyStoreConfigRepository
extends Object
implements ReadOnlyStoreConfigRepository, VeniceResource
This class is used to fetch all store configs from ZK and cached locally, then provide the way to read those
configs.
Also it will listen on the store configs change event and keep the cache up to date.
This class is non-cluster specified.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
protected class
-
Constructor Summary
ConstructorDescriptionHelixReadOnlyStoreConfigRepository
(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer) HelixReadOnlyStoreConfigRepository
(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, ZkStoreConfigAccessor accessor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
getStoreConfig
(String storeName) Get the store config by store name.getStoreConfigOrThrow
(String storeName) void
refresh()
Obtain all available stores and load them into cache, but it doesn't fetch the store configs and attach ZK watch yet
-
Constructor Details
-
HelixReadOnlyStoreConfigRepository
public HelixReadOnlyStoreConfigRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer) -
HelixReadOnlyStoreConfigRepository
public HelixReadOnlyStoreConfigRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, ZkStoreConfigAccessor accessor)
-
-
Method Details
-
refresh
public void refresh()Obtain all available stores and load them into cache, but it doesn't fetch the store configs and attach ZK watch yet- Specified by:
refresh
in interfaceVeniceResource
-
clear
public void clear()- Specified by:
clear
in interfaceVeniceResource
-
getStoreConfig
Get the store config by store name. It would fetch the store config from ZK if it's not in cache yet and attach ZK watch. The corresponding Venice store config is returned for metadata system store's store config. This is the most natural way to handle cluster discovery for metadata system stores and store migration.- Specified by:
getStoreConfig
in interfaceReadOnlyStoreConfigRepository
-
getStoreConfigOrThrow
- Specified by:
getStoreConfigOrThrow
in interfaceReadOnlyStoreConfigRepository
-