Class BucketRateLimiter<T>
java.lang.Object
io.kubernetes.client.extended.workqueue.ratelimiter.BucketRateLimiter<T>
- All Implemented Interfaces:
RateLimiter<T>
A light-weight token bucket implementation for RateLimiter.
-
Constructor Summary
ConstructorsConstructorDescriptionBucketRateLimiter(long capacity, long tokensGeneratedInPeriod, Duration period) -
Method Summary
-
Constructor Details
-
BucketRateLimiter
- Parameters:
capacity- Capacity is the maximum number of tokens can be consumed.tokensGeneratedInPeriod- Tokens generated in period.period- Period that generating specific number of tokens.
-
-
Method Details
-
when
Description copied from interface:RateLimiterWhen gets an item and gets to decide how long that item should wait- Specified by:
whenin interfaceRateLimiter<T>- Parameters:
item- Item that should wait
-
forget
Description copied from interface:RateLimiterForget indicates that an item is finished being retried. Doesn't matter whether its for perm failing or for success, we'll stop tracking it- Specified by:
forgetin interfaceRateLimiter<T>- Parameters:
item- Item will be forget
-
numRequeues
- Specified by:
numRequeuesin interfaceRateLimiter<T>- Returns:
- number of how many failures the item has had
-