K
- The type of keys maintainedV
- The type of values maintainedpublic class ExpiringCache<K,V>
extends java.lang.Object
Constructor and Description |
---|
ExpiringCache(long expireAfterMs,
com.netflix.servo.jsr166e.ConcurrentHashMapV8.Fun<K,V> getter)
Create a new ExpiringCache that will expire entries after a given number of milliseconds
computing the values as needed using the given getter.
|
ExpiringCache(long expireAfterMs,
com.netflix.servo.jsr166e.ConcurrentHashMapV8.Fun<K,V> getter,
long expirationFreqMs,
Clock clock)
For unit tests.
|
public ExpiringCache(long expireAfterMs, com.netflix.servo.jsr166e.ConcurrentHashMapV8.Fun<K,V> getter)
expireAfterMs
- Number of milliseconds after which entries will be evictedgetter
- Function that will be used to compute the valuespublic ExpiringCache(long expireAfterMs, com.netflix.servo.jsr166e.ConcurrentHashMapV8.Fun<K,V> getter, long expirationFreqMs, Clock clock)
expireAfterMs
- Number of milliseconds after which entries will be evictedgetter
- Function that will be used to compute the valuesexpirationFreqMs
- Frequency at which to schedule the job that evicts entries
from the cache.public java.util.List<V> values()
public int size()
public java.lang.String toString()
toString
in class java.lang.Object