Request a value associated with a key from the cache.
If the value is not in the cache, the value will be requested through the
function defined when the ECM value was created, its computation
returned and the value stored in the cache state map.
If the value is in the cache and has not expired, it will be returned.
If the value is in the cache and a new time is computed in the same
lookup, and the value has been determined to have since expired, it
will be discarded and a new value will be requested for this computation.
Every lookupECM computation increments an accumulator in the cache state
which is used to keep track of the succession of key accesses. Based on the
parameters provided with the CacheWithLRUList constructor, this history
of key accesses is then used to remove entries from the cache back down to
a minimum size. Also, when the modulo of the accumulator and the modulo
value computes to 0, the time request function is invoked. In some cases the
accumulator may get incremented more than once in a lookupECM computation.
As the accumulator is a bound unsigned integer, when the accumulator
increments back to 0, the cache state is completely cleared.
The time request function is invoked in one of two different conditions
When a new key-value entry is requested, the current time is also
requested during the same lookup, as a recent time determination is
needed for a new entry in the key-value cache.
When the modulo of the accumulator and a specified value equals to 0.
When the current time is determined during a lookup, access times of the
entries in the key-value cache are compared with the new time to filter
out expired entries from the key-value map.