Package com.linkedin.davinci.ingestion
Class IsolatedIngestionBackend
- java.lang.Object
-
- com.linkedin.davinci.ingestion.DefaultIngestionBackend
-
- com.linkedin.davinci.ingestion.IsolatedIngestionBackend
-
- All Implemented Interfaces:
IngestionBackend,java.io.Closeable,java.lang.AutoCloseable
public class IsolatedIngestionBackend extends DefaultIngestionBackend implements IngestionBackend
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 onMainIngestionStorageMetadataServiceto 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
Constructors Constructor Description IsolatedIngestionBackend(VeniceConfigLoader configLoader, io.tehuti.metrics.MetricsRepository metricsRepository, StorageMetadataService storageMetadataService, KafkaStoreIngestionService storeIngestionService, StorageService storageService, BlobTransferManager blobTransferManager, java.util.function.Function<java.lang.String,java.lang.Integer> currentVersionSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIngestionNotifier(VeniceNotifier ingestionListener)voidclose()voiddropStoragePartitionGracefully(VeniceStoreVersionConfig storeConfig, int partition, int timeoutInSeconds, boolean removeEmptyStorageEngine)This method stops to subscribe the specified topic partition and delete partition data from storage.java.lang.ProcessgetIsolatedIngestionServiceProcess()MainIngestionMonitorServicegetMainIngestionMonitorService()MainIngestionRequestClientgetMainIngestionRequestClient()booleanhasCurrentVersionBootstrapping()Check whether there are any current version bootstrapping or not.voidkillConsumptionTask(java.lang.String topicName)voidremoveStorageEngine(java.lang.String topicName)voidsetIsolatedIngestionServiceProcess(java.lang.Process process)voidshutdownIngestionTask(java.lang.String topicName)voidstartConsumption(VeniceStoreVersionConfig storeConfig, int partition)java.util.concurrent.CompletableFuture<java.lang.Void>stopConsumption(VeniceStoreVersionConfig storeConfig, int partition)-
Methods inherited from class com.linkedin.davinci.ingestion.DefaultIngestionBackend
getStoreIngestionService, setStorageEngineReference
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.linkedin.davinci.ingestion.IngestionBackend
dropStoragePartitionGracefully, getStoreIngestionService, setStorageEngineReference
-
-
-
-
Constructor Detail
-
IsolatedIngestionBackend
public IsolatedIngestionBackend(VeniceConfigLoader configLoader, io.tehuti.metrics.MetricsRepository metricsRepository, StorageMetadataService storageMetadataService, KafkaStoreIngestionService storeIngestionService, StorageService storageService, BlobTransferManager blobTransferManager, java.util.function.Function<java.lang.String,java.lang.Integer> currentVersionSupplier)
-
-
Method Detail
-
startConsumption
public void startConsumption(VeniceStoreVersionConfig storeConfig, int partition)
- Specified by:
startConsumptionin interfaceIngestionBackend- Overrides:
startConsumptionin classDefaultIngestionBackend
-
stopConsumption
public java.util.concurrent.CompletableFuture<java.lang.Void> stopConsumption(VeniceStoreVersionConfig storeConfig, int partition)
- Specified by:
stopConsumptionin interfaceIngestionBackend- Overrides:
stopConsumptionin classDefaultIngestionBackend
-
dropStoragePartitionGracefully
public 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.
-
removeStorageEngine
public void removeStorageEngine(java.lang.String topicName)
- Specified by:
removeStorageEnginein interfaceIngestionBackend- Overrides:
removeStorageEnginein classDefaultIngestionBackend
-
killConsumptionTask
public void killConsumptionTask(java.lang.String topicName)
- Specified by:
killConsumptionTaskin interfaceIngestionBackend- Overrides:
killConsumptionTaskin classDefaultIngestionBackend
-
shutdownIngestionTask
public void shutdownIngestionTask(java.lang.String topicName)
- Specified by:
shutdownIngestionTaskin interfaceIngestionBackend- Overrides:
shutdownIngestionTaskin classDefaultIngestionBackend
-
addIngestionNotifier
public void addIngestionNotifier(VeniceNotifier ingestionListener)
- Specified by:
addIngestionNotifierin interfaceIngestionBackend- Overrides:
addIngestionNotifierin classDefaultIngestionBackend
-
setIsolatedIngestionServiceProcess
public void setIsolatedIngestionServiceProcess(java.lang.Process process)
-
getIsolatedIngestionServiceProcess
public java.lang.Process getIsolatedIngestionServiceProcess()
-
getMainIngestionMonitorService
public MainIngestionMonitorService getMainIngestionMonitorService()
-
getMainIngestionRequestClient
public MainIngestionRequestClient getMainIngestionRequestClient()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- 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
-
-