| Modifier and Type | Field and Description |
|---|---|
| private volatile ConcurrentHashMap. | |
| private static final Logger | |
| private static final int | |
| private volatile long | |
| private volatile Policy | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | CountBasedBackEnd(final long
amount of mappings this should hold before it starts evicting maxEntriesLocalHeap)Constructs a cap'ed backend |
| public | CountBasedBackEnd(final long
amount of mappings this should hold before it starts evicting maxEntriesLocalHeap, final Policy the policy it'll use to decide what to evict policy)Constructs a cap'ed backend |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear(final boolean
whether to notify listeners or not notify)Implements net. CHM.
|
| private void | |
| private Element | |
| public long | |
| public Policy | getPolicy()
Implements net. |
| public boolean | hasSpace()
Implements net. true if this tier has enough space for more entries.
|
| public V | putIfAbsent(final K
key with which the specified value is to be associated key, final V value to be associated with the specified key value)Overrides net. Implements net. java. CHM.putIfAbsent(Object, Object)}, but
will evict if required (on successful put)
|
| public void | recalculateSize(final K key)
Overrides net. Implements net. |
| public void | registerEvictionCallback(final HeapCacheBackEnd.
the thing to call back on evictionCallbackImplements net. |
| public V | remove(final Object
key whose mapping is to be removed from the map key)Overrides net. Implements net. CHM.
|
| public void | |
| public void | setPolicy(final Policy
the new eviction Policy to use policy)Implements net. |
| callback | back to summary |
|---|---|
| private volatile ConcurrentHashMap. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| MAX_EVICTIONS | back to summary |
|---|---|
| private static final int MAX_EVICTIONS | |
| maxEntriesLocalHeap | back to summary |
|---|---|
| private volatile long maxEntriesLocalHeap | |
| policy | back to summary |
|---|---|
| private volatile Policy policy | |
| SAMPLING_SIZE | back to summary |
|---|---|
| private static final int SAMPLING_SIZE | |
| CountBasedBackEnd | back to summary |
|---|---|
| public CountBasedBackEnd(final long maxEntriesLocalHeap) Constructs a cap'ed backend
| |
| CountBasedBackEnd | back to summary |
|---|---|
| public CountBasedBackEnd(final long maxEntriesLocalHeap, final Policy policy) Constructs a cap'ed backend
| |
| clear | back to summary |
|---|---|
| public void clear(final boolean notify) Implements net. Doc from net. Basically
| |
| evictIfRequired | back to summary |
|---|---|
| private void evictIfRequired(final K key, final V value) | |
| findEvictionCandidate | back to summary |
|---|---|
| private Element findEvictionCandidate(final K key, final V value) | |
| getMaxEntriesLocalHeap | back to summary |
|---|---|
| public long getMaxEntriesLocalHeap() Reads the current capacity limit
| |
| getPolicy | back to summary |
|---|---|
| public Policy getPolicy() Implements net. Doc from net. queries the potential eviction policy for the heap caching tier | |
| hasSpace | back to summary |
|---|---|
| public boolean hasSpace() Implements net. Doc from net. Return
| |
| putIfAbsent | back to summary |
|---|---|
| public V putIfAbsent(final K key, final V value) Overrides net. Implements net. Doc from net. Basically
| |
| recalculateSize | back to summary |
|---|---|
| public void recalculateSize(final K key) Overrides net. Implements net. Doc from net. This is evil! Don't call this!
| |
| registerEvictionCallback | back to summary |
|---|---|
| public void registerEvictionCallback(final HeapCacheBackEnd. Implements net. Doc from net. Let's you register a single callback for evictions
| |
| remove | back to summary |
|---|---|
| public V remove(final Object key) Overrides net. Implements net. Doc from net. Basically | |
| setMaxEntriesLocalHeap | back to summary |
|---|---|
| public void setMaxEntriesLocalHeap(final long maxEntriesLocalHeap) Sets the capacity limit
| |
| setPolicy | back to summary |
|---|---|
| public void setPolicy(final Policy policy) Implements net. Dynamic property to switch the policy out
| |