Class DefaultIngestionBackend

  • All Implemented Interfaces:
    IngestionBackend, java.io.Closeable, java.lang.AutoCloseable
    Direct Known Subclasses:
    IsolatedIngestionBackend

    public class DefaultIngestionBackend
    extends java.lang.Object
    implements IngestionBackend
    The default ingestion backend implementation. Ingestion will be done in the same JVM as the application.
    • Method Detail

      • isOffsetLagged

        public boolean isOffsetLagged​(java.lang.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 name
        versionNumber - the version number
        partition - the partition number
        blobTransferDisabledOffsetLagThreshold - 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
      • 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 interface IngestionBackend
        Parameters:
        storeConfig - Store version config
        partition - 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.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable