Package com.linkedin.venice.helix
Class CachedReadOnlyStoreRepository
java.lang.Object
com.linkedin.venice.helix.CachedReadOnlyStoreRepository
- All Implemented Interfaces:
ReadOnlyStoreRepository
,VeniceResource
- Direct Known Subclasses:
HelixReadOnlyStoreRepository
,HelixReadWriteStoreRepository
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ClusterLockManager
protected final String
protected final String
static final String
protected final org.apache.helix.zookeeper.impl.client.ZkClient
protected final org.apache.helix.manager.zk.ZkBaseDataAccessor<Store>
-
Constructor Summary
ConstructorDescriptionCachedReadOnlyStoreRepository
(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, String clusterName, HelixAdapterSerializer compositeSerializer, ClusterLockManager clusterLockManager) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Get all stores in the current repositoryint
getBatchGetLimit
(String storeName) Get batch-get limit for the specified storeGet one store by given name from repository.protected Store
getStoreFromZk
(String storeName) getStoreOrThrow
(String storeName) HelixReadOnlyZKSharedSystemStoreRepository
is overriding this function to filter out stores, which are not necessary to put a watch against duringrefresh()
, and if this logic to refresh the zk store repository gets changed in the future, we need to updateHelixReadOnlyZKSharedSystemStoreRepository
accordingly.getStoresFromZk
(Collection<String> storeNames) protected final String
getStoreZkPath
(String storeName) long
Get total read quota of all stores.boolean
Whether the store exists or not.boolean
isReadComputationEnabled
(String storeName) Whether computation is enabled for the specified store.protected void
notifyStoreChanged
(Store store) protected void
notifyStoreCreated
(Store store) protected void
notifyStoreDeleted
(Store store) protected Store
void
refresh()
refreshOneStore
(String storeName) Selective refresh operation which fetches one store from ZKvoid
Register store data change listener.protected Store
removeStore
(String storeName) void
Unregister store data change listener.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.linkedin.venice.meta.ReadOnlyStoreRepository
waitVersion, waitVersion
-
Field Details
-
STORE_REPOSITORY_PATH
- See Also:
-
clusterName
-
clusterStoreRepositoryPath
-
zkClient
protected final org.apache.helix.zookeeper.impl.client.ZkClient zkClient -
zkDataAccessor
-
clusterLockManager
-
storeMap
-
-
Constructor Details
-
CachedReadOnlyStoreRepository
public CachedReadOnlyStoreRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, String clusterName, HelixAdapterSerializer compositeSerializer, ClusterLockManager clusterLockManager)
-
-
Method Details
-
getStore
Description copied from interface:ReadOnlyStoreRepository
Get one store by given name from repository.- Specified by:
getStore
in interfaceReadOnlyStoreRepository
- Parameters:
storeName
- name of wanted store.- Returns:
- Store for given name.
-
getStoreOrThrow
- Specified by:
getStoreOrThrow
in interfaceReadOnlyStoreRepository
- Throws:
VeniceNoStoreException
-
hasStore
Description copied from interface:ReadOnlyStoreRepository
Whether the store exists or not.- Specified by:
hasStore
in interfaceReadOnlyStoreRepository
- Parameters:
storeName
- store name- Returns:
-
getAllStores
Description copied from interface:ReadOnlyStoreRepository
Get all stores in the current repository- Specified by:
getAllStores
in interfaceReadOnlyStoreRepository
- Returns:
-
getTotalStoreReadQuota
public long getTotalStoreReadQuota()Description copied from interface:ReadOnlyStoreRepository
Get total read quota of all stores.- Specified by:
getTotalStoreReadQuota
in interfaceReadOnlyStoreRepository
-
getBatchGetLimit
Description copied from interface:ReadOnlyStoreRepository
Get batch-get limit for the specified store- Specified by:
getBatchGetLimit
in interfaceReadOnlyStoreRepository
- Returns:
-
isReadComputationEnabled
Description copied from interface:ReadOnlyStoreRepository
Whether computation is enabled for the specified store.- Specified by:
isReadComputationEnabled
in interfaceReadOnlyStoreRepository
- Parameters:
storeName
- store name- Returns:
-
refresh
public void refresh()- Specified by:
refresh
in interfaceVeniceResource
-
refreshOneStore
Description copied from interface:ReadOnlyStoreRepository
Selective refresh operation which fetches one store from ZK- Specified by:
refreshOneStore
in interfaceReadOnlyStoreRepository
- Parameters:
storeName
- store name- Returns:
- the newly refreshed store
-
clear
public void clear()- Specified by:
clear
in interfaceVeniceResource
-
registerStoreDataChangedListener
Description copied from interface:ReadOnlyStoreRepository
Register store data change listener.- Specified by:
registerStoreDataChangedListener
in interfaceReadOnlyStoreRepository
-
unregisterStoreDataChangedListener
Description copied from interface:ReadOnlyStoreRepository
Unregister store data change listener.- Specified by:
unregisterStoreDataChangedListener
in interfaceReadOnlyStoreRepository
-
putStore
-
removeStore
-
getStoreZkPath
-
getStoreFromZk
-
getStoresFromZk
HelixReadOnlyZKSharedSystemStoreRepository
is overriding this function to filter out stores, which are not necessary to put a watch against duringrefresh()
, and if this logic to refresh the zk store repository gets changed in the future, we need to updateHelixReadOnlyZKSharedSystemStoreRepository
accordingly. -
getStoresFromZk
-
notifyStoreCreated
-
notifyStoreDeleted
-
notifyStoreChanged
-