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
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.linkedin.venice.throttle.VeniceRateLimiter
VeniceRateLimiter.RateLimiterType
-
Field Summary
Fields inherited from class com.linkedin.venice.throttle.EventThrottler
BLOCK_STRATEGY, REJECT_STRATEGY
-
Constructor Summary
ConstructorsConstructorDescriptionVeniceAdaptiveIngestionThrottler
(int signalIdleThreshold, long quotaPerSecond, List<Double> factors, long timeWindow, String throttlerName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
maybeThrottle
(double eventsSeen) Sleeps if necessary to slow down the caller.void
registerBoosterSignal
(BooleanSupplier supplier) Registers a booster signal supplier that, when evaluated totrue
, indicates that the throttler may safely increase its throughput rate.void
registerLimiterSignal
(BooleanSupplier supplier) Registers a limiter signal supplier that, when evaluated totrue
, indicates that the throttler should reduce its throughput rate.Methods inherited from class com.linkedin.venice.throttle.EventThrottler
getConfiguredMaxRatePerSecond, getMaxRatePerSecond, getQuota, getRateConfig, getTime, isCheckQuotaBeforeRecording, setQuota, toString, tryAcquirePermit
-
Constructor Details
-
VeniceAdaptiveIngestionThrottler
-
-
Method Details
-
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 interfaceVeniceAdaptiveThrottler
- Overrides:
getThrottlerName
in classEventThrottler
- 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 classEventThrottler
- Parameters:
eventsSeen
- Number of events seen since last invocation. Basis for determining whether its necessary to sleep.
-
registerLimiterSignal
Description copied from interface:VeniceAdaptiveThrottler
Registers a limiter signal supplier that, when evaluated totrue
, indicates that the throttler should reduce its throughput rate.- Specified by:
registerLimiterSignal
in interfaceVeniceAdaptiveThrottler
- Parameters:
supplier
- aBooleanSupplier
providing the limiter signal.
-
registerBoosterSignal
Description copied from interface:VeniceAdaptiveThrottler
Registers a booster signal supplier that, when evaluated totrue
, indicates that the throttler may safely increase its throughput rate.- Specified by:
registerBoosterSignal
in interfaceVeniceAdaptiveThrottler
- Parameters:
supplier
- aBooleanSupplier
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 interfaceVeniceAdaptiveThrottler
-
getCurrentThrottlerRate
public long getCurrentThrottlerRate()Description copied from interface:VeniceAdaptiveThrottler
Returns the current effective throttler rate after adaptive adjustments.- Specified by:
getCurrentThrottlerRate
in interfaceVeniceAdaptiveThrottler
- Returns:
- the current throttling rate, typically represented in operations per second or another unit defined by the implementation.
-