Package de.uni_kiel.rz.fdr.repl
Class REPLJobCallbackAutoTune
java.lang.Object
de.uni_kiel.rz.fdr.repl.REPLJobCallbackAutoTune
- All Implemented Interfaces:
Consumer<REPLJob.JobEvent>
A Callback that you can use for your jobs; it automatically adjusts its concurrency to tune it for maximum throughput.
-
Constructor Summary
ConstructorsConstructorDescriptionREPLJobCallbackAutoTune(int minConcurrency, int maxConcurrency) Create a new AutoTune job callback. -
Method Summary
Modifier and TypeMethodDescriptionvoidFor internal use only.intGet the current maximum concurrency limit.intGet the current minimum concurrency limit.voidsetMaxConcurrency(int maxConcurrency) Set a new maximum concurrency limit.voidsetMinConcurrency(int minConcurrency) Set a new minimum concurrency limit.
-
Constructor Details
-
REPLJobCallbackAutoTune
public REPLJobCallbackAutoTune(int minConcurrency, int maxConcurrency) Create a new AutoTune job callback. Each instance should only be used once, with a single job.- Parameters:
minConcurrency- The minimum concurrency level this callback will ever set.maxConcurrency- The maximum concurrency level this callback will ever set.
-
-
Method Details
-
accept
For internal use only.- Specified by:
acceptin interfaceConsumer<REPLJob.JobEvent>- Parameters:
ev- A new job event.
-
getMinConcurrency
public int getMinConcurrency()Get the current minimum concurrency limit.- Returns:
- The current minimum concurrency limit.
-
setMinConcurrency
public void setMinConcurrency(int minConcurrency) Set a new minimum concurrency limit. Must be bigger than 0 and can not be greater then the maximum concurrency limit. You can safely invoke this method while the associated job is active.- Parameters:
minConcurrency- The new minimum concurrency limit.
-
getMaxConcurrency
public int getMaxConcurrency()Get the current maximum concurrency limit.- Returns:
- The current maximum concurrency limit.
-
setMaxConcurrency
public void setMaxConcurrency(int maxConcurrency) Set a new maximum concurrency limit. Must not be smaller than the minimum concurrency limit. You can safely invoke this method while the associated job is active.- Parameters:
maxConcurrency- The new maximum concurrency limit.
-