类 ConcurrentReferenceHashMap.Segment

java.lang.Object
java.util.concurrent.locks.ReentrantLock
cn.taketoday.util.ConcurrentReferenceHashMap.Segment
所有已实现的接口:
Serializable, Lock
封闭类:
ConcurrentReferenceHashMap<K,V>

protected final class ConcurrentReferenceHashMap.Segment extends ReentrantLock
A single segment used to divide the map to allow better concurrent performance.
另请参阅:
  • 构造器详细资料

    • Segment

      public Segment(int initialSize, int resizeThreshold)
  • 方法详细资料

    • getReference

    • doTask

      @Nullable public <T> T doTask(int hash, @Nullable Object key, ConcurrentReferenceHashMap<K,V>.cn.taketoday.util.ConcurrentReferenceHashMap.Task<T> task)
      Apply an update operation to this segment. The segment will be locked during the update.
      参数:
      hash - the hash of the key
      key - the key
      task - the update operation
      返回:
      the result of the operation
    • clear

      public void clear()
      Clear all items from this segment.
    • getSize

      public final int getSize()
      Return the size of the current references array.
    • getCount

      public final int getCount()
      Return the total number of references in this segment.