Package com.linkedin.venice.helix
Class HelixReadOnlyStoreConfigRepository
- java.lang.Object
-
- com.linkedin.venice.helix.HelixReadOnlyStoreConfigRepository
-
- All Implemented Interfaces:
ReadOnlyStoreConfigRepository
,VeniceResource
public class HelixReadOnlyStoreConfigRepository extends java.lang.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
Nested Classes Modifier and Type Class Description protected class
HelixReadOnlyStoreConfigRepository.StoreConfigAddedOrDeletedChangedListener
protected class
HelixReadOnlyStoreConfigRepository.StoreConfigChangedListener
-
Constructor Summary
Constructors Constructor Description HelixReadOnlyStoreConfigRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer, int refreshAttemptsForZkReconnect, long refreshIntervalForZkReconnectInMs)
HelixReadOnlyStoreConfigRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, ZkStoreConfigAccessor accessor, int refreshAttemptsForZkReconnect, long refreshIntervalForZkReconnectInMs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
java.util.List<StoreConfig>
getAllStoreConfigs()
java.util.Optional<StoreConfig>
getStoreConfig(java.lang.String storeName)
The corresponding Venice store config is returned for metadata system store's store config.protected HelixReadOnlyStoreConfigRepository.StoreConfigAddedOrDeletedChangedListener
getStoreConfigAddedOrDeletedListener()
protected HelixReadOnlyStoreConfigRepository.StoreConfigChangedListener
getStoreConfigChangedListener()
StoreConfig
getStoreConfigOrThrow(java.lang.String storeName)
void
refresh()
-
-
-
Constructor Detail
-
HelixReadOnlyStoreConfigRepository
public HelixReadOnlyStoreConfigRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer adapterSerializer, int refreshAttemptsForZkReconnect, long refreshIntervalForZkReconnectInMs)
-
HelixReadOnlyStoreConfigRepository
public HelixReadOnlyStoreConfigRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, ZkStoreConfigAccessor accessor, int refreshAttemptsForZkReconnect, long refreshIntervalForZkReconnectInMs)
-
-
Method Detail
-
refresh
public void refresh()
- Specified by:
refresh
in interfaceVeniceResource
-
clear
public void clear()
- Specified by:
clear
in interfaceVeniceResource
-
getStoreConfig
public java.util.Optional<StoreConfig> getStoreConfig(java.lang.String storeName)
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
public StoreConfig getStoreConfigOrThrow(java.lang.String storeName)
- Specified by:
getStoreConfigOrThrow
in interfaceReadOnlyStoreConfigRepository
-
getAllStoreConfigs
public java.util.List<StoreConfig> getAllStoreConfigs()
- Specified by:
getAllStoreConfigs
in interfaceReadOnlyStoreConfigRepository
-
getStoreConfigAddedOrDeletedListener
protected HelixReadOnlyStoreConfigRepository.StoreConfigAddedOrDeletedChangedListener getStoreConfigAddedOrDeletedListener()
-
getStoreConfigChangedListener
protected HelixReadOnlyStoreConfigRepository.StoreConfigChangedListener getStoreConfigChangedListener()
-
-