Package net.sf.ehcache.store.chm
Class SelectableConcurrentHashMap.Segment
- java.lang.Object
-
- java.util.concurrent.locks.ReentrantReadWriteLock
-
- net.sf.ehcache.store.chm.SelectableConcurrentHashMap.Segment
-
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.locks.ReadWriteLock
- Enclosing class:
- SelectableConcurrentHashMap
public class SelectableConcurrentHashMap.Segment extends java.util.concurrent.locks.ReentrantReadWriteLock- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intcountThe number of elements in this segment's region.protected SelectableConcurrentHashMap.HashEntry[]tableThe per-segment table.
-
Constructor Summary
Constructors Modifier Constructor Description protectedSegment(int initialCapacity, float lf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclear()protected SelectableConcurrentHashMap.HashEntrycreateHashEntry(java.lang.Object key, int hash, SelectableConcurrentHashMap.HashEntry next, Element value, long sizeOf)protected SelectableConcurrentHashMap.HashEntrygetFirst(int hash)Returns properly casted first entry of bin for given hash.protected java.util.Iterator<SelectableConcurrentHashMap.HashEntry>iterator()protected voidpostInstall(java.lang.Object key, Element value)protected voidpreRemove(SelectableConcurrentHashMap.HashEntry e)protected Elementput(java.lang.Object key, int hash, Element value, long sizeOf, boolean onlyIfAbsent, boolean fire)voidrecalculateSize(java.lang.Object key, int hash)protected SelectableConcurrentHashMap.HashEntryrelinkHashEntry(SelectableConcurrentHashMap.HashEntry e, SelectableConcurrentHashMap.HashEntry next)-
Methods inherited from class java.util.concurrent.locks.ReentrantReadWriteLock
getOwner, getQueuedReaderThreads, getQueuedThreads, getQueuedWriterThreads, getQueueLength, getReadHoldCount, getReadLockCount, getWaitingThreads, getWaitQueueLength, getWriteHoldCount, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isWriteLocked, isWriteLockedByCurrentThread, readLock, toString, writeLock
-
-
-
-
Field Detail
-
count
protected volatile int count
The number of elements in this segment's region.
-
table
protected volatile SelectableConcurrentHashMap.HashEntry[] table
The per-segment table.
-
-
Method Detail
-
preRemove
protected void preRemove(SelectableConcurrentHashMap.HashEntry e)
-
postInstall
protected void postInstall(java.lang.Object key, Element value)
-
getFirst
protected SelectableConcurrentHashMap.HashEntry getFirst(int hash)
Returns properly casted first entry of bin for given hash.
-
createHashEntry
protected SelectableConcurrentHashMap.HashEntry createHashEntry(java.lang.Object key, int hash, SelectableConcurrentHashMap.HashEntry next, Element value, long sizeOf)
-
relinkHashEntry
protected SelectableConcurrentHashMap.HashEntry relinkHashEntry(SelectableConcurrentHashMap.HashEntry e, SelectableConcurrentHashMap.HashEntry next)
-
clear
protected void clear()
-
recalculateSize
public void recalculateSize(java.lang.Object key, int hash)
-
put
protected Element put(java.lang.Object key, int hash, Element value, long sizeOf, boolean onlyIfAbsent, boolean fire)
-
iterator
protected java.util.Iterator<SelectableConcurrentHashMap.HashEntry> iterator()
-
-