public class SkipSyncOnZeroOptimization extends Object implements Optimization
BatchingOptimization, so multiple parallel request to same bucket are grouped.
Usage of this optimization can lead to temporal under-consumption in case of tokens are being added to bucket via API like Bucket.addTokens(long) or Bucket.reset().
DelayParametersNONE_OPTIMIZED| Constructor and Description |
|---|
SkipSyncOnZeroOptimization(OptimizationListener listener,
TimeMeter timeMeter) |
| Modifier and Type | Method and Description |
|---|---|
AsyncCommandExecutor |
apply(AsyncCommandExecutor originalExecutor)
Decorates command executor in order to apply optimization strategy.
|
CommandExecutor |
apply(CommandExecutor originalExecutor)
Decorates command executor in order to apply optimization strategy.
|
Optimization |
withListener(OptimizationListener listener)
Specifies the listener for optimization events
|
public SkipSyncOnZeroOptimization(OptimizationListener listener, TimeMeter timeMeter)
public Optimization withListener(OptimizationListener listener)
OptimizationwithListener in interface Optimizationlistener - the listener for optimization eventsOptimization with configured listenerpublic CommandExecutor apply(CommandExecutor originalExecutor)
Optimizationapply in interface OptimizationoriginalExecutor - command executor that need to be optimizedpublic AsyncCommandExecutor apply(AsyncCommandExecutor originalExecutor)
Optimizationapply in interface OptimizationoriginalExecutor - command executor that need to be optimizedCopyright © 2024. All rights reserved.