Class PoolUtils.ErodingPerKeyKeyedObjectPool<K,​V>

  • All Implemented Interfaces:
    KeyedObjectPool<K,​V>
    Enclosing class:
    PoolUtils

    private static 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.
    • Field Detail

      • factor

        private final float factor
        Erosion factor - same for all pools
      • factors

        private final java.util.Map<K,​PoolUtils.ErodingFactor> factors
        Map of ErodingFactor instances keyed on pool keys
    • Constructor Detail

      • ErodingPerKeyKeyedObjectPool

        public ErodingPerKeyKeyedObjectPool​(KeyedObjectPool<K,​V> keyedPool,
                                            float factor)
        Create a new ErordingPerKeyKeyedObjectPool decorating the given keyed pool with the specified erosion factor.
        Parameters:
        keyedPool - underlying keyed pool
        factor - erosion factor