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
ConstructorDescriptionHelixReadOnlyZKSharedSystemStoreRepository
(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer compositeSerializer, String systemStoreClusterName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
int
getBatchGetLimit
(String storeName) Only return zk shared system store related info, otherwiseVeniceException
will 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.long
Get total read quota of all stores.boolean
Only return true for the existing zk shared system store.boolean
isReadComputationEnabled
(String storeName) Only return zk shared system store related info, otherwiseVeniceException
will be thrown.protected void
onRepositoryChanged
(Collection<String> newZkStoreNames) This function is used to filter out non system stores to avoid unnecessary zk watches against the newly added regular stores.void
refresh()
refreshOneStore
(String storeName) Only zk shared system store can be refreshed here, otherwiseVeniceException
will be thrown.Methods inherited from class com.linkedin.venice.helix.HelixReadOnlyStoreRepository
onStoreChanged, putStore, removeStore
Methods inherited from class com.linkedin.venice.helix.CachedReadOnlyStoreRepository
getAllStores, getStoreFromZk, getStoresFromZk, getStoreZkPath, notifyStoreChanged, notifyStoreCreated, notifyStoreDeleted, registerStoreDataChangedListener, unregisterStoreDataChangedListener
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
-
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:
getStore
in interfaceReadOnlyStoreRepository
- Overrides:
getStore
in 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:
getStoreOrThrow
in interfaceReadOnlyStoreRepository
- Overrides:
getStoreOrThrow
in classCachedReadOnlyStoreRepository
- Throws:
VeniceNoStoreException
-
hasStore
Only return true for the existing zk shared system store.- Specified by:
hasStore
in interfaceReadOnlyStoreRepository
- Overrides:
hasStore
in classCachedReadOnlyStoreRepository
- Parameters:
storeName
- store name- Returns:
-
refreshOneStore
Only zk shared system store can be refreshed here, otherwiseVeniceException
will be thrown.- Specified by:
refreshOneStore
in interfaceReadOnlyStoreRepository
- Overrides:
refreshOneStore
in 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:
getStoresFromZk
in 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:
onRepositoryChanged
in classHelixReadOnlyStoreRepository
- Parameters:
newZkStoreNames
-
-
getTotalStoreReadQuota
public long getTotalStoreReadQuota()Description copied from interface:ReadOnlyStoreRepository
Get total read quota of all stores.- Specified by:
getTotalStoreReadQuota
in interfaceReadOnlyStoreRepository
- Overrides:
getTotalStoreReadQuota
in classCachedReadOnlyStoreRepository
-
getBatchGetLimit
Only return zk shared system store related info, otherwiseVeniceException
will be thrown.- Specified by:
getBatchGetLimit
in interfaceReadOnlyStoreRepository
- Overrides:
getBatchGetLimit
in classCachedReadOnlyStoreRepository
- Returns:
-
isReadComputationEnabled
Only return zk shared system store related info, otherwiseVeniceException
will be thrown.- Specified by:
isReadComputationEnabled
in interfaceReadOnlyStoreRepository
- Overrides:
isReadComputationEnabled
in classCachedReadOnlyStoreRepository
- Parameters:
storeName
- store name- Returns:
-
refresh
public void refresh()- Specified by:
refresh
in interfaceVeniceResource
- Overrides:
refresh
in classHelixReadOnlyStoreRepository
-
clear
public void clear()- Specified by:
clear
in interfaceVeniceResource
- Overrides:
clear
in classHelixReadOnlyStoreRepository
-