Package com.linkedin.davinci.repository
Class NativeMetadataRepositoryViewAdapter
java.lang.Object
com.linkedin.davinci.repository.NativeMetadataRepositoryViewAdapter
- All Implemented Interfaces:
- SubscribedViewStoreProvider,- ClusterInfoProvider,- ReadOnlySchemaRepository,- ReadOnlyStoreRepository,- SubscriptionBasedReadOnlyStoreRepository,- VeniceResource
public class NativeMetadataRepositoryViewAdapter
extends Object
implements SubscriptionBasedReadOnlyStoreRepository, ReadOnlySchemaRepository, ClusterInfoProvider, SubscribedViewStoreProvider
Adapter that provides read only interface to access store, schema and cluster info using the underlying
 
NativeMetadataRepository for both regular Venice stores and Venice view stores. Intended for client
 libraries like DaVinci and CC clients which need to consume and materialize store views.- 
Constructor SummaryConstructorsConstructorDescriptionNativeMetadataRepositoryViewAdapter(NativeMetadataRepository nativeMetadataRepository) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidclear()This method will only return all the subscribed Venice stores and not include the view stores for the following reasons: 1.intgetBatchGetLimit(String storeName) Get batch-get limit for the specified storegetDerivedSchema(String storeName, int valueSchemaId, int writeComputeSchemaId) getDerivedSchemaId(String storeName, String derivedSchemaStr) Look up derived schema id and its corresponding value schema id by given store name and derived schema.getDerivedSchemas(String storeName) getKeySchema(String storeName) Get key schema for the given store.getLatestDerivedSchema(String storeName, int valueSchemaId) Get the most recent derived schema added to the given store and value schema idgetReplicationMetadataSchema(String storeName, int valueSchemaId, int replicationMetadataVersionId) getReplicationMetadataSchemas(String storeName) Get one store by given name from repository.getStoreOrThrow(String storeName) getSubscribedViewStores(String storeName) getSupersetOrLatestValueSchema(String storeName) Get the most recent value schema or superset value schema if one exists.getSupersetSchema(String storeName) Get the superset value schema for a given store.longGet total read quota of all stores.getValueSchema(String storeName, int id) Get value schema for the given store and value schema id.intgetValueSchemaId(String storeName, String valueSchemaStr) Return the schema ID of any schema that has the same parsing canonical form as the schema provided.getValueSchemas(String storeName) Get all the value schemas for the given store.getVeniceCluster(String storeName) Get the associated Venice cluster name given a Venice store name.booleanWhether the store exists or not.booleanhasValueSchema(String storeName, int id) Check whether the specified schema id is valid or notbooleanisReadComputationEnabled(String storeName) Whether computation is enabled for the specified store.voidrefresh()refreshOneStore(String storeName) Selective refresh operation which fetches one store from ZKvoidRegister store data change listener.voidvoidUnregister store data change listener.voidunsubscribe(String storeName) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.venice.meta.ReadOnlySchemaRepositorygetLatestDerivedSchemaMethods inherited from interface com.linkedin.venice.meta.ReadOnlyStoreRepositorywaitVersion, waitVersion
- 
Constructor Details- 
NativeMetadataRepositoryViewAdapter
 
- 
- 
Method Details- 
refreshpublic void refresh()- Specified by:
- refreshin interface- VeniceResource
 
- 
clearpublic void clear()- Specified by:
- clearin interface- VeniceResource
 
- 
getVeniceClusterDescription copied from interface:ClusterInfoProviderGet the associated Venice cluster name given a Venice store name.- Specified by:
- getVeniceClusterin interface- ClusterInfoProvider
- Returns:
- the cluster name that the store belongs to or null if such information cannot be provided.
 
- 
getKeySchemaDescription copied from interface:ReadOnlySchemaRepositoryGet key schema for the given store.- Specified by:
- getKeySchemain interface- ReadOnlySchemaRepository
 
- 
getValueSchemaDescription copied from interface:ReadOnlySchemaRepositoryGet value schema for the given store and value schema id.- Specified by:
- getValueSchemain interface- ReadOnlySchemaRepository
 
- 
hasValueSchemaDescription copied from interface:ReadOnlySchemaRepositoryCheck whether the specified schema id is valid or not- Specified by:
- hasValueSchemain interface- ReadOnlySchemaRepository
 
- 
getValueSchemaIdDescription copied from interface:ReadOnlySchemaRepositoryReturn the schema ID of any schema that has the same parsing canonical form as the schema provided. If multiple schemas have the same parsing canonical form, return the one with the largest ID.- Specified by:
- getValueSchemaIdin interface- ReadOnlySchemaRepository
 
- 
getValueSchemasDescription copied from interface:ReadOnlySchemaRepositoryGet all the value schemas for the given store.- Specified by:
- getValueSchemasin interface- ReadOnlySchemaRepository
 
- 
getSupersetOrLatestValueSchemaDescription copied from interface:ReadOnlySchemaRepositoryGet the most recent value schema or superset value schema if one exists.- Specified by:
- getSupersetOrLatestValueSchemain interface- ReadOnlySchemaRepository
 
- 
getSupersetSchemaDescription copied from interface:ReadOnlySchemaRepositoryGet the superset value schema for a given store. Each store has at most one active superset schema. Specifically a store must have some features enabled (e.g. read compute, write compute) to have a superset value schema which evolves as new value schemas are added.- Specified by:
- getSupersetSchemain interface- ReadOnlySchemaRepository
- Returns:
- Superset value schema or nullif store does not have any superset value schema.
 
- 
getDerivedSchemaIdDescription copied from interface:ReadOnlySchemaRepositoryLook up derived schema id and its corresponding value schema id by given store name and derived schema. This is likely used by clients that write to Venice- Specified by:
- getDerivedSchemaIdin interface- ReadOnlySchemaRepository
- Returns:
- a pair where the first value is value schema id and the second value is derived schema id
 
- 
getDerivedSchemapublic DerivedSchemaEntry getDerivedSchema(String storeName, int valueSchemaId, int writeComputeSchemaId) - Specified by:
- getDerivedSchemain interface- ReadOnlySchemaRepository
 
- 
getDerivedSchemas- Specified by:
- getDerivedSchemasin interface- ReadOnlySchemaRepository
 
- 
getLatestDerivedSchemaDescription copied from interface:ReadOnlySchemaRepositoryGet the most recent derived schema added to the given store and value schema id- Specified by:
- getLatestDerivedSchemain interface- ReadOnlySchemaRepository
 
- 
getReplicationMetadataSchemapublic RmdSchemaEntry getReplicationMetadataSchema(String storeName, int valueSchemaId, int replicationMetadataVersionId) - Specified by:
- getReplicationMetadataSchemain interface- ReadOnlySchemaRepository
 
- 
getReplicationMetadataSchemas- Specified by:
- getReplicationMetadataSchemasin interface- ReadOnlySchemaRepository
 
- 
getStoreDescription copied from interface:ReadOnlyStoreRepositoryGet one store by given name from repository.- Specified by:
- getStorein interface- ReadOnlyStoreRepository
- Parameters:
- storeName- name of wanted store.
- Returns:
- Store for given name.
 
- 
getStoreOrThrow- Specified by:
- getStoreOrThrowin interface- ReadOnlyStoreRepository
- Throws:
- VeniceNoStoreException
 
- 
hasStoreDescription copied from interface:ReadOnlyStoreRepositoryWhether the store exists or not.- Specified by:
- hasStorein interface- ReadOnlyStoreRepository
- Parameters:
- storeName- store name
- Returns:
 
- 
refreshOneStoreDescription copied from interface:ReadOnlyStoreRepositorySelective refresh operation which fetches one store from ZK- Specified by:
- refreshOneStorein interface- ReadOnlyStoreRepository
- Parameters:
- storeName- store name
- Returns:
- the newly refreshed store
 
- 
getAllStoresThis method will only return all the subscribed Venice stores and not include the view stores for the following reasons: 1. Currently, there is no usage of get all view stores. 2. The purpose of this adapter is to allow consumers to work with view stores without having to leak view store specific logic everywhere. If the repository included view stores in getAllStores() then callers will need to understand and differentiate view stores in order to avoid unexpected behaviors.- Specified by:
- getAllStoresin interface- ReadOnlyStoreRepository
- Returns:
 
- 
getTotalStoreReadQuotapublic long getTotalStoreReadQuota()Description copied from interface:ReadOnlyStoreRepositoryGet total read quota of all stores.- Specified by:
- getTotalStoreReadQuotain interface- ReadOnlyStoreRepository
 
- 
registerStoreDataChangedListenerDescription copied from interface:ReadOnlyStoreRepositoryRegister store data change listener.- Specified by:
- registerStoreDataChangedListenerin interface- ReadOnlyStoreRepository
 
- 
unregisterStoreDataChangedListenerDescription copied from interface:ReadOnlyStoreRepositoryUnregister store data change listener.- Specified by:
- unregisterStoreDataChangedListenerin interface- ReadOnlyStoreRepository
 
- 
getBatchGetLimitDescription copied from interface:ReadOnlyStoreRepositoryGet batch-get limit for the specified store- Specified by:
- getBatchGetLimitin interface- ReadOnlyStoreRepository
- Returns:
 
- 
isReadComputationEnabledDescription copied from interface:ReadOnlyStoreRepositoryWhether computation is enabled for the specified store.- Specified by:
- isReadComputationEnabledin interface- ReadOnlyStoreRepository
- Parameters:
- storeName- store name
- Returns:
 
- 
subscribe- Specified by:
- subscribein interface- SubscriptionBasedReadOnlyStoreRepository
- Throws:
- InterruptedException
 
- 
unsubscribe- Specified by:
- unsubscribein interface- SubscriptionBasedReadOnlyStoreRepository
 
- 
getSubscribedViewStores- Specified by:
- getSubscribedViewStoresin interface- SubscribedViewStoreProvider
- Parameters:
- storeName- of the Venice store.
- Returns:
- a set of subscribed view store names associated with the provided Venice store.
 
 
-