Class VeniceAdaptiveIngestionThrottler

java.lang.Object
com.linkedin.venice.throttle.EventThrottler
com.linkedin.davinci.kafka.consumer.VeniceAdaptiveIngestionThrottler
All Implemented Interfaces:
VeniceAdaptiveThrottler, VeniceRateLimiter

public class VeniceAdaptiveIngestionThrottler extends EventThrottler implements VeniceAdaptiveThrottler
  • Constructor Details

    • VeniceAdaptiveIngestionThrottler

      public VeniceAdaptiveIngestionThrottler(int signalIdleThreshold, long quotaPerSecond, List<Double> factors, long timeWindow, String throttlerName)
  • Method Details

    • getThrottlerName

      public String getThrottlerName()
      Description copied from interface: VeniceAdaptiveThrottler
      Returns a human-readable name for this throttler instance.

      This is useful for logging, debugging, or monitoring purposes when multiple throttlers are in use.

      Specified by:
      getThrottlerName in interface VeniceAdaptiveThrottler
      Overrides:
      getThrottlerName in class EventThrottler
      Returns:
      the throttler’s name.
    • maybeThrottle

      public void maybeThrottle(double eventsSeen)
      Description copied from class: EventThrottler
      Sleeps if necessary to slow down the caller.
      Overrides:
      maybeThrottle in class EventThrottler
      Parameters:
      eventsSeen - Number of events seen since last invocation. Basis for determining whether its necessary to sleep.
    • registerLimiterSignal

      public void registerLimiterSignal(BooleanSupplier supplier)
      Description copied from interface: VeniceAdaptiveThrottler
      Registers a limiter signal supplier that, when evaluated to true, indicates that the throttler should reduce its throughput rate.
      Specified by:
      registerLimiterSignal in interface VeniceAdaptiveThrottler
      Parameters:
      supplier - a BooleanSupplier providing the limiter signal.
    • registerBoosterSignal

      public void registerBoosterSignal(BooleanSupplier supplier)
      Description copied from interface: VeniceAdaptiveThrottler
      Registers a booster signal supplier that, when evaluated to true, indicates that the throttler may safely increase its throughput rate.
      Specified by:
      registerBoosterSignal in interface VeniceAdaptiveThrottler
      Parameters:
      supplier - a BooleanSupplier providing the booster signal.
    • checkSignalAndAdjustThrottler

      public void checkSignalAndAdjustThrottler()
      Description copied from interface: VeniceAdaptiveThrottler
      Evaluates all registered limiter and booster signals, and adjusts the throttler’s rate accordingly. The exact adjustment strategy is defined by the implementation.
      Specified by:
      checkSignalAndAdjustThrottler in interface VeniceAdaptiveThrottler
    • getCurrentThrottlerRate

      public long getCurrentThrottlerRate()
      Description copied from interface: VeniceAdaptiveThrottler
      Returns the current effective throttler rate after adaptive adjustments.
      Specified by:
      getCurrentThrottlerRate in interface VeniceAdaptiveThrottler
      Returns:
      the current throttling rate, typically represented in operations per second or another unit defined by the implementation.