public interface BucketState
Modifier and Type | Method and Description |
---|---|
void |
addTokens(Bandwidth[] bandwidths,
long tokensToAdd) |
long |
calculateDelayNanosAfterWillBePossibleToConsume(Bandwidth[] bandwidths,
long tokensToConsume,
long currentTimeNanos) |
long |
calculateFullRefillingTime(Bandwidth[] bandwidths,
long currentTimeNanos) |
void |
consume(Bandwidth[] bandwidths,
long toConsume) |
BucketState |
copy() |
void |
copyStateFrom(BucketState sourceState) |
static BucketState |
createInitialState(BucketConfiguration configuration,
MathType mathType,
long currentTimeNanos) |
static <S> BucketState |
deserialize(DeserializationAdapter<S> adapter,
S input,
Version backwardCompatibilityVersion) |
long |
getAvailableTokens(Bandwidth[] bandwidths) |
long |
getCurrentSize(int bandwidth) |
MathType |
getMathType() |
long |
getRoundingError(int bandwidth) |
void |
refillAllBandwidth(Bandwidth[] limits,
long currentTimeNanos) |
static <O> void |
serialize(SerializationAdapter<O> adapter,
O output,
BucketState state,
Version backwardCompatibilityVersion) |
BucketState copy()
void copyStateFrom(BucketState sourceState)
long getAvailableTokens(Bandwidth[] bandwidths)
void consume(Bandwidth[] bandwidths, long toConsume)
long calculateDelayNanosAfterWillBePossibleToConsume(Bandwidth[] bandwidths, long tokensToConsume, long currentTimeNanos)
long calculateFullRefillingTime(Bandwidth[] bandwidths, long currentTimeNanos)
void refillAllBandwidth(Bandwidth[] limits, long currentTimeNanos)
void addTokens(Bandwidth[] bandwidths, long tokensToAdd)
long getCurrentSize(int bandwidth)
long getRoundingError(int bandwidth)
MathType getMathType()
static BucketState createInitialState(BucketConfiguration configuration, MathType mathType, long currentTimeNanos)
static <S> BucketState deserialize(DeserializationAdapter<S> adapter, S input, Version backwardCompatibilityVersion) throws IOException
IOException
static <O> void serialize(SerializationAdapter<O> adapter, O output, BucketState state, Version backwardCompatibilityVersion) throws IOException
IOException
Copyright © 2020. All rights reserved.