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
FieldsModifier and TypeFieldDescriptionprotected final ClusterLockManagerprotected final Stringprotected final Stringstatic final Stringprotected final org.apache.helix.zookeeper.impl.client.ZkClientprotected final org.apache.helix.manager.zk.ZkBaseDataAccessor<Store> -
Constructor Summary
ConstructorsConstructorDescriptionCachedReadOnlyStoreRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, String clusterName, HelixAdapterSerializer compositeSerializer, ClusterLockManager clusterLockManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Get all stores in the current repositoryintgetBatchGetLimit(String storeName) Get batch-get limit for the specified storeGet one store by given name from repository.protected StoregetStoreFromZk(String storeName) getStoreOrThrow(String storeName) HelixReadOnlyZKSharedSystemStoreRepositoryis 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 updateHelixReadOnlyZKSharedSystemStoreRepositoryaccordingly.getStoresFromZk(Collection<String> storeNames) protected final StringgetStoreZkPath(String storeName) longGet total read quota of all stores.booleanWhether the store exists or not.booleanisReadComputationEnabled(String storeName) Whether computation is enabled for the specified store.protected voidnotifyStoreChanged(Store store) protected voidnotifyStoreCreated(Store store) protected voidnotifyStoreDeleted(Store store) protected Storevoidrefresh()refreshOneStore(String storeName) Selective refresh operation which fetches one store from ZKvoidRegister store data change listener.protected StoreremoveStore(String storeName) voidUnregister store data change listener.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ReadOnlyStoreRepositoryGet one store by given name from repository.- Specified by:
getStorein interfaceReadOnlyStoreRepository- Parameters:
storeName- name of wanted store.- Returns:
- Store for given name.
-
getStoreOrThrow
- Specified by:
getStoreOrThrowin interfaceReadOnlyStoreRepository- Throws:
VeniceNoStoreException
-
hasStore
Description copied from interface:ReadOnlyStoreRepositoryWhether the store exists or not.- Specified by:
hasStorein interfaceReadOnlyStoreRepository- Parameters:
storeName- store name- Returns:
-
getAllStores
Description copied from interface:ReadOnlyStoreRepositoryGet all stores in the current repository- Specified by:
getAllStoresin interfaceReadOnlyStoreRepository- Returns:
-
getTotalStoreReadQuota
public long getTotalStoreReadQuota()Description copied from interface:ReadOnlyStoreRepositoryGet total read quota of all stores.- Specified by:
getTotalStoreReadQuotain interfaceReadOnlyStoreRepository
-
getBatchGetLimit
Description copied from interface:ReadOnlyStoreRepositoryGet batch-get limit for the specified store- Specified by:
getBatchGetLimitin interfaceReadOnlyStoreRepository- Returns:
-
isReadComputationEnabled
Description copied from interface:ReadOnlyStoreRepositoryWhether computation is enabled for the specified store.- Specified by:
isReadComputationEnabledin interfaceReadOnlyStoreRepository- Parameters:
storeName- store name- Returns:
-
refresh
public void refresh()- Specified by:
refreshin interfaceVeniceResource
-
refreshOneStore
Description copied from interface:ReadOnlyStoreRepositorySelective refresh operation which fetches one store from ZK- Specified by:
refreshOneStorein interfaceReadOnlyStoreRepository- Parameters:
storeName- store name- Returns:
- the newly refreshed store
-
clear
public void clear()- Specified by:
clearin interfaceVeniceResource
-
registerStoreDataChangedListener
Description copied from interface:ReadOnlyStoreRepositoryRegister store data change listener.- Specified by:
registerStoreDataChangedListenerin interfaceReadOnlyStoreRepository
-
unregisterStoreDataChangedListener
Description copied from interface:ReadOnlyStoreRepositoryUnregister store data change listener.- Specified by:
unregisterStoreDataChangedListenerin interfaceReadOnlyStoreRepository
-
putStore
-
removeStore
-
getStoreZkPath
-
getStoreFromZk
-
getStoresFromZk
HelixReadOnlyZKSharedSystemStoreRepositoryis 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 updateHelixReadOnlyZKSharedSystemStoreRepositoryaccordingly. -
getStoresFromZk
-
notifyStoreCreated
-
notifyStoreDeleted
-
notifyStoreChanged
-