Interface IMemoryCache<K,V> 
- All Known Implementing Classes:
- AbstractDoubleLinkedListMemoryCache,- AbstractMemoryCache,- FIFOMemoryCache,- LHMLRUMemoryCache,- LRUMemoryCache,- MRUMemoryCache,- SoftReferenceMemoryCache
public interface IMemoryCache<K,V> 
For the framework. Insures methods a MemoryCache needs to access.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()Destroy the memory cacheintfreeElements(int numberToFree) This instructs the memory cache to remove the numberToFree according to its eviction policy.Get an item from the cacheReturns the CacheAttributes for the region.Gets the cache hub / region that uses the MemoryCache.Get a set of the keys for all elements in the memory cache.Map<K,ICacheElement<K, V>> getMultiple(Set<K> keys) Gets multiple items from the cache based on the given set of keys.Get an item from the cache without effecting its order or last access timeintgetSize()Get the number of elements contained in the memory storeReturns the historical and statistical data for a region's memory cache.voidinitialize(CompositeCache<K, V> cache) Initialize the memory cachebooleanRemoves an item from the cachevoidRemoves all cached items from the cache.voidSets the CacheAttributes of the region.voidupdate(ICacheElement<K, V> ce) Puts an item to the cache.voidwaterfal(ICacheElement<K, V> ce) Spools the item contained in the provided element to disk
- 
Method Details- 
initializeInitialize the memory cache- Parameters:
- cache- The cache (region) this memory store is attached to.
 
- 
disposeDestroy the memory cache- Throws:
- IOException
 
- 
getSizeint getSize()Get the number of elements contained in the memory store- Returns:
- Element count
 
- 
getStatisticsReturns the historical and statistical data for a region's memory cache.- Returns:
- Statistics and Info for the Memory Cache.
 
- 
getKeySetGet a set of the keys for all elements in the memory cache.- Returns:
- a set of the key type TODO This should probably be done in chunks with a range passed in. This will be a problem if someone puts a 1,000,000 or so items in a region.
 
- 
removeRemoves an item from the cache- Parameters:
- key- Identifies item to be removed
- Returns:
- Description of the Return Value
- Throws:
- IOException- Description of the Exception
 
- 
removeAllRemoves all cached items from the cache.- Throws:
- IOException- Description of the Exception
 
- 
freeElementsThis instructs the memory cache to remove the numberToFree according to its eviction policy. For example, the LRUMemoryCache will remove the numberToFree least recently used items. These will be spooled to disk if a disk auxiliary is available.- Parameters:
- numberToFree-
- Returns:
- the number that were removed. if you ask to free 5, but there are only 3, you will get 3.
- Throws:
- IOException
 
- 
getGet an item from the cache- Parameters:
- key- Description of the Parameter
- Returns:
- Description of the Return Value
- Throws:
- IOException- Description of the Exception
 
- 
getMultipleGets multiple items from the cache based on the given set of keys.- Parameters:
- keys-
- Returns:
- a map of K key to ICacheElement<K, V> element, or an empty map if there is no data in cache for any of these keys
- Throws:
- IOException
 
- 
getQuietGet an item from the cache without effecting its order or last access time- Parameters:
- key- Description of the Parameter
- Returns:
- The quiet value
- Throws:
- IOException- Description of the Exception
 
- 
waterfalSpools the item contained in the provided element to disk- Parameters:
- ce- Description of the Parameter
- Throws:
- IOException- Description of the Exception
 
- 
updatePuts an item to the cache.- Parameters:
- ce- Description of the Parameter
- Throws:
- IOException- Description of the Exception
 
- 
getCacheAttributesReturns the CacheAttributes for the region.- Returns:
- The cacheAttributes value
 
- 
setCacheAttributesSets the CacheAttributes of the region.- Parameters:
- cattr- The new cacheAttributes value
 
- 
getCompositeCacheGets the cache hub / region that uses the MemoryCache.- Returns:
- The cache value
 
 
-