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
strategyPooledLoOptimizer
incrementSize, 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, getReturnClass
public PooledOptimizer(Class returnClass, int incrementSize)
returnClass
- The Java type of the values to be generatedincrementSize
- The increment size.public Serializable generate(AccessCallback callback)
Optimizer
public IntegralDataTypeHolder getLastSourceValue()
Optimizer
getLastSourceValue
in interface Optimizer
public boolean applyIncrementSizeToSourceValues()
Optimizer
applyIncrementSizeToSourceValues
in interface Optimizer
public IntegralDataTypeHolder getLastValue()
public void injectInitialValue(long initialValue)
InitialValueAwareOptimizer
injectInitialValue
in interface InitialValueAwareOptimizer
initialValue
- The initial value specified by the user, or -1 to indicate that the
user did not specify.Copyright © 2017 JBoss by Red Hat. All rights reserved.