Class UnlimitedCache<K,V>

java.lang.Object
com.xxl.tool.cache.impl.ReentrantCache<K,V>
com.xxl.tool.cache.impl.UnlimitedCache<K,V>
Type Parameters:
K -
V -
All Implemented Interfaces:
Cache<K,V>, Serializable

public class UnlimitedCache<K,V> extends ReentrantCache<K,V>
无限容量缓存 1、无容量限制,不会因为容量触发缓存清理 2、线程安全,父类存在读写锁控制; 3、优劣势: - 优点:无容量限制,不会因为容量触发缓存清理; - 问题:内存占用不可用,容易造成内存溢出;需要结合 定义缓存清理策略 一起使用;
See Also:
  • Constructor Details

    • UnlimitedCache

      public UnlimitedCache(long timeout, boolean expireType)
  • Method Details

    • doPrune

      protected int doPrune()
      Description copied from class: ReentrantCache
      清理实现
      子类实现此方法时无需加锁
      Specified by:
      doPrune in class ReentrantCache<K,V>
      Returns:
      清理数据量