Package com.linkedin.venice.helix
Class HelixReadOnlyZKSharedSystemStoreRepository
java.lang.Object
com.linkedin.venice.helix.CachedReadOnlyStoreRepository
com.linkedin.venice.helix.HelixReadOnlyStoreRepository
com.linkedin.venice.helix.HelixReadOnlyZKSharedSystemStoreRepository
- All Implemented Interfaces:
ReadOnlyStoreRepository,VeniceResource
- Direct Known Subclasses:
SharedHelixReadOnlyZKSharedSystemStoreRepository
This repository provides an interface to access zk shared system stores only.
With this implementation, we will minimize the zwatches required to the system store cluster.
But there is a shortcoming with current implementation, since all the system store related operations
will be constrained by the healthiness of system store cluster.
-
Field Summary
Fields inherited from class com.linkedin.venice.helix.CachedReadOnlyStoreRepository
clusterLockManager, clusterName, clusterStoreRepositoryPath, STORE_REPOSITORY_PATH, storeMap, zkClient, zkDataAccessor -
Constructor Summary
ConstructorsConstructorDescriptionHelixReadOnlyZKSharedSystemStoreRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer compositeSerializer, String systemStoreClusterName) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()intgetBatchGetLimit(String storeName) Only return zk shared system store related info, otherwiseVeniceExceptionwill be thrown.Only the zk shared system store can be returned, otherwise this function will return null.getStoreOrThrow(String storeName) Only the zk shared system store can be returned, otherwise this function will throwVeniceNoStoreException.This function is used to filter out non system stores from the system store cluster, and this is very important sinceCachedReadOnlyStoreRepository.refresh()is relying on this function to retrieve all the stores in this cluster and put a watch against each znode, and we need to filter out non-system stores to avoid unnecessary zk watches.longGet total read quota of all stores.booleanOnly return true for the existing zk shared system store.booleanisReadComputationEnabled(String storeName) Only return zk shared system store related info, otherwiseVeniceExceptionwill be thrown.protected voidonRepositoryChanged(Collection<String> newZkStoreNames) This function is used to filter out non system stores to avoid unnecessary zk watches against the newly added regular stores.voidrefresh()refreshOneStore(String storeName) Only zk shared system store can be refreshed here, otherwiseVeniceExceptionwill be thrown.Methods inherited from class com.linkedin.venice.helix.HelixReadOnlyStoreRepository
onStoreChanged, putStore, removeStoreMethods inherited from class com.linkedin.venice.helix.CachedReadOnlyStoreRepository
getAllStores, getStoreFromZk, getStoresFromZk, getStoreZkPath, notifyStoreChanged, notifyStoreCreated, notifyStoreDeleted, registerStoreDataChangedListener, unregisterStoreDataChangedListenerMethods 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
-
Constructor Details
-
HelixReadOnlyZKSharedSystemStoreRepository
public HelixReadOnlyZKSharedSystemStoreRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer compositeSerializer, String systemStoreClusterName)
-
-
Method Details
-
getStore
Only the zk shared system store can be returned, otherwise this function will return null.- Specified by:
getStorein interfaceReadOnlyStoreRepository- Overrides:
getStorein classCachedReadOnlyStoreRepository- Parameters:
storeName- name of wanted store.- Returns:
- Store for given name.
-
getStoreOrThrow
Only the zk shared system store can be returned, otherwise this function will throwVeniceNoStoreException.- Specified by:
getStoreOrThrowin interfaceReadOnlyStoreRepository- Overrides:
getStoreOrThrowin classCachedReadOnlyStoreRepository- Throws:
VeniceNoStoreException
-
hasStore
Only return true for the existing zk shared system store.- Specified by:
hasStorein interfaceReadOnlyStoreRepository- Overrides:
hasStorein classCachedReadOnlyStoreRepository- Parameters:
storeName- store name- Returns:
-
refreshOneStore
Only zk shared system store can be refreshed here, otherwiseVeniceExceptionwill be thrown.- Specified by:
refreshOneStorein interfaceReadOnlyStoreRepository- Overrides:
refreshOneStorein classCachedReadOnlyStoreRepository- Parameters:
storeName- store name- Returns:
- the newly refreshed store
-
getStoresFromZk
This function is used to filter out non system stores from the system store cluster, and this is very important sinceCachedReadOnlyStoreRepository.refresh()is relying on this function to retrieve all the stores in this cluster and put a watch against each znode, and we need to filter out non-system stores to avoid unnecessary zk watches.- Overrides:
getStoresFromZkin classCachedReadOnlyStoreRepository- Returns:
-
onRepositoryChanged
This function is used to filter out non system stores to avoid unnecessary zk watches against the newly added regular stores.- Overrides:
onRepositoryChangedin classHelixReadOnlyStoreRepository- Parameters:
newZkStoreNames-
-
getTotalStoreReadQuota
public long getTotalStoreReadQuota()Description copied from interface:ReadOnlyStoreRepositoryGet total read quota of all stores.- Specified by:
getTotalStoreReadQuotain interfaceReadOnlyStoreRepository- Overrides:
getTotalStoreReadQuotain classCachedReadOnlyStoreRepository
-
getBatchGetLimit
Only return zk shared system store related info, otherwiseVeniceExceptionwill be thrown.- Specified by:
getBatchGetLimitin interfaceReadOnlyStoreRepository- Overrides:
getBatchGetLimitin classCachedReadOnlyStoreRepository- Returns:
-
isReadComputationEnabled
Only return zk shared system store related info, otherwiseVeniceExceptionwill be thrown.- Specified by:
isReadComputationEnabledin interfaceReadOnlyStoreRepository- Overrides:
isReadComputationEnabledin classCachedReadOnlyStoreRepository- Parameters:
storeName- store name- Returns:
-
refresh
public void refresh()- Specified by:
refreshin interfaceVeniceResource- Overrides:
refreshin classHelixReadOnlyStoreRepository
-
clear
public void clear()- Specified by:
clearin interfaceVeniceResource- Overrides:
clearin classHelixReadOnlyStoreRepository
-