public class PredictiveOptimization extends Object implements Optimization
BatchingOptimization
and DelayOptimization
,
and in additionally this optimization tries to predict aggregated consumption rate in whole cluster in order to reduce the risk of overconsumption that caused by DelayOptimization
.
Usage of this optimization can lead to temporal over-consumption because the synchronization with external storage is performed periodically when thresholds are violated, as well as under-consumption in case of the wrong prediction of aggregated consumption rate.
DelayParameters
,
PredictionParameters
NONE_OPTIMIZED
Constructor and Description |
---|
PredictiveOptimization(PredictionParameters predictionParameters,
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 PredictiveOptimization(PredictionParameters predictionParameters, 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 © 2022. All rights reserved.