Class DaVinciBackend

java.lang.Object
com.linkedin.davinci.DaVinciBackend
All Implemented Interfaces:
Closeable, AutoCloseable

public class DaVinciBackend extends Object implements Closeable
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.
  • Constructor Details

  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • getStoreOrThrow

      public StoreBackend getStoreOrThrow(String storeName)
    • getStoreRepository

      public SubscriptionBasedReadOnlyStoreRepository getStoreRepository()
    • getObjectCache

      public ObjectCacheBackend getObjectCache()
    • getSchemaRepository

      public ReadOnlySchemaRepository getSchemaRepository()
    • getIngestionBackend

      public final IngestionBackend getIngestionBackend()
    • verifyCacheConfigEquality

      public void verifyCacheConfigEquality(@Nullable ObjectCacheConfig newObjectCacheConfig, String storeName)
    • getCompressorFactory

      public StorageEngineBackedCompressorFactory getCompressorFactory()
    • reportPushStatus

      protected void reportPushStatus(String kafkaTopic, int partition, ExecutionStatus status)
    • reportPushStatus

      protected void reportPushStatus(String kafkaTopic, int partition, ExecutionStatus status, Optional<String> incrementalPushVersion)
    • deleteStore

      protected void deleteStore(String storeName)
    • handleStoreChanged

      protected void handleStoreChanged(StoreBackend storeBackend)
    • getSubscribedVersionNumbers

      public Set<Integer> getSubscribedVersionNumbers(String storeName)
    • registerStoreClient

      public void registerStoreClient(String storeName, Integer storeVersion)
      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 for
      storeVersion - 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

      public void unregisterStoreClient(String storeName, Integer storeVersion)
    • getStoreClientType

      public DaVinciBackend.ClientType getStoreClientType(String storeName)
    • getVersionSpecificStoreVersion

      public Integer getVersionSpecificStoreVersion(String storeName)
    • getStoreClientRefCount

      public Integer getStoreClientRefCount(String storeName)
    • setStoreRepository

      public void setStoreRepository(SubscriptionBasedReadOnlyStoreRepository storeRepository)
    • setStorageService

      public void setStorageService(StorageService storageService)
    • setConfigLoader

      public void setConfigLoader(VeniceConfigLoader configLoader)
    • addStoreBackend

      public void addStoreBackend(String storeName, StoreBackend storeBackend)
    • 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

      public InternalDaVinciRecordTransformerConfig getInternalRecordTransformerConfig(String storeName)