Module io.github.bucket4j.core
Class SyncCommand
java.lang.Object
io.github.bucket4j.distributed.remote.commands.SyncCommand
- All Implemented Interfaces:
RemoteCommand<Nothing>,ComparableByContent<SyncCommand>
public class SyncCommand
extends Object
implements RemoteCommand<Nothing>, ComparableByContent<SyncCommand>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanequalsByContent(SyncCommand other) longexecute(MutableBucketEntry mutableEntry, long currentTimeNanos) longgetConsumedTokens(Nothing result) longlongbooleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.bucket4j.distributed.remote.RemoteCommand
asVerbose, canBeMerged, getMergedCommandsCount, isInitializationCommand, isMerged, mergeInto, toMergedCommand, unwrapOneResult
-
Field Details
-
SERIALIZATION_HANDLE
-
-
Constructor Details
-
SyncCommand
public SyncCommand(long unsynchronizedTokens, long nanosSinceLastSync)
-
-
Method Details
-
getNanosSinceLastSync
public long getNanosSinceLastSync() -
getUnsynchronizedTokens
public long getUnsynchronizedTokens() -
execute
- Specified by:
executein interfaceRemoteCommand<Nothing>
-
getSerializationHandle
- Specified by:
getSerializationHandlein interfaceRemoteCommand<Nothing>
-
equalsByContent
- Specified by:
equalsByContentin interfaceComparableByContent<SyncCommand>
-
isImmediateSyncRequired
public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) - Specified by:
isImmediateSyncRequiredin interfaceRemoteCommand<Nothing>
-
estimateTokensToConsume
public long estimateTokensToConsume()- Specified by:
estimateTokensToConsumein interfaceRemoteCommand<Nothing>
-
getConsumedTokens
- Specified by:
getConsumedTokensin interfaceRemoteCommand<Nothing>
-
getRequiredVersion
- Specified by:
getRequiredVersionin interfaceRemoteCommand<Nothing>
-