Module io.github.bucket4j.core
Class MultiCommand
java.lang.Object
io.github.bucket4j.distributed.remote.commands.MultiCommand
- All Implemented Interfaces:
RemoteCommand<MultiResult>,ComparableByContent<MultiCommand>
public class MultiCommand
extends Object
implements RemoteCommand<MultiResult>, ComparableByContent<MultiCommand>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanequalsByContent(MultiCommand other) longexecute(MutableBucketEntry mutableEntry, long currentTimeNanos) List<RemoteCommand<?>>longgetConsumedTokens(MultiResult multiResult) intbooleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) booleanbooleanisMerged()static MultiCommandmerge(List<RemoteCommand<?>> commands) List<CommandResult<?>>unwrap(CommandResult<MultiResult> multiResult) 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, mergeInto, toMergedCommand, unwrapOneResult
-
Field Details
-
MERGING_THRESHOLD
public static final int MERGING_THRESHOLD -
SERIALIZATION_HANDLE
-
-
Constructor Details
-
MultiCommand
-
-
Method Details
-
merge
-
unwrap
-
isMerged
public boolean isMerged()- Specified by:
isMergedin interfaceRemoteCommand<MultiResult>
-
execute
- Specified by:
executein interfaceRemoteCommand<MultiResult>
-
isInitializationCommand
public boolean isInitializationCommand()- Specified by:
isInitializationCommandin interfaceRemoteCommand<MultiResult>
-
getCommands
-
getSerializationHandle
- Specified by:
getSerializationHandlein interfaceRemoteCommand<MultiResult>
-
getMergedCommandsCount
public int getMergedCommandsCount()- Specified by:
getMergedCommandsCountin interfaceRemoteCommand<MultiResult>
-
equalsByContent
- Specified by:
equalsByContentin interfaceComparableByContent<MultiCommand>
-
isImmediateSyncRequired
public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) - Specified by:
isImmediateSyncRequiredin interfaceRemoteCommand<MultiResult>
-
estimateTokensToConsume
public long estimateTokensToConsume()- Specified by:
estimateTokensToConsumein interfaceRemoteCommand<MultiResult>
-
getConsumedTokens
- Specified by:
getConsumedTokensin interfaceRemoteCommand<MultiResult>
-
getRequiredVersion
- Specified by:
getRequiredVersionin interfaceRemoteCommand<MultiResult>
-