Package com.linkedin.davinci
Class DaVinciBackend
java.lang.Object
com.linkedin.davinci.DaVinciBackend
- All Implemented Interfaces:
Closeable,AutoCloseable
Core backend service that powers all
DaVinciClient client instances with
shared infrastructure for storage, ingestion, and metadata management.
This backend is designed as a shared resource managed through a ReferenceCounted
pattern in AvroGenericDaVinciClient. Multiple DaVinci clients share the
same ingestion services and metadata repositories for resource efficiency.
DaVinciBackend tracks different client types (regular vs version-specific) to prevent collisions due to
the shared behavior of this class. Regular clients participate in version swaps while version-specific
clients subscribe to a fixed version and ignore version swap events.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDaVinciBackend(ClientConfig clientConfig, VeniceConfigLoader configLoader, Optional<Set<String>> managedClients, ICProvider icProvider, Optional<ObjectCacheConfig> cacheConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStoreBackend(String storeName, StoreBackend storeBackend) voidclose()static voidconfigureMonitoringForStore(VeniceConfigLoader configLoader, String storeName, Predicate<PubSubTopicPartition> positionFilter) Register before constructing ingestion services: their constructor eagerly builds the local consumer pool.protected voiddeleteStore(String storeName) final IngestionBackendgetInternalRecordTransformerConfig(String storeName) getStoreClientRefCount(String storeName) getStoreClientType(String storeName) getStoreOrThrow(String storeName) getSubscribedVersionNumbers(String storeName) getVersionSpecificStoreVersion(String storeName) protected voidhandleStoreChanged(StoreBackend storeBackend) booleanvoidregisterRecordTransformerConfig(String storeName, DaVinciRecordTransformerConfig recordTransformerConfig) voidregisterStoreClient(String storeName, Integer storeVersion) Registers a store client and enforces client type exclusivity per store.voidregisterStoreClient(String storeName, Integer storeVersion, Predicate<PubSubTopicPartition> monitoringFilter) A changelog consumer, identified by a non-null monitoring filter, must be its store's only client in this backend: ingestion tasks bind to one record transformer, so another client of the same store would share its callbacks.protected voidreportPushStatus(String kafkaTopic, int partition, ExecutionStatus status) protected voidreportPushStatus(String kafkaTopic, int partition, ExecutionStatus status, Optional<String> incrementalPushVersion) voidsetConfigLoader(VeniceConfigLoader configLoader) voidsetStorageService(StorageService storageService) voidsetStoreRepository(SubscriptionBasedReadOnlyStoreRepository storeRepository) voidunregisterStoreClient(String storeName, Integer storeVersion) voidverifyCacheConfigEquality(ObjectCacheConfig newObjectCacheConfig, String storeName)
-
Constructor Details
-
DaVinciBackend
public DaVinciBackend(ClientConfig clientConfig, VeniceConfigLoader configLoader, Optional<Set<String>> managedClients, ICProvider icProvider, Optional<ObjectCacheConfig> cacheConfig)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getStoreOrThrow
-
getStoreRepository
-
getObjectCache
-
getSchemaRepository
-
getIngestionBackend
-
verifyCacheConfigEquality
public void verifyCacheConfigEquality(@Nullable ObjectCacheConfig newObjectCacheConfig, String storeName) -
getCompressorFactory
-
reportPushStatus
-
reportPushStatus
protected void reportPushStatus(String kafkaTopic, int partition, ExecutionStatus status, Optional<String> incrementalPushVersion) -
deleteStore
-
handleStoreChanged
-
getSubscribedVersionNumbers
-
registerStoreClient
Registers a store client and enforces client type exclusivity per store. Prevents mixing regular and version-specific clients for the same store.- Parameters:
storeName- the name of the store to register a client forstoreVersion- the target version for version-specific clients, or null for regular clients- Throws:
VeniceClientException- if there is a client type conflict or multiple version-specific clients target different versions of the same store
-
registerStoreClient
public void registerStoreClient(String storeName, Integer storeVersion, Predicate<PubSubTopicPartition> monitoringFilter) A changelog consumer, identified by a non-null monitoring filter, must be its store's only client in this backend: ingestion tasks bind to one record transformer, so another client of the same store would share its callbacks. -
unregisterStoreClient
-
getStoreClientType
-
getVersionSpecificStoreVersion
-
getStoreClientRefCount
-
setStoreRepository
-
setStorageService
-
setConfigLoader
-
addStoreBackend
-
hasCurrentVersionBootstrapping
public boolean hasCurrentVersionBootstrapping() -
registerRecordTransformerConfig
public void registerRecordTransformerConfig(String storeName, DaVinciRecordTransformerConfig recordTransformerConfig) -
configureMonitoringForStore
public static void configureMonitoringForStore(VeniceConfigLoader configLoader, String storeName, Predicate<PubSubTopicPartition> positionFilter) Register before constructing ingestion services: their constructor eagerly builds the local consumer pool. Reused backends call the same path with their actual configuration before adding another CDC store. -
getInternalRecordTransformerConfig
-