Package com.aspectran.utils
Class ConcurrentReferenceHashMap.Segment
java.lang.Object
java.util.concurrent.locks.ReentrantLock
com.aspectran.utils.ConcurrentReferenceHashMap.Segment
- All Implemented Interfaces:
Serializable
,Lock
- Enclosing class:
ConcurrentReferenceHashMap<K,
V>
A single segment used to divide the map to allow better concurrent performance.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all items from this segment.final int
getCount()
Return the total number of references in this segment.getReference
(Object key, int hash, ConcurrentReferenceHashMap.Restructure restructure) final int
getSize()
Return the size of the current references array.Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlock
-
Constructor Details
-
Segment
public Segment(int initialSize, int resizeThreshold)
-
-
Method Details
-
getReference
@Nullable public ConcurrentReferenceHashMap.Reference<K,V> getReference(@Nullable Object key, int hash, ConcurrentReferenceHashMap.Restructure restructure) -
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.
-