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 onMainIngestionStorageMetadataService
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
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 void
addIngestionNotifier(VeniceNotifier ingestionListener)
void
close()
java.util.concurrent.CompletableFuture<java.lang.Void>
dropStoragePartitionGracefully(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.Process
getIsolatedIngestionServiceProcess()
MainIngestionMonitorService
getMainIngestionMonitorService()
MainIngestionRequestClient
getMainIngestionRequestClient()
boolean
hasCurrentVersionBootstrapping()
Check whether there are any current version bootstrapping or not.void
killConsumptionTask(java.lang.String topicName)
void
removeStorageEngine(java.lang.String topicName)
void
setIsolatedIngestionServiceProcess(java.lang.Process process)
void
shutdownIngestionTask(java.lang.String topicName)
void
startConsumption(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, isOffsetLagged, 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:
startConsumption
in interfaceIngestionBackend
- Overrides:
startConsumption
in classDefaultIngestionBackend
-
stopConsumption
public java.util.concurrent.CompletableFuture<java.lang.Void> stopConsumption(VeniceStoreVersionConfig storeConfig, int partition)
- Specified by:
stopConsumption
in interfaceIngestionBackend
- Overrides:
stopConsumption
in classDefaultIngestionBackend
-
dropStoragePartitionGracefully
public java.util.concurrent.CompletableFuture<java.lang.Void> dropStoragePartitionGracefully(VeniceStoreVersionConfig storeConfig, int partition, int timeoutInSeconds, boolean removeEmptyStorageEngine)
Description copied from interface:IngestionBackend
This method stops to subscribe the specified topic partition and delete partition data from storage.- Specified by:
dropStoragePartitionGracefully
in interfaceIngestionBackend
- Overrides:
dropStoragePartitionGracefully
in 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
public void removeStorageEngine(java.lang.String topicName)
- Specified by:
removeStorageEngine
in interfaceIngestionBackend
- Overrides:
removeStorageEngine
in classDefaultIngestionBackend
-
killConsumptionTask
public void killConsumptionTask(java.lang.String topicName)
- Specified by:
killConsumptionTask
in interfaceIngestionBackend
- Overrides:
killConsumptionTask
in classDefaultIngestionBackend
-
shutdownIngestionTask
public void shutdownIngestionTask(java.lang.String topicName)
- Specified by:
shutdownIngestionTask
in interfaceIngestionBackend
- Overrides:
shutdownIngestionTask
in classDefaultIngestionBackend
-
addIngestionNotifier
public void addIngestionNotifier(VeniceNotifier ingestionListener)
- Specified by:
addIngestionNotifier
in interfaceIngestionBackend
- Overrides:
addIngestionNotifier
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classDefaultIngestionBackend
-
hasCurrentVersionBootstrapping
public boolean hasCurrentVersionBootstrapping()
Description copied from interface:IngestionBackend
Check whether there are any current version bootstrapping or not.- Specified by:
hasCurrentVersionBootstrapping
in interfaceIngestionBackend
- Overrides:
hasCurrentVersionBootstrapping
in classDefaultIngestionBackend
-
-