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) |
Version |
getRequiredVersion() |
SerializationHandle |
getSerializationHandle() |
long |
getTokensToConsume() |
boolean |
isImmediateSyncRequired(long unsynchronizedTokens,
long nanosSinceLastSync) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasVerbose, deserialize, fromJsonCompatibleSnapshot, isInitializationCommand, serialize, toJsonCompatibleSnapshotequalspublic 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>public Version getRequiredVersion()
getRequiredVersion in interface RemoteCommand<Boolean>Copyright © 2022. All rights reserved.