Class PoolUtils.ErodingPerKeyKeyedObjectPool<K,V>
java.lang.Object
org.datanucleus.store.rdbms.datasource.dbcp2.pool2.PoolUtils.ErodingKeyedObjectPool<K,V>
org.datanucleus.store.rdbms.datasource.dbcp2.pool2.PoolUtils.ErodingPerKeyKeyedObjectPool<K,V>
- Type Parameters:
K- object pool key typeV- object pool value type
- All Implemented Interfaces:
Closeable, AutoCloseable, KeyedObjectPool<K,V>
- Enclosing class:
PoolUtils
private static final class PoolUtils.ErodingPerKeyKeyedObjectPool<K,V>
extends PoolUtils.ErodingKeyedObjectPool<K,V>
Extends ErodingKeyedObjectPool to allow erosion to take place on a
per-key basis. Timing of erosion events is tracked separately for
separate keyed pools.
- Since:
- 2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatErosion factor - same for all poolsprivate final Map<K, PoolUtils.ErodingFactor> Map of ErodingFactor instances keyed on pool keys -
Constructor Summary
ConstructorsConstructorDescriptionErodingPerKeyKeyedObjectPool(KeyedObjectPool<K, V> keyedPool, float factor) Creates a new ErordingPerKeyKeyedObjectPool decorating the given keyed pool with the specified erosion factor. -
Method Summary
Modifier and TypeMethodDescriptionprotected PoolUtils.ErodingFactorgetErodingFactor(K key) Returns the eroding factor for the given keytoString()Methods inherited from class PoolUtils.ErodingKeyedObjectPool
addObject, borrowObject, clear, clear, close, getKeyedPool, getNumActive, getNumActive, getNumIdle, getNumIdle, invalidateObject, returnObjectMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface KeyedObjectPool
addObjects, addObjects
-
Field Details
-
factor
private final float factorErosion factor - same for all pools -
factors
Map of ErodingFactor instances keyed on pool keys
-
-
Constructor Details
-
ErodingPerKeyKeyedObjectPool
Creates a new ErordingPerKeyKeyedObjectPool decorating the given keyed pool with the specified erosion factor.- Parameters:
keyedPool- underlying keyed poolfactor- erosion factor
-
-
Method Details
-
getErodingFactor
Returns the eroding factor for the given key- Overrides:
getErodingFactorin classPoolUtils.ErodingKeyedObjectPool<K,V> - Parameters:
key- key- Returns:
- eroding factor for the given keyed pool
-
toString
- Overrides:
toStringin classPoolUtils.ErodingKeyedObjectPool<K,V>
-