public class TryConsumeAndReturnRemainingTokensCommand extends Object implements RemoteCommand<ConsumptionProbe>, ComparableByContent<TryConsumeAndReturnRemainingTokensCommand>
Modifier and Type | Field and Description |
---|---|
static SerializationHandle<TryConsumeAndReturnRemainingTokensCommand> |
SERIALIZATION_HANDLE |
Constructor and Description |
---|
TryConsumeAndReturnRemainingTokensCommand(long tokensToConsume) |
Modifier and Type | Method and Description |
---|---|
boolean |
equalsByContent(TryConsumeAndReturnRemainingTokensCommand other) |
long |
estimateTokensToConsume() |
CommandResult<ConsumptionProbe> |
execute(MutableBucketEntry mutableEntry,
long currentTimeNanos) |
long |
getConsumedTokens(ConsumptionProbe 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<TryConsumeAndReturnRemainingTokensCommand> SERIALIZATION_HANDLE
public TryConsumeAndReturnRemainingTokensCommand(long tokensToConsume)
public CommandResult<ConsumptionProbe> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
execute
in interface RemoteCommand<ConsumptionProbe>
public long getTokensToConsume()
public SerializationHandle getSerializationHandle()
getSerializationHandle
in interface RemoteCommand<ConsumptionProbe>
public boolean equalsByContent(TryConsumeAndReturnRemainingTokensCommand other)
equalsByContent
in interface ComparableByContent<TryConsumeAndReturnRemainingTokensCommand>
public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)
isImmediateSyncRequired
in interface RemoteCommand<ConsumptionProbe>
public long estimateTokensToConsume()
estimateTokensToConsume
in interface RemoteCommand<ConsumptionProbe>
public long getConsumedTokens(ConsumptionProbe result)
getConsumedTokens
in interface RemoteCommand<ConsumptionProbe>
Copyright © 2020. All rights reserved.