Package com.linkedin.venice.helix
Class HelixReadOnlyStoreRepositoryAdapter
- java.lang.Object
-
- com.linkedin.venice.helix.HelixReadOnlyStoreRepositoryAdapter
-
- All Implemented Interfaces:
ReadOnlyStoreRepository
,VeniceResource
- Direct Known Subclasses:
HelixReadWriteStoreRepositoryAdapter
public class HelixReadOnlyStoreRepositoryAdapter extends java.lang.Object implements ReadOnlyStoreRepository
This repository provides an read only interface to access both system store and regular venice store.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
HelixReadOnlyStoreRepositoryAdapter.VeniceStoreDataChangedListener
StoreDataChangedListener
to handle all the events fromregularStoreDataChangedListener
.
-
Constructor Summary
Constructors Constructor Description HelixReadOnlyStoreRepositoryAdapter(HelixReadOnlyZKSharedSystemStoreRepository systemStoreRepository, ReadOnlyStoreRepository regularStoreRepository, java.lang.String clusterName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
java.util.List<Store>
getAllStores()
So far, this function will return the regular Venice stores + the corresponding meta system store.int
getBatchGetLimit(java.lang.String storeName)
Get batch-get limit for the specified storeStore
getStore(java.lang.String storeName)
Get one store by given name from repository.Store
getStoreOrThrow(java.lang.String storeName)
long
getTotalStoreReadQuota()
Get total read quota of all stores.boolean
hasStore(java.lang.String storeName)
Whether the store exists or not.boolean
isReadComputationEnabled(java.lang.String storeName)
Whether computation is enabled for the specified store.void
refresh()
Store
refreshOneStore(java.lang.String storeName)
Selective refresh operation which fetches one store from ZKvoid
registerStoreDataChangedListener(StoreDataChangedListener listener)
Register store data change listener.void
unregisterStoreDataChangedListener(StoreDataChangedListener listener)
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
-
-
-
-
Constructor Detail
-
HelixReadOnlyStoreRepositoryAdapter
public HelixReadOnlyStoreRepositoryAdapter(HelixReadOnlyZKSharedSystemStoreRepository systemStoreRepository, ReadOnlyStoreRepository regularStoreRepository, java.lang.String clusterName)
-
-
Method Detail
-
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
- 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
- Throws:
VeniceNoStoreException
-
hasStore
public boolean hasStore(java.lang.String storeName)
Description copied from interface:ReadOnlyStoreRepository
Whether the store exists or not.- Specified by:
hasStore
in interfaceReadOnlyStoreRepository
- Parameters:
storeName
- store name- 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
- Parameters:
storeName
- store name- Returns:
- the newly refreshed store
-
getAllStores
public java.util.List<Store> getAllStores()
So far, this function will return the regular Venice stores + the corresponding meta system store. TODO: if we want to support more system store types in this repo, we need to modify this function accordingly.- 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
-
registerStoreDataChangedListener
public void registerStoreDataChangedListener(StoreDataChangedListener listener)
Description copied from interface:ReadOnlyStoreRepository
Register store data change listener.- Specified by:
registerStoreDataChangedListener
in interfaceReadOnlyStoreRepository
-
unregisterStoreDataChangedListener
public void unregisterStoreDataChangedListener(StoreDataChangedListener listener)
Description copied from interface:ReadOnlyStoreRepository
Unregister store data change listener.- Specified by:
unregisterStoreDataChangedListener
in interfaceReadOnlyStoreRepository
-
getBatchGetLimit
public int getBatchGetLimit(java.lang.String storeName)
Description copied from interface:ReadOnlyStoreRepository
Get batch-get limit for the specified store- Specified by:
getBatchGetLimit
in interfaceReadOnlyStoreRepository
- Returns:
-
isReadComputationEnabled
public boolean isReadComputationEnabled(java.lang.String storeName)
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
-
clear
public void clear()
- Specified by:
clear
in interfaceVeniceResource
-
-