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 TypeMethodDescriptionvoid
addIngestionNotifier
(VeniceNotifier ingestionListener) void
close()
dropStoragePartitionGracefully
(VeniceStoreVersionConfig storeConfig, int partition, int timeoutInSeconds, boolean removeEmptyStorageEngine) This method stops to subscribe the specified topic partition and delete partition data from storage.boolean
Check whether there are any current version bootstrapping or not.void
killConsumptionTask
(String topicName) void
removeStorageEngine
(String topicName) void
void
shutdownIngestionTask
(String topicName) void
startConsumption
(VeniceStoreVersionConfig storeConfig, int partition) 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 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
- Specified by:
startConsumption
in interfaceIngestionBackend
- Overrides:
startConsumption
in classDefaultIngestionBackend
-
stopConsumption
- Specified by:
stopConsumption
in interfaceIngestionBackend
- Overrides:
stopConsumption
in classDefaultIngestionBackend
-
dropStoragePartitionGracefully
public CompletableFuture<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
- Specified by:
removeStorageEngine
in interfaceIngestionBackend
- Overrides:
removeStorageEngine
in classDefaultIngestionBackend
-
killConsumptionTask
- Specified by:
killConsumptionTask
in interfaceIngestionBackend
- Overrides:
killConsumptionTask
in classDefaultIngestionBackend
-
shutdownIngestionTask
- Specified by:
shutdownIngestionTask
in interfaceIngestionBackend
- Overrides:
shutdownIngestionTask
in classDefaultIngestionBackend
-
addIngestionNotifier
- Specified by:
addIngestionNotifier
in interfaceIngestionBackend
- Overrides:
addIngestionNotifier
in classDefaultIngestionBackend
-
setIsolatedIngestionServiceProcess
-
getIsolatedIngestionServiceProcess
-
getMainIngestionMonitorService
-
getMainIngestionRequestClient
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- 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
-