Class IngestionThrottler

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class IngestionThrottler
    extends java.lang.Object
    implements java.io.Closeable
    This throttler has the following functionality: 1. When running in DaVinci mode, if there are active current version bootstrapping with speedup mode is on, this ingestion throttler will switch to speedup throttler. 2. Otherwise, this class will switch to regular throttler. This throttler is supposed to be adaptive throttler to speed up the DaVinci bootstrapping and fall back to the regular mode when the bootstrapping is done.
    • Constructor Detail

      • IngestionThrottler

        public IngestionThrottler​(boolean isDaVinciClient,
                                  VeniceServerConfig serverConfig,
                                  java.util.function.Supplier<java.util.Map<java.lang.String,​StoreIngestionTask>> ongoingIngestionTaskMapSupplier)
      • IngestionThrottler

        public IngestionThrottler​(boolean isDaVinciClient,
                                  VeniceServerConfig serverConfig,
                                  java.util.function.Supplier<java.util.Map<java.lang.String,​StoreIngestionTask>> ongoingIngestionTaskMapSupplier,
                                  int checkInterval,
                                  java.util.concurrent.TimeUnit checkTimeUnit)
    • Method Detail

      • maybeThrottleRecordRate

        public void maybeThrottleRecordRate​(ConsumerPoolType poolType,
                                            int count)
      • maybeThrottleBandwidth

        public void maybeThrottleBandwidth​(int totalBytes)
      • isUsingSpeedupThrottler

        public boolean isUsingSpeedupThrottler()
      • close

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