Package com.linkedin.venice.helix
Class HelixReadWriteStoreRepository
- java.lang.Object
-
- com.linkedin.venice.helix.CachedReadOnlyStoreRepository
-
- com.linkedin.venice.helix.HelixReadWriteStoreRepository
-
- All Implemented Interfaces:
ReadOnlyStoreRepository
,ReadWriteStoreRepository
,VeniceResource
public class HelixReadWriteStoreRepository extends CachedReadOnlyStoreRepository implements ReadWriteStoreRepository
Read write store repository which uses Helix as storage.This repository does NOT listen the change of store from ZK. Because in Venice, this is the only once place to modify stores.
-
-
Field Summary
-
Fields inherited from class com.linkedin.venice.helix.CachedReadOnlyStoreRepository
clusterLockManager, clusterStoreRepositoryPath, STORE_REPOSITORY_PATH, storeMap, zkClient, zkDataAccessor
-
-
Constructor Summary
Constructors Constructor Description HelixReadWriteStoreRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer compositeSerializer, java.lang.String clusterName, java.util.Optional<MetaStoreWriter> metaStoreWriter, ClusterLockManager storeLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStore(Store store)
Add store into repository.void
deleteStore(java.lang.String storeName)
Delete store from repository.java.util.List<Store>
getAllStores()
Get all stores in the current repositoryStore
getStore(java.lang.String storeName)
Get one store by given name from repository.Store
getStoreOrThrow(java.lang.String storeName)
Store
refreshOneStore(java.lang.String storeName)
Selective refresh operation which fetches one store from ZKvoid
updateStore(Store store)
Update store in repository.-
Methods inherited from class com.linkedin.venice.helix.CachedReadOnlyStoreRepository
clear, getBatchGetLimit, getStoreFromZk, getStoresFromZk, getStoresFromZk, getStoreZkPath, getTotalStoreReadQuota, hasStore, isReadComputationEnabled, notifyStoreChanged, notifyStoreCreated, notifyStoreDeleted, putStore, refresh, registerStoreDataChangedListener, removeStore, 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
getBatchGetLimit, getTotalStoreReadQuota, hasStore, isReadComputationEnabled, registerStoreDataChangedListener, unregisterStoreDataChangedListener, waitVersion, waitVersion
-
Methods inherited from interface com.linkedin.venice.VeniceResource
clear, refresh
-
-
-
-
Constructor Detail
-
HelixReadWriteStoreRepository
public HelixReadWriteStoreRepository(org.apache.helix.zookeeper.impl.client.ZkClient zkClient, HelixAdapterSerializer compositeSerializer, java.lang.String clusterName, java.util.Optional<MetaStoreWriter> metaStoreWriter, ClusterLockManager storeLock)
-
-
Method Detail
-
addStore
public void addStore(Store store)
Description copied from interface:ReadWriteStoreRepository
Add store into repository.- Specified by:
addStore
in interfaceReadWriteStoreRepository
- Parameters:
store
- store need to be added.
-
updateStore
public void updateStore(Store store)
Description copied from interface:ReadWriteStoreRepository
Update store in repository.- Specified by:
updateStore
in interfaceReadWriteStoreRepository
- Parameters:
store
- store need to be udpated.
-
deleteStore
public void deleteStore(java.lang.String storeName)
Description copied from interface:ReadWriteStoreRepository
Delete store from repository.- Specified by:
deleteStore
in interfaceReadWriteStoreRepository
- Parameters:
storeName
- name of wantted store.
-
getStore
public Store getStore(java.lang.String storeName)
Description copied from interface:ReadOnlyStoreRepository
Get one store by given name from repository.- Specified by:
getStore
in interfaceReadOnlyStoreRepository
- Overrides:
getStore
in classCachedReadOnlyStoreRepository
- Parameters:
storeName
- name of wanted store.- Returns:
- Store for given name.
-
getStoreOrThrow
public Store getStoreOrThrow(java.lang.String storeName) throws VeniceNoStoreException
- Specified by:
getStoreOrThrow
in interfaceReadOnlyStoreRepository
- Overrides:
getStoreOrThrow
in classCachedReadOnlyStoreRepository
- Throws:
VeniceNoStoreException
-
getAllStores
public java.util.List<Store> getAllStores()
Description copied from interface:ReadOnlyStoreRepository
Get all stores in the current repository- Specified by:
getAllStores
in interfaceReadOnlyStoreRepository
- Overrides:
getAllStores
in classCachedReadOnlyStoreRepository
- Returns:
-
refreshOneStore
public Store refreshOneStore(java.lang.String storeName)
Description copied from interface:ReadOnlyStoreRepository
Selective refresh operation which fetches one store from ZK- Specified by:
refreshOneStore
in interfaceReadOnlyStoreRepository
- Overrides:
refreshOneStore
in classCachedReadOnlyStoreRepository
- Parameters:
storeName
- store name- Returns:
- the newly refreshed store
-
-