|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.store.chm.SelectableConcurrentHashMap
public class SelectableConcurrentHashMap
SelectableConcurrentHashMap subclasses a repackaged version of ConcurrentHashMap ito allow efficient random sampling of the map values.
The random sampling technique involves randomly selecting a map Segment, and then selecting a number of random entry chains from that segment.
Nested Class Summary | |
---|---|
static class |
SelectableConcurrentHashMap.HashEntry
|
class |
SelectableConcurrentHashMap.Segment
|
Constructor Summary | |
---|---|
SelectableConcurrentHashMap(PoolAccessor poolAccessor,
int initialCapacity,
float loadFactor,
int concurrency,
long maximumSize,
RegisteredEventListeners cacheEventNotificationService)
|
|
SelectableConcurrentHashMap(PoolAccessor poolAccessor,
int concurrency,
long maximumSize,
RegisteredEventListeners cacheEventNotificationService)
|
Method Summary | |
---|---|
void |
clear()
|
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object value)
|
protected SelectableConcurrentHashMap.Segment |
createSegment(int initialCapacity,
float lf)
|
Set<Map.Entry<Object,Element>> |
entrySet()
|
boolean |
evict()
|
Element |
get(Object key)
|
Element[] |
getRandomValues(int size,
Object keyHint)
|
protected static int |
hash(int h)
|
boolean |
isEmpty()
|
Set<Object> |
keySet()
|
ReentrantReadWriteLock |
lockFor(Object key)
|
ReentrantReadWriteLock[] |
locks()
|
Element |
put(Object key,
Element element,
long sizeOf)
|
Element |
putIfAbsent(Object key,
Element element,
long sizeOf)
|
int |
quickSize()
Returns the number of key-value mappings in this map without locking anything. |
void |
recalculateSize(Object key)
|
Element |
remove(Object key)
|
boolean |
remove(Object key,
Object value)
|
protected SelectableConcurrentHashMap.Segment |
segmentFor(int hash)
Returns the segment that should be used for key with given hash |
protected List<SelectableConcurrentHashMap.Segment> |
segments()
|
void |
setMaxSize(long maxSize)
|
int |
size()
|
Object |
storedObject(Element e)
Return an object of the kind which will be stored when the element is going to be inserted |
Collection<Element> |
values()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectableConcurrentHashMap(PoolAccessor poolAccessor, int concurrency, long maximumSize, RegisteredEventListeners cacheEventNotificationService)
public SelectableConcurrentHashMap(PoolAccessor poolAccessor, int initialCapacity, float loadFactor, int concurrency, long maximumSize, RegisteredEventListeners cacheEventNotificationService)
Method Detail |
---|
public void setMaxSize(long maxSize)
public Element[] getRandomValues(int size, Object keyHint)
public Object storedObject(Element e)
e
- the element
public int quickSize()
public boolean isEmpty()
public int size()
public ReentrantReadWriteLock lockFor(Object key)
public ReentrantReadWriteLock[] locks()
public Element get(Object key)
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public Element put(Object key, Element element, long sizeOf)
public Element putIfAbsent(Object key, Element element, long sizeOf)
public Element remove(Object key)
public boolean remove(Object key, Object value)
public void clear()
public Set<Object> keySet()
public Collection<Element> values()
public Set<Map.Entry<Object,Element>> entrySet()
protected SelectableConcurrentHashMap.Segment createSegment(int initialCapacity, float lf)
public boolean evict()
public void recalculateSize(Object key)
protected final SelectableConcurrentHashMap.Segment segmentFor(int hash)
hash
- the hash code for the key
protected final List<SelectableConcurrentHashMap.Segment> segments()
protected static int hash(int h)
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |