public class ReserveAndCalculateTimeToSleepCommand extends Object implements RemoteCommand<Long>, ComparableByContent<ReserveAndCalculateTimeToSleepCommand>
| Modifier and Type | Field and Description |
|---|---|
static SerializationHandle<ReserveAndCalculateTimeToSleepCommand> |
SERIALIZATION_HANDLE |
| Constructor and Description |
|---|
ReserveAndCalculateTimeToSleepCommand(long tokensToConsume,
long waitIfBusyNanosLimit) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equalsByContent(ReserveAndCalculateTimeToSleepCommand other) |
long |
estimateTokensToConsume() |
CommandResult<Long> |
execute(MutableBucketEntry mutableEntry,
long currentTimeNanos) |
long |
getConsumedTokens(Long result) |
Version |
getRequiredVersion() |
SerializationHandle |
getSerializationHandle() |
long |
getTokensToConsume() |
long |
getWaitIfBusyNanosLimit() |
boolean |
isImmediateSyncRequired(long unsynchronizedTokens,
long nanosSinceLastSync) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasVerbose, canBeMerged, deserialize, fromJsonCompatibleSnapshot, getMergedCommandsCount, isInitializationCommand, isMerged, mergeInto, serialize, toJsonCompatibleSnapshot, toMergedCommand, unwrapOneResultequalspublic static final SerializationHandle<ReserveAndCalculateTimeToSleepCommand> SERIALIZATION_HANDLE
public ReserveAndCalculateTimeToSleepCommand(long tokensToConsume,
long waitIfBusyNanosLimit)
public CommandResult<Long> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
execute in interface RemoteCommand<Long>public long getTokensToConsume()
public long getWaitIfBusyNanosLimit()
public SerializationHandle getSerializationHandle()
getSerializationHandle in interface RemoteCommand<Long>public boolean equalsByContent(ReserveAndCalculateTimeToSleepCommand other)
equalsByContent in interface ComparableByContent<ReserveAndCalculateTimeToSleepCommand>public boolean isImmediateSyncRequired(long unsynchronizedTokens,
long nanosSinceLastSync)
isImmediateSyncRequired in interface RemoteCommand<Long>public long estimateTokensToConsume()
estimateTokensToConsume in interface RemoteCommand<Long>public long getConsumedTokens(Long result)
getConsumedTokens in interface RemoteCommand<Long>public Version getRequiredVersion()
getRequiredVersion in interface RemoteCommand<Long>Copyright © 2024. All rights reserved.