public class EstimateAbilityToConsumeCommand extends Object implements RemoteCommand<EstimationProbe>, ComparableByContent<EstimateAbilityToConsumeCommand>
Modifier and Type | Field and Description |
---|---|
static SerializationHandle<EstimateAbilityToConsumeCommand> |
SERIALIZATION_HANDLE |
Constructor and Description |
---|
EstimateAbilityToConsumeCommand(long tokensToEstimate) |
Modifier and Type | Method and Description |
---|---|
boolean |
equalsByContent(EstimateAbilityToConsumeCommand other) |
long |
estimateTokensToConsume() |
CommandResult<EstimationProbe> |
execute(MutableBucketEntry mutableEntry,
long currentTimeNanos) |
long |
getConsumedTokens(EstimationProbe result) |
SerializationHandle |
getSerializationHandle() |
long |
getTokensToConsume() |
boolean |
isImmediateSyncRequired(long unsynchronizedTokens,
long nanosSinceLastSync) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
asVerbose, deserialize, isInitializationCommand, serialize
equals
public static final SerializationHandle<EstimateAbilityToConsumeCommand> SERIALIZATION_HANDLE
public EstimateAbilityToConsumeCommand(long tokensToEstimate)
public CommandResult<EstimationProbe> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
execute
in interface RemoteCommand<EstimationProbe>
public long getTokensToConsume()
public SerializationHandle getSerializationHandle()
getSerializationHandle
in interface RemoteCommand<EstimationProbe>
public boolean equalsByContent(EstimateAbilityToConsumeCommand other)
equalsByContent
in interface ComparableByContent<EstimateAbilityToConsumeCommand>
public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)
isImmediateSyncRequired
in interface RemoteCommand<EstimationProbe>
public long estimateTokensToConsume()
estimateTokensToConsume
in interface RemoteCommand<EstimationProbe>
public long getConsumedTokens(EstimationProbe result)
getConsumedTokens
in interface RemoteCommand<EstimationProbe>
Copyright © 2022. All rights reserved.