Detailed Description
This is a Least Recently Used (LRU) cache with multiple linked lists in place of the usual single linked list.
The linked list to use is assigned at random and stored in the cached item. This will generate an even set of results across the different linked lists. The approach reduces the probability of the same linked list being locked when used in a environments with a high degree of concurrency. If the feature is not required then the constructor should be provided with a concurrency value of 1 so that a single linked list is used.
Although this cache is written to be very generic, the primary use-case is to provide a result cache for Aspect Engines in the Pipeline API.
- See also
- Specification
- Parameters
-
- <K> - key for the cache items
|
- <V> - value for the cache items
|
Inheritance diagram for fiftyone.caching.LruCacheBase< K, V >:
Collaboration diagram for fiftyone.caching.LruCacheBase< K, V >:
Classes
class
| CachedItem
An item stored in the cache along with references to the next and previous items.
|
class
| CacheLinkedList
A linked list used in the LruCache implementation.
|
double
| getPercentageMisses ()
|
V
| get (K key)
Retrieves the value for key requested. More...
|
void
| resetCache ()
Resets the 'stats' for the cache.
|
void
| close ()
|