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(long tokensToAdd) |
long |
calculateDelayNanosAfterWillBePossibleToConsume(long tokensToConsume,
long currentTimeNanos,
boolean checkTokensToConsumeShouldBeLessThenCapacity) |
long |
calculateFullRefillingTime(long currentTimeNanos) |
void |
consume(long toConsume) |
BucketState |
copy() |
void |
copyStateFrom(BucketState sourceState) |
boolean |
equalsByContent(BucketState64BitsInteger other) |
void |
forceAddTokens(long tokensToAdd) |
long |
getAvailableTokens() |
BucketConfiguration |
getConfiguration() |
long |
getCurrentSize(int bandwidth) |
MathType |
getMathType() |
long |
getRoundingError(int bandwidth) |
void |
refillAllBandwidth(long currentTimeNanos) |
BucketState |
replaceConfiguration(BucketConfiguration newConfiguration,
TokensInheritanceStrategy tokensInheritanceStrategy,
long currentTimeNanos) |
void |
reset() |
void |
setConfiguration(BucketConfiguration configuration) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateInitialState, deserialize, fromJsonCompatibleSnapshot, serialize, toJsonCompatibleSnapshotequalspublic static SerializationHandle<BucketState64BitsInteger> SERIALIZATION_HANDLE
public BucketState64BitsInteger(BucketConfiguration configuration, long currentTimeNanos)
public BucketState copy()
copy in interface BucketStatepublic BucketConfiguration getConfiguration()
getConfiguration in interface BucketStatepublic void setConfiguration(BucketConfiguration configuration)
setConfiguration in interface BucketStatepublic BucketState replaceConfiguration(BucketConfiguration newConfiguration, TokensInheritanceStrategy tokensInheritanceStrategy, long currentTimeNanos)
replaceConfiguration in interface BucketStatepublic void copyStateFrom(BucketState sourceState)
copyStateFrom in interface BucketStatepublic long getAvailableTokens()
getAvailableTokens in interface BucketStatepublic void consume(long toConsume)
consume in interface BucketStatepublic long calculateDelayNanosAfterWillBePossibleToConsume(long tokensToConsume,
long currentTimeNanos,
boolean checkTokensToConsumeShouldBeLessThenCapacity)
calculateDelayNanosAfterWillBePossibleToConsume in interface BucketStatepublic void refillAllBandwidth(long currentTimeNanos)
refillAllBandwidth in interface BucketStatepublic void addTokens(long tokensToAdd)
addTokens in interface BucketStatepublic void reset()
reset in interface BucketStatepublic void forceAddTokens(long tokensToAdd)
forceAddTokens in interface BucketStatepublic long calculateFullRefillingTime(long currentTimeNanos)
calculateFullRefillingTime in interface BucketStatepublic long getCurrentSize(int bandwidth)
getCurrentSize in interface BucketStatepublic long getRoundingError(int bandwidth)
getRoundingError in interface BucketStatepublic MathType getMathType()
getMathType in interface BucketStatepublic boolean equalsByContent(BucketState64BitsInteger other)
equalsByContent in interface ComparableByContent<BucketState64BitsInteger>Copyright © 2024. All rights reserved.