Package com.linkedin.davinci.ingestion
Class DefaultIngestionBackend
java.lang.Object
com.linkedin.davinci.ingestion.DefaultIngestionBackend
- All Implemented Interfaces:
IngestionBackend
,Closeable
,AutoCloseable
- Direct Known Subclasses:
IsolatedIngestionBackend
The default ingestion backend implementation. Ingestion will be done in the same JVM as the application.
-
Constructor Summary
ConstructorDescriptionDefaultIngestionBackend
(StorageMetadataService storageMetadataService, KafkaStoreIngestionService storeIngestionService, StorageService storageService, BlobTransferManager blobTransferManager, VeniceServerConfig serverConfig) -
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.boolean
isOffsetLagged
(String store, int versionNumber, int partition, long blobTransferDisabledOffsetLagThreshold) A helper method to check if the offset lag is within the allowed threshold.void
killConsumptionTask
(String topicName) void
removeStorageEngine
(String topicName) void
setStorageEngineReference
(String topicName, AtomicReference<AbstractStorageEngine> storageEngineReference) void
shutdownIngestionTask
(String topicName) void
startConsumption
(VeniceStoreVersionConfig storeConfig, int partition) stopConsumption
(VeniceStoreVersionConfig storeConfig, int partition) 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
-
Constructor Details
-
DefaultIngestionBackend
public DefaultIngestionBackend(StorageMetadataService storageMetadataService, KafkaStoreIngestionService storeIngestionService, StorageService storageService, BlobTransferManager blobTransferManager, VeniceServerConfig serverConfig)
-
-
Method Details
-
startConsumption
- Specified by:
startConsumption
in interfaceIngestionBackend
-
isOffsetLagged
public boolean isOffsetLagged(String store, int versionNumber, int partition, long blobTransferDisabledOffsetLagThreshold) A helper method to check if the offset lag is within the allowed threshold. If the offset lag is smaller than the `blobTransferDisabledOffsetLagThreshold`, bootstrapping from Kafka firstly, even if blob transfer is enabled.- Parameters:
store
- the store nameversionNumber
- the version numberpartition
- the partition numberblobTransferDisabledOffsetLagThreshold
- the maximum allowed offset lag threshold. If the offset lag is within this threshold, bootstrapping from Kafka is allowed, even if blob transfer is enabled. If the lag exceeds this threshold, bootstrapping should happen from blobs transfer firstly.- Returns:
- true if the offset lag exceeds the threshold or if the lag is 0, indicating bootstrapping should happen from blobs transfer. false otherwise
-
stopConsumption
- Specified by:
stopConsumption
in interfaceIngestionBackend
-
killConsumptionTask
- Specified by:
killConsumptionTask
in interfaceIngestionBackend
-
shutdownIngestionTask
- Specified by:
shutdownIngestionTask
in interfaceIngestionBackend
-
removeStorageEngine
- Specified by:
removeStorageEngine
in interfaceIngestionBackend
-
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
- 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.
-
addIngestionNotifier
- Specified by:
addIngestionNotifier
in interfaceIngestionBackend
-
setStorageEngineReference
public void setStorageEngineReference(String topicName, AtomicReference<AbstractStorageEngine> storageEngineReference) - Specified by:
setStorageEngineReference
in interfaceIngestionBackend
-
hasCurrentVersionBootstrapping
public boolean hasCurrentVersionBootstrapping()Description copied from interface:IngestionBackend
Check whether there are any current version bootstrapping or not.- Specified by:
hasCurrentVersionBootstrapping
in interfaceIngestionBackend
-
getStoreIngestionService
- Specified by:
getStoreIngestionService
in interfaceIngestionBackend
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-