public class BucketState64BitsInteger extends Object implements BucketState, ComparableByContent<BucketState64BitsInteger>
Modifier and Type | Field and Description |
---|---|
static SerializationHandle<BucketState64BitsInteger> |
SERIALIZATION_HANDLE |
Constructor and Description |
---|
BucketState64BitsInteger(BucketConfiguration configuration,
long currentTimeNanos) |
Modifier and Type | Method and Description |
---|---|
void |
addTokens(Bandwidth[] limits,
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) |
boolean |
equalsByContent(BucketState64BitsInteger other) |
long |
getAvailableTokens(Bandwidth[] bandwidths) |
long |
getCurrentSize(int bandwidth) |
MathType |
getMathType() |
long |
getRoundingError(int bandwidth) |
void |
refillAllBandwidth(Bandwidth[] limits,
long currentTimeNanos) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createInitialState, deserialize, serialize
equals
public static SerializationHandle<BucketState64BitsInteger> SERIALIZATION_HANDLE
public BucketState64BitsInteger(BucketConfiguration configuration, long currentTimeNanos)
public BucketState copy()
copy
in interface BucketState
public void copyStateFrom(BucketState sourceState)
copyStateFrom
in interface BucketState
public long getAvailableTokens(Bandwidth[] bandwidths)
getAvailableTokens
in interface BucketState
public void consume(Bandwidth[] bandwidths, long toConsume)
consume
in interface BucketState
public long calculateDelayNanosAfterWillBePossibleToConsume(Bandwidth[] bandwidths, long tokensToConsume, long currentTimeNanos)
calculateDelayNanosAfterWillBePossibleToConsume
in interface BucketState
public void refillAllBandwidth(Bandwidth[] limits, long currentTimeNanos)
refillAllBandwidth
in interface BucketState
public void addTokens(Bandwidth[] limits, long tokensToAdd)
addTokens
in interface BucketState
public long calculateFullRefillingTime(Bandwidth[] bandwidths, long currentTimeNanos)
calculateFullRefillingTime
in interface BucketState
public long getCurrentSize(int bandwidth)
getCurrentSize
in interface BucketState
public long getRoundingError(int bandwidth)
getRoundingError
in interface BucketState
public MathType getMathType()
getMathType
in interface BucketState
public boolean equalsByContent(BucketState64BitsInteger other)
equalsByContent
in interface ComparableByContent<BucketState64BitsInteger>
Copyright © 2020. All rights reserved.