| Modifier and Type | Class and Description |
|---|---|
| protected static interface | MemoryStore.BackingFactory
Factory interface to create a MemoryStore backing. |
| pack-priv static class | MemoryStore.BasicBackingFactory
Simple backing map factory. |
| private class | MemoryStore.LockProvider
LockProvider implementation that uses the segment locks. |
| private class | MemoryStore.Participant
PoolParticipant that is used with the HeapPool. |
| Modifier and Type | Field and Description |
|---|---|
| private final Ehcache | cache
The cache this store is associated with. |
| private static final int | CONCURRENCY_LEVEL
Set optimisation for 100 concurrent threads. |
| private final CopyStrategyHandler | |
| pack-priv static final float | DEFAULT_LOAD_FACTOR
This is the default from |
| protected final OperationObserver | evictionObserver
Eviction outcome observer |
| private final OperationObserver | |
| private volatile CacheLockProvider | lockProvider
The pool accessor |
| private static final Logger | |
| private final SelectableConcurrentHashMap | map
Map where items are stored by key. |
| private static final int | |
| private volatile int | maximumSize
The maximum size of the store (0 == no limit) |
| private static final CopyStrategyHandler | |
| private volatile Policy | policy
The eviction policy to use |
| private final PoolAccessor | |
| private final OperationObserver | |
| private final OperationObserver | |
| private volatile Status | status
status. |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| protected | MemoryStore(Ehcache
the cache cache, Pool the pool tracking the on-heap usage pool, MemoryStore.the search manager searchManager)Constructs things that all MemoryStores have in common. |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | bufferFull()
Implements net. |
| public final boolean | Returns: true if the element can be added without provoking an eviction.the element element)Check if adding an element won't provoke an eviction. |
| private void | checkCapacity(final Element
the element added by the action calling this check elementJustAdded)If the store is over capacity, evict elements until capacity is reached |
| public final boolean | Returns: true if found. If this method return false, it means that an Element with the given key is definitely not in the MemoryStore. If it returns true, there is an Element there. An attempt to get it may return null if the Element has expired.The Element key key)Implements net. |
| public boolean | containsKeyInMemory(Object
The Element key key)Implements net. |
| public boolean | containsKeyOffHeap(Object
The Element key key)Implements net. |
| public boolean | containsKeyOnDisk(Object
The Element key key)Implements net. |
| public static Store | |
| protected static BruteForceSource | Returns: a BruteForceSource connected to underlying MemoryStore and matching configurationthe underlying store acting as source memoryStore, CacheConfiguration the cache configuration cacheConfiguration)Factory method to wrap the MemoryStore into a BruteForceSource, accounting for transactional and copy configuration |
| public void | deregistered(CacheConfiguration config)
Implements net. |
| pack-priv static Policy | Returns: the chosen eviction policythe cache cache)Chooses the Policy from the cache configuration |
| private boolean | |
| public void | diskCapacityChanged(int
previous capacity oldCapacity, int new capacity newCapacity)Implements net. |
| public synchronized void | |
| public Collection | |
| protected boolean | |
| protected Element | Returns: the evicted element, if any. Otherwise nullthe key key)Evicts the element for the given key, if it exists and is expired |
| public void | |
| private Element | Returns: the element chosen as candidate for evictionthe element added by the action calling this check elementJustAdded)Find a "relatively" unused element. |
| public void | flush()
Implements net. |
| public final Element | Returns: the element, or null if there was no match for the keythe key of the Element key)Implements net. |
| private static boolean | |
| pack-priv static CopyStrategyHandler | |
| protected static int | Returns: the calculated initialCapacity. Returns 0 if the parameter maximumSizeGoal is less than or equal to 0the desired maximum size goal maximumSizeGoal, float the load factor loadFactor)Calculates the initialCapacity for a desired maximumSize goal and loadFactor. |
| public Policy | |
| public int | getInMemorySize()
Implements net. |
| public long | getInMemorySizeInBytes()
Implements net. |
| public Object | getInternalContext()
Implements net. |
| public final List | Returns: An ListImplements net. |
| public Object | getMBean()
Implements net. |
| public int | getOffHeapSize()
Implements net. |
| public long | getOffHeapSizeInBytes()
Implements net. |
| public int | getOnDiskSize()
Implements net. |
| public long | getOnDiskSizeInBytes()
Implements net. |
| public final Element | Returns: the element, or null if there was no match for the keythe cache key key)Implements net. |
| public final int | Returns: The size valueImplements net. |
| public final Status | |
| public final int | Returns: returns 0Implements net. |
| private Lock | |
| public boolean | hasAbortedSizeOf()
Overrides net. Implements net. |
| private boolean | |
| public final boolean | Returns: true if the store is full, false otherwiseAn algorithm to tell if the MemoryStore is at or beyond its carrying capacity. |
| protected Set | |
| public void | loggingChanged(boolean
old value whether logging was enabled or not oldValue, boolean new value whether logging was enabled or not newValue)Implements net. |
| public void | maxBytesLocalDiskChanged(final long
old value in bytes oldValue, final long new value in bytes newValue)Implements net. |
| public void | maxBytesLocalHeapChanged(final long
old value in bytes oldValue, final long new value in bytes newValue)Implements net. |
| public void | maxEntriesInCacheChanged(final long
old value oldValue, final long new value newValue)Implements net. |
| public void | memoryCapacityChanged(int
previous capacity oldCapacity, int new capacity newCapacity)Implements net. |
| protected void | notifyDirectEviction(final Element
the evicted element element)Called when an element is evicted even before it could be installed inside the store |
| private void | notifyExpiry(final Element
the element to notify about its expiry element)Before eviction elements are checked. |
| public boolean | put(final Element
the element to add element)Implements net. |
| public Element | putIfAbsent(Element
element to be added element)Implements net. |
| public boolean | putWithWriter(Element element, CacheWriterManager writerManager)
Implements net. |
| public void | recalculateSize(Object
the key key)Overrides net. Implements net. |
| public void | registered(CacheConfiguration config)
Implements net. |
| public Element | Returns: the Element if one was found, else nullthe key of the Element, usually a String key)Implements net. |
| public final void | removeAll()
Implements net. |
| public Element | removeElement(Element
Element to be removed element, ElementValueComparator ElementValueComparator to use to compare elements comparator)Implements net. |
| private boolean | Returns: true if an element was removed, false otherwise.it is possible for this to be null elementJustAdded)Removes the element chosen by the eviction policy |
| public final Element | removeWithWriter(Object key, CacheWriterManager writerManager)
Implements net. |
| public boolean | replace(Element
Element to be test against old, Element Element to be cached element, ElementValueComparator ElementValueComparator to use to compare elements comparator)Implements net. |
| public Element | replace(Element
Element to be cached element)Implements net. |
| private Element[] | Returns: a random sample of elementsa key used as a hint indicating where the just added element is keyHint)Uses random numbers to sample the entire map. |
| public void | setAttributeExtractors(Map<String, AttributeExtractor> extractors)
Overrides net. Implements net. |
| public void | setInMemoryEvictionPolicy(Policy
the new policy policy)Implements net. |
| public void | timeToIdleChanged(long
previous time to idle value oldTti, long new time to idle value newTti)Implements net. |
| public void | timeToLiveChanged(long
previous time to live value oldTtl, long new time to live value newTtl)Implements net. |