static final class BoundedConcurrentHashMap.Segment<K,V> extends ReentrantLock
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
count
The number of elements in this segment's region.
|
(package private) int |
evictCap |
(package private) BoundedConcurrentHashMap.EvictionPolicy<K,V> |
eviction |
(package private) BoundedConcurrentHashMap.EvictionListener<K,V> |
evictionListener |
(package private) float |
loadFactor
The load factor for the hash table.
|
(package private) int |
modCount
Number of updates that alter the size of the table.
|
private static long |
serialVersionUID |
(package private) BoundedConcurrentHashMap.HashEntry<K,V>[] |
table
The per-segment table.
|
(package private) int |
threshold
The table is rehashed when its size exceeds this threshold.
|
| Constructor and Description |
|---|
Segment(int cap,
int evictCap,
float lf,
BoundedConcurrentHashMap.Eviction es,
BoundedConcurrentHashMap.EvictionListener<K,V> listener) |
| Modifier and Type | Method and Description |
|---|---|
private Set<BoundedConcurrentHashMap.HashEntry<K,V>> |
attemptEviction(boolean lockedAlready) |
(package private) void |
clear() |
(package private) boolean |
containsKey(Object key,
int hash) |
(package private) boolean |
containsValue(Object value) |
(package private) V |
get(Object key,
int hash) |
(package private) BoundedConcurrentHashMap.EvictionListener<K,V> |
getEvictionListener() |
(package private) BoundedConcurrentHashMap.HashEntry<K,V> |
getFirst(int hash)
Returns properly casted first entry of bin for given hash.
|
(package private) static <K,V> BoundedConcurrentHashMap.Segment<K,V>[] |
newArray(int i) |
private void |
notifyEvictionListener(Set<BoundedConcurrentHashMap.HashEntry<K,V>> evicted) |
(package private) V |
put(K key,
int hash,
V value,
boolean onlyIfAbsent) |
(package private) V |
readValueUnderLock(BoundedConcurrentHashMap.HashEntry<K,V> e)
Reads value field of an entry under lock.
|
(package private) void |
rehash() |
(package private) V |
remove(Object key,
int hash,
Object value)
Remove; match on key only if value null, else match both.
|
(package private) V |
replace(K key,
int hash,
V newValue) |
(package private) boolean |
replace(K key,
int hash,
V oldValue,
V newValue) |
(package private) void |
setTable(BoundedConcurrentHashMap.HashEntry<K,V>[] newTable)
Sets table to new HashEntry array.
|
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, lock, lockInterruptibly, newCondition, toString, tryLock, tryLock, unlockprivate static final long serialVersionUID
transient volatile int count
transient int modCount
transient int threshold
transient volatile BoundedConcurrentHashMap.HashEntry<K,V>[] table
final float loadFactor
final int evictCap
final transient BoundedConcurrentHashMap.EvictionPolicy<K,V> eviction
final transient BoundedConcurrentHashMap.EvictionListener<K,V> evictionListener
Segment(int cap,
int evictCap,
float lf,
BoundedConcurrentHashMap.Eviction es,
BoundedConcurrentHashMap.EvictionListener<K,V> listener)
static <K,V> BoundedConcurrentHashMap.Segment<K,V>[] newArray(int i)
BoundedConcurrentHashMap.EvictionListener<K,V> getEvictionListener()
void setTable(BoundedConcurrentHashMap.HashEntry<K,V>[] newTable)
BoundedConcurrentHashMap.HashEntry<K,V> getFirst(int hash)
V readValueUnderLock(BoundedConcurrentHashMap.HashEntry<K,V> e)
boolean containsKey(Object key, int hash)
boolean containsValue(Object value)
void rehash()
V remove(Object key, int hash, Object value)
void clear()
private Set<BoundedConcurrentHashMap.HashEntry<K,V>> attemptEviction(boolean lockedAlready)
private void notifyEvictionListener(Set<BoundedConcurrentHashMap.HashEntry<K,V>> evicted)
Copyright © 2019 JBoss by Red Hat. All rights reserved.