public class DelayOptimization extends Object implements Optimization
BatchingOptimization
, so multiple parallel request to same bucket are grouped.
Usage of this optimization can lead to temporal overconsumption because the synchronization with external storage is performed periodically when thresholds are violated.
DelayParameters
NONE_OPTIMIZED
Constructor and Description |
---|
DelayOptimization(DelayParameters delayParameters,
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 DelayOptimization(DelayParameters delayParameters, OptimizationListener listener, TimeMeter timeMeter)
public Optimization withListener(OptimizationListener listener)
Optimization
withListener
in interface Optimization
listener
- the listener for optimization eventsOptimization
with configured listenerpublic CommandExecutor apply(CommandExecutor originalExecutor)
Optimization
apply
in interface Optimization
originalExecutor
- command executor that need to be optimizedpublic AsyncCommandExecutor apply(AsyncCommandExecutor originalExecutor)
Optimization
apply
in interface Optimization
originalExecutor
- command executor that need to be optimizedCopyright © 2021. All rights reserved.