public class RemoteBucketState extends Object implements ComparableByContent<RemoteBucketState>
| Modifier and Type | Field and Description |
|---|---|
static SerializationHandle<RemoteBucketState> |
SERIALIZATION_HANDLE |
| Constructor and Description |
|---|
RemoteBucketState(BucketState state,
RemoteStat stat,
Long configurationVersion) |
| 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 tokensToConsume) |
RemoteBucketState |
copy() |
BucketState |
copyBucketState() |
boolean |
equalsByContent(RemoteBucketState other) |
void |
forceAddTokens(long tokensToAdd) |
long |
getAvailableTokens() |
BucketConfiguration |
getConfiguration() |
Long |
getConfigurationVersion() |
RemoteStat |
getRemoteStat() |
BucketState |
getState() |
void |
refillAllBandwidth(long currentTimeNanos) |
void |
replaceConfiguration(BucketConfiguration newConfiguration,
TokensInheritanceStrategy tokensInheritanceStrategy,
long currentTimeNanos) |
void |
reset() |
void |
setConfigurationVersion(Long configurationVersion) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequalspublic static final SerializationHandle<RemoteBucketState> SERIALIZATION_HANDLE
public RemoteBucketState(BucketState state, RemoteStat stat, Long configurationVersion)
public void refillAllBandwidth(long currentTimeNanos)
public long getAvailableTokens()
public void consume(long tokensToConsume)
public long calculateFullRefillingTime(long currentTimeNanos)
public long calculateDelayNanosAfterWillBePossibleToConsume(long tokensToConsume,
long currentTimeNanos,
boolean checkTokensToConsumeShouldBeLessThenCapacity)
public void addTokens(long tokensToAdd)
public void forceAddTokens(long tokensToAdd)
public void reset()
public BucketState copyBucketState()
public void replaceConfiguration(BucketConfiguration newConfiguration, TokensInheritanceStrategy tokensInheritanceStrategy, long currentTimeNanos)
public BucketConfiguration getConfiguration()
public RemoteStat getRemoteStat()
public BucketState getState()
public Long getConfigurationVersion()
public void setConfigurationVersion(Long configurationVersion)
public boolean equalsByContent(RemoteBucketState other)
equalsByContent in interface ComparableByContent<RemoteBucketState>public RemoteBucketState copy()
Copyright © 2024. All rights reserved.