public class PooledOptimizer extends AbstractOptimizer implements InitialValueAwareOptimizer
HiLoOptimizer except that here the bucket ranges are actually
encoded into the database structures.
Note if you prefer that the database value be interpreted as the bottom end of our current range,
then use the PooledLoOptimizer strategyPooledLoOptimizerincrementSize, returnClass| Constructor and Description |
|---|
PooledOptimizer(Class returnClass,
int incrementSize)
Constructs a PooledOptimizer
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
applyIncrementSizeToSourceValues()
Are increments to be applied to the values stored in the underlying
value source?
|
Serializable |
generate(AccessCallback callback)
Generate an identifier value accounting for this specific optimization.
|
IntegralDataTypeHolder |
getLastSourceValue()
A common means to access the last value obtained from the underlying
source.
|
IntegralDataTypeHolder |
getLastValue()
Getter for property 'lastValue'.
|
void |
injectInitialValue(long initialValue)
Reports the user specified initial value to the optimizer.
|
getIncrementSize, getReturnClasspublic PooledOptimizer(Class returnClass, int incrementSize)
returnClass - The Java type of the values to be generatedincrementSize - The increment size.public Serializable generate(AccessCallback callback)
Optimizerpublic IntegralDataTypeHolder getLastSourceValue()
OptimizergetLastSourceValue in interface Optimizerpublic boolean applyIncrementSizeToSourceValues()
OptimizerapplyIncrementSizeToSourceValues in interface Optimizerpublic IntegralDataTypeHolder getLastValue()
public void injectInitialValue(long initialValue)
InitialValueAwareOptimizerinjectInitialValue in interface InitialValueAwareOptimizerinitialValue - The initial value specified by the user, or -1 to indicate that the
user did not specify.Copyright © 2019 JBoss by Red Hat. All rights reserved.