Interface VeniceAdaptiveThrottler

All Known Implementing Classes:
VeniceAdaptiveBlobTransferTrafficThrottler, VeniceAdaptiveIngestionThrottler

public interface VeniceAdaptiveThrottler
The VeniceAdaptiveThrottler interface defines a contract for adaptive throttling mechanisms that can dynamically adjust their throughput limits based on external signals.

Implementations are expected to:

  • Register limiter signals (conditions that reduce or restrict throughput).
  • Register booster signals (conditions that allow higher throughput).
  • Periodically check these signals and adjust the throttler configuration accordingly.
  • Expose the current effective throttling rate and a name for identification.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Evaluates all registered limiter and booster signals, and adjusts the throttler’s rate accordingly.
    long
    Returns the current effective throttler rate after adaptive adjustments.
    Returns a human-readable name for this throttler instance.
    void
    Registers a booster signal supplier that, when evaluated to true, indicates that the throttler may safely increase its throughput rate.
    void
    Registers a limiter signal supplier that, when evaluated to true, indicates that the throttler should reduce its throughput rate.
  • Method Details

    • registerLimiterSignal

      void registerLimiterSignal(BooleanSupplier supplier)
      Registers a limiter signal supplier that, when evaluated to true, indicates that the throttler should reduce its throughput rate.
      Parameters:
      supplier - a BooleanSupplier providing the limiter signal.
    • registerBoosterSignal

      void registerBoosterSignal(BooleanSupplier supplier)
      Registers a booster signal supplier that, when evaluated to true, indicates that the throttler may safely increase its throughput rate.
      Parameters:
      supplier - a BooleanSupplier providing the booster signal.
    • checkSignalAndAdjustThrottler

      void checkSignalAndAdjustThrottler()
      Evaluates all registered limiter and booster signals, and adjusts the throttler’s rate accordingly. The exact adjustment strategy is defined by the implementation.
    • getCurrentThrottlerRate

      long getCurrentThrottlerRate()
      Returns the current effective throttler rate after adaptive adjustments.
      Returns:
      the current throttling rate, typically represented in operations per second or another unit defined by the implementation.
    • getThrottlerName

      String getThrottlerName()
      Returns a human-readable name for this throttler instance.

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

      Returns:
      the throttler’s name.