Package com.linkedin.davinci.ingestion
Class IsolatedIngestionBackend
java.lang.Object
com.linkedin.davinci.ingestion.DefaultIngestionBackend
com.linkedin.davinci.ingestion.IsolatedIngestionBackend
- All Implemented Interfaces:
IngestionBackend,Closeable,AutoCloseable
This class is the implementation of ingestion backend designed for ingestion isolation.
It contains references to local ingestion components - including storage metadata service, storage service and store
ingestion service that serves local ingestion, as well as ingestion request client that sends commands to isolated
ingestion service process and ingestion listener that listens to ingestion reports from child process.
Since RocksDB storage can only be owned by a single process, we have decided to keep metadata partition storage opened
in child process and in the main process, we rely on
MainIngestionStorageMetadataService to serve as the in-memory
metadata cache and persist the metadata updates from main process to metadata partition in child process.
Topic partition ingestion requests will first be sent to child process and after COMPLETED is reported, they will be
re-subscribed in main process to serve read traffics for user application and receive future updates.
The implementation of APIs in this class should consider the states in both main process and child process, as we need
to make sure we send the command to the correct process which holds the target storage engine.-
Constructor Summary
ConstructorsConstructorDescriptionIsolatedIngestionBackend(VeniceConfigLoader configLoader, io.tehuti.metrics.MetricsRepository metricsRepository, StorageMetadataService storageMetadataService, KafkaStoreIngestionService storeIngestionService, StorageService storageService, BlobTransferManager blobTransferManager, Function<String, Integer> currentVersionSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIngestionNotifier(VeniceNotifier ingestionListener) voidclose()dropStoragePartitionGracefully(VeniceStoreVersionConfig storeConfig, int partition, int timeoutInSeconds, boolean removeEmptyStorageEngine) This method stops to subscribe the specified topic partition and delete partition data from storage.booleanCheck whether there are any current version bootstrapping or not.voidkillConsumptionTask(String topicName) voidremoveStorageEngine(String topicName) voidvoidshutdownIngestionTask(String topicName) voidstartConsumption(VeniceStoreVersionConfig storeConfig, int partition, Optional<PubSubPosition> pubSubPosition) stopConsumption(VeniceStoreVersionConfig storeConfig, int partition) Methods inherited from class com.linkedin.davinci.ingestion.DefaultIngestionBackend
getStoreIngestionService, isOffsetLagged, setStorageEngineReferenceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.linkedin.davinci.ingestion.IngestionBackend
dropStoragePartitionGracefully, getStoreIngestionService, setStorageEngineReference
-
Constructor Details
-
IsolatedIngestionBackend
public IsolatedIngestionBackend(VeniceConfigLoader configLoader, io.tehuti.metrics.MetricsRepository metricsRepository, StorageMetadataService storageMetadataService, KafkaStoreIngestionService storeIngestionService, StorageService storageService, BlobTransferManager blobTransferManager, Function<String, Integer> currentVersionSupplier)
-
-
Method Details
-
startConsumption
public void startConsumption(VeniceStoreVersionConfig storeConfig, int partition, Optional<PubSubPosition> pubSubPosition) - Specified by:
startConsumptionin interfaceIngestionBackend- Overrides:
startConsumptionin classDefaultIngestionBackend
-
stopConsumption
- Specified by:
stopConsumptionin interfaceIngestionBackend- Overrides:
stopConsumptionin classDefaultIngestionBackend
-
dropStoragePartitionGracefully
public CompletableFuture<Void> dropStoragePartitionGracefully(VeniceStoreVersionConfig storeConfig, int partition, int timeoutInSeconds, boolean removeEmptyStorageEngine) Description copied from interface:IngestionBackendThis method stops to subscribe the specified topic partition and delete partition data from storage.- Specified by:
dropStoragePartitionGracefullyin interfaceIngestionBackend- Overrides:
dropStoragePartitionGracefullyin classDefaultIngestionBackend- Parameters:
storeConfig- Store version configpartition- Partition number to be dropped in the store version.timeoutInSeconds- Number of seconds to wait before timeout.removeEmptyStorageEngine- Whether to drop storage engine when dropping the last partition.- Returns:
- a future for the drop partition action.
-
removeStorageEngine
- Specified by:
removeStorageEnginein interfaceIngestionBackend- Overrides:
removeStorageEnginein classDefaultIngestionBackend
-
killConsumptionTask
- Specified by:
killConsumptionTaskin interfaceIngestionBackend- Overrides:
killConsumptionTaskin classDefaultIngestionBackend
-
shutdownIngestionTask
- Specified by:
shutdownIngestionTaskin interfaceIngestionBackend- Overrides:
shutdownIngestionTaskin classDefaultIngestionBackend
-
addIngestionNotifier
- Specified by:
addIngestionNotifierin interfaceIngestionBackend- Overrides:
addIngestionNotifierin classDefaultIngestionBackend
-
setIsolatedIngestionServiceProcess
-
getIsolatedIngestionServiceProcess
-
getMainIngestionMonitorService
-
getMainIngestionRequestClient
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classDefaultIngestionBackend
-
hasCurrentVersionBootstrapping
public boolean hasCurrentVersionBootstrapping()Description copied from interface:IngestionBackendCheck whether there are any current version bootstrapping or not.- Specified by:
hasCurrentVersionBootstrappingin interfaceIngestionBackend- Overrides:
hasCurrentVersionBootstrappingin classDefaultIngestionBackend
-