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