public class Resizer extends TimerTask
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
_logger |
protected DataStructure |
dataStructure |
protected ResourceHandler |
handler |
protected PoolProperties |
pool |
protected PoolInfo |
poolInfo |
protected boolean |
preferValidateOverRecreate |
| Constructor and Description |
|---|
Resizer(PoolInfo poolInfo,
DataStructure dataStructure,
PoolProperties pp,
ResourceHandler handler,
boolean preferValidateOverRecreate) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
debug(String debugStatement) |
protected boolean |
isResourceEligibleForRemoval(ResourceHandle h,
int validConnectionsCounter) |
protected int |
removeIdleAndInvalidResources()
Get the free connections list from the pool, remove idle-timed-out resources
and then invalid resources.
|
void |
resizePool(boolean forced)
Resize the pool
|
void |
run() |
protected void |
scaleDownPool(int scaleDownQuantity,
boolean forced)
Scale down pool by a
size <= pool-resize-quantity |
protected int |
validateAndRemoveResource(ResourceHandle handle,
Set invalidConnections) |
cancel, scheduledExecutionTimeprotected PoolInfo poolInfo
protected DataStructure dataStructure
protected PoolProperties pool
protected ResourceHandler handler
protected boolean preferValidateOverRecreate
protected static final Logger _logger
public Resizer(PoolInfo poolInfo, DataStructure dataStructure, PoolProperties pp, ResourceHandler handler, boolean preferValidateOverRecreate)
public void resizePool(boolean forced)
forced - when force is true, scale down the pool.protected void scaleDownPool(int scaleDownQuantity,
boolean forced)
size <= pool-resize-quantityforced - scale-down only when forcedscaleDownQuantity - no. of resources to removeprotected int removeIdleAndInvalidResources()
protected static void debug(String debugStatement)
protected int validateAndRemoveResource(ResourceHandle handle, Set invalidConnections)
protected boolean isResourceEligibleForRemoval(ResourceHandle h, int validConnectionsCounter)
Copyright © 2019. All rights reserved.