Top Description Inners Fields Constructors Methods
com.github.benmanes.caffeine.cache

pack-priv abstract Class BoundedLocalCache<K, V>

Additional top-level class in compilation unit: BLCHeader.

extends DrainStatusRef
implements LocalCache<K, V>
Class Inheritance
All Implemented Interfaces
com.github.benmanes.caffeine.cache.LocalCache, java.util.concurrent.ConcurrentMap, java.util.Map
Annotations
@SuppressWarnings:serial
Type Parameters
<K>
the type of keys maintained by this cache
<V>
the type of mapped values
Static Imports
com.github.benmanes.caffeine.cache.Async.ASYNC_EXPIRY, .Caffeine.calculateHashMapCapacity, .Caffeine.ceilingPowerOfTwo, .Caffeine.requireArgument, .Caffeine.saturatedToNanos, .LocalLoadingCache.newBulkMappingFunction, .LocalLoadingCache.newMappingFunction, .Node.PROBATION, .Node.PROTECTED, .Node.WINDOW, java.util.Locale.US, .Objects.requireNonNull, .Spliterator.DISTINCT, .Spliterator.IMMUTABLE, .Spliterator.NONNULL, .Spliterator.ORDERED, java.util.function.Function.identity

An in-memory cache implementation that supports full concurrency of retrievals, a high expected concurrency for updates, and multiple ways to bound the cache.

This class is abstract and code generated subclasses provide the complete implementation for a particular configuration. This is to ensure that only the fields and execution paths necessary for a given configuration are used.

Author
[email protected] (Ben Manes)

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
BoundedLocalCache.AddTask

Adds the node to the page replacement policy.

pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
BoundedLocalCache.EntryIterator<K, V>

An adapter to safely externalize the entry iterator.

pack-priv static class
BoundedLocalCache.EntrySetView<K, V>

An adapter to safely externalize the entries.

pack-priv static class
BoundedLocalCache.EntrySpliterator<K, V>

An adapter to safely externalize the entry spliterator.

pack-priv static class
BoundedLocalCache.KeyIterator<K, V>

An adapter to safely externalize the key iterator.

pack-priv static class
BoundedLocalCache.KeySetView<K, V>

An adapter to safely externalize the keys.

pack-priv static class
BoundedLocalCache.KeySpliterator<K, V>

An adapter to safely externalize the key spliterator.

pack-priv static class
BoundedLocalCache.PerformCleanupTask

A reusable task that performs the maintenance work; used to avoid wrapping by ForkJoinPool.

pack-priv class
BoundedLocalCache.RemovalTask

Removes a node from the page replacement policy.

pack-priv static class
BoundedLocalCache.SizeLimiter<K, V>

A function that produces an unmodifiable map up to the limit in stream order.

pack-priv class
BoundedLocalCache.UpdateTask

Updates the weighted size.

pack-priv static class
BoundedLocalCache.ValueIterator<K, V>

An adapter to safely externalize the value iterator.

pack-priv static class
BoundedLocalCache.ValueSpliterator<K, V>

An adapter to safely externalize the value spliterator.

pack-priv static class
BoundedLocalCache.ValuesView<K, V>

An adapter to safely externalize the values.

pack-priv static class
BoundedLocalCache.WeightLimiter<K, V>

A function that produces an unmodifiable map up to the weighted limit in stream order.

Field Summary

Modifier and TypeField and Description
pack-priv final Consumer<Node<K, V>>
pack-priv static final int
ADMIT_HASHDOS_THRESHOLD

The minimum popularity for allowing randomized admission.

pack-priv final @Nullable AsyncCacheLoader<K, V>
pack-priv final ConcurrentHashMap<Object, Node<K, V>>
pack-priv final BoundedLocalCache.PerformCleanupTask
pack-priv @Nullable Set<Map.Entry<K, V>>
pack-priv final @Nullable RemovalListener<K, V>
pack-priv final ReentrantLock
pack-priv final Executor
pack-priv static final long
EXPIRE_WRITE_TOLERANCE

The maximum time window between entry updates before the expiration must be reordered.

pack-priv static final double
HILL_CLIMBER_RESTART_THRESHOLD

The difference in hit rates that restarts the climber.

pack-priv static final double
HILL_CLIMBER_STEP_DECAY_RATE

The rate to decrease the step size to adapt by.

pack-priv static final double
HILL_CLIMBER_STEP_PERCENT

The percent of the total size to adapt the window by.

pack-priv final boolean
pack-priv final boolean
pack-priv @Nullable Set<K>
pack-priv static final System.Logger
pack-priv static final int
MAX_PUT_SPIN_WAIT_ATTEMPTS

The number of retries before computing to validate the entry's integrity; pow2 modulus.

pack-priv static final long
MAXIMUM_CAPACITY

The maximum weighted capacity of the map.

pack-priv static final long
MAXIMUM_EXPIRY

The maximum duration before an entry expires.

pack-priv static final int
NCPU

The number of CPUs

pack-priv final NodeFactory<K, V>
pack-priv static final double
PERCENT_MAIN

The initial percent of the maximum weighted capacity dedicated to the main space.

pack-priv static final double
PERCENT_MAIN_PROTECTED

The percent of the maximum weighted capacity dedicated to the main's protected space.

pack-priv static final int
QUEUE_TRANSFER_THRESHOLD

The maximum number of entries that can be transferred between queues.

pack-priv final Buffer<Node<K, V>>
pack-priv static final VarHandle
REFRESHES

The handle for the in-flight refresh operations.

pack-priv volatile @Nullable ConcurrentMap<Object, CompletableFuture<?>>
pack-priv @Nullable Collection<V>
pack-priv static final long
WARN_AFTER_LOCK_WAIT_NANOS

The duration to wait on the eviction lock before warning of a possible misuse.

pack-priv final Weigher<K, V>
pack-priv static final int
WRITE_BUFFER_MAX

The maximum capacity of the write buffer.

pack-priv static final int
WRITE_BUFFER_MIN

The initial capacity of the write buffer.

pack-priv static final int
WRITE_BUFFER_RETRIES

The number of attempts to insert into the write buffer before yielding.

pack-priv final MpscGrowableArrayQueue<Runnable>
Inherited from com.github.benmanes.caffeine.cache.BLCHeader.DrainStatusRef:
DRAIN_STATUSdrainStatusIDLEPROCESSING_TO_IDLEPROCESSING_TO_REQUIREDREQUIRED

Constructor Summary

AccessConstructor and Description
protected
BoundedLocalCache(Caffeine<K, V> builder, @Nullable AsyncCacheLoader<K, V> cacheLoader, boolean isAsync)

Creates an instance based on the builder's configuration.

Method Summary

Modifier and TypeMethod and Description
protected AccessOrderDeque<Node<K, V>>
protected AccessOrderDeque<Node<K, V>>
protected AccessOrderDeque<Node<K, V>>
protected long
pack-priv boolean

Returns:

if the candidate should be admitted and the victim ejected
admit
(K
the key for the entry being proposed for long term retention
candidateKey
,
K
the key for the entry chosen by the eviction policy for replacement
victimKey
)

Determines if the candidate should be accepted into the main space, as determined by its frequency relative to the victim.

pack-priv @Nullable V

Returns:

the refreshed value if immediately loaded, else null
afterRead
(Node<K, V>
the entry in the page replacement policy
node
,
long
the current time, in nanoseconds
now
,
boolean
if the hit count should be incremented
recordHit
)

Performs the post-processing work required after a read.

pack-priv void
afterWrite(Runnable
the pending operation to be applied
task
)

Performs the post-processing work required after a write.

pack-priv String
brokenEqualityMessage(Object key, Node<?, ?> node)

Returns the formatted broken equality error message.

public void
public void
clear()

Implements java.util.Map.clear.

Removes all of the mappings from this map (optional operation).
pack-priv void
climb()

Adapts the eviction policy to towards the optimal recency / frequency configuration.

protected boolean
collectKeys()

Returns if the keys are weak reference garbage collected.

protected boolean
collectValues()

Returns if the values are weak or soft reference garbage collected.

public @Nullable V
compute(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction, @Nullable Expiry<? super K, ? super V> expiry, boolean recordLoad, boolean recordLoadFailure)

public @Nullable V
computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction, boolean recordStats, boolean recordLoad)

Implements com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent.

See ConcurrentMap#computeIfAbsent.
public @Nullable V
computeIfPresent(K
key with which the specified value is to be associated
key
,
BiFunction<? super K, ? super V, ? extends V>
the remapping function to compute a value
remappingFunction
)

Overrides default java.util.concurrent.ConcurrentMap.computeIfPresent.

If the value for the specified key is present and non-null, attempts to compute a new mapping given the key and its current mapped value.
public boolean
containsKey(Object
key whose presence in this map is to be tested
key
)

Implements java.util.Map.containsKey.

Returns true if this map contains a mapping for the specified key.
public boolean
containsValue(Object
value whose presence in this map is to be tested
value
)

Implements java.util.Map.containsValue.

Returns true if this map maps one or more keys to the specified value.
pack-priv void
decreaseWindow()

Decreases the size of the admission window and increases the main's protected region.

pack-priv void
demoteFromMainProtected()

Transfers the nodes from the protected to the probation region if it exceeds the maximum.

pack-priv void
determineAdjustment()

Calculates the amount to adapt the window by and sets adjustment() accordingly.

pack-priv void
discardRefresh(Object keyReference)

Invalidate the in-flight refresh.

pack-priv @Nullable V
doComputeIfAbsent(K key, Object keyRef, Function<? super K, ? extends V> mappingFunction, long[] now, boolean recordStats)

Returns the current value from a computeIfAbsent invocation.

pack-priv void
drainKeyReferences()

Drains the weak key references queue.

pack-priv void
drainReadBuffer()

Drains the read buffer.

pack-priv void
drainValueReferences()

Drains the weak / soft value references queue.

pack-priv void
drainWriteBuffer()

Drains the write buffer.

public Set<Map.Entry<K, V>>
entrySet()

Implements java.util.Map.entrySet.

Returns a Set view of the mappings contained in this map.
public boolean
equals(Object
object to be compared for equality with this map
o
)

Overrides java.lang.Object.equals.

Implements java.util.Map.equals.

Object equality requires reflexive, symmetric, transitive, and consistency properties.
public long
pack-priv void
evictEntries()

Evicts entries if the cache exceeds the maximum.

pack-priv boolean

Returns:

if the entry was evicted
evictEntry
(Node<K, V>
the entry to evict
node
,
RemovalCause
the reason to evict
cause
,
long
the current time, used only if expiring
now
)

Attempts to evict the entry based on the given removal cause.

pack-priv void
evictFromMain(@Nullable Node<K, V>
the first candidate promoted into the probation space
candidate
)

Evicts entries from the main space if the cache exceeds the maximum capacity.

pack-priv @Nullable Node<K, V>

Returns:

the first candidate promoted into the probation space
evictFromWindow
()

Evicts entries from the window space into the main space while the window size exceeds a maximum.

pack-priv <T> T

Returns:

the computed value
evictionOrder
(boolean
the coldest or hottest iteration order
hottest
,
Function<V, V>
a function that unwraps the value
transformer
,
Function<Stream<Policy.CacheEntry<K, V>>, T>
the mapping function to compute a value
mappingFunction
)

Returns the computed result from the ordered traversal of the cache entries.

protected boolean
evicts()

Returns if the cache evicts entries due to a maximum size or weight threshold.

public final Executor
executor()

Implements com.github.benmanes.caffeine.cache.LocalCache.executor.

Returns the Executor used by this cache.
public Ticker
expirationTicker()

Returns the Ticker used by this cache for expiration.

pack-priv void
expireAfterAccessEntries(long now)

Expires entries in the access-order queue.

pack-priv void
expireAfterAccessEntries(AccessOrderDeque<Node<K, V>> accessOrderDeque, long now)

Expires entries in an access-order queue.

pack-priv <T> T

Returns:

the computed value
expireAfterAccessOrder
(boolean
the youngest or oldest iteration order
oldest
,
Function<V, V>
a function that unwraps the value
transformer
,
Function<Stream<Policy.CacheEntry<K, V>>, T>
the mapping function to compute a value
mappingFunction
)

Returns the computed result from the ordered traversal of the cache entries.

pack-priv long

Returns:

the expiration time
expireAfterCreate
(@Nullable K
the key of the entry that was created
key
,
@Nullable V
the value of the entry that was created
value
,
Expiry<? super K, ? super V>
the calculator for the expiration time
expiry
,
long
the current time, in nanoseconds
now
)

Returns the expiration time for the entry after being created.

pack-priv long

Returns:

the expiration time
expireAfterRead
(Node<K, V>
the entry in the page replacement policy
node
,
@Nullable K
the key of the entry that was read
key
,
@Nullable V
the value of the entry that was read
value
,
Expiry<K, V>
the calculator for the expiration time
expiry
,
long
the current time, in nanoseconds
now
)

Returns the access time for the entry after a read.

pack-priv long

Returns:

the expiration time
expireAfterUpdate
(Node<K, V>
the entry in the page replacement policy
node
,
@Nullable K
the key of the entry that was updated
key
,
@Nullable V
the value of the entry that was updated
value
,
Expiry<? super K, ? super V>
the calculator for the expiration time
expiry
,
long
the current time, in nanoseconds
now
)

Returns the expiration time for the entry after being updated.

pack-priv void
expireAfterWriteEntries(long now)

Expires entries on the write-order queue.

pack-priv void
expireEntries()

Expires entries that have expired by access, write, or variable.

protected boolean
expiresAfterAccess()

Returns if the cache expires entries after an access time threshold.

protected long
expiresAfterAccessNanos()

Returns how long after the last access to an entry the map will retain that entry.

protected boolean
expiresAfterWrite()

Returns if the cache expires entries after a write time threshold.

protected long
expiresAfterWriteNanos()

Returns how long after the last write to an entry the map will retain that entry.

protected boolean
expiresVariable()

Returns if the cache expires entries after a variable time threshold.

pack-priv void
expireVariableEntries(long now)

Expires entries in the timer wheel.

public Expiry<K, V>
expiry()

Implements com.github.benmanes.caffeine.cache.LocalCache.expiry.

Returns the Expiry used by this cache.
protected boolean
fastpath()

Returns if an access to an entry can skip notifying the eviction policy.

public void
forEach(BiConsumer<? super K, ? super V>
The action to be performed for each entry
action
)

Overrides default java.util.concurrent.ConcurrentMap.forEach.

Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.
protected FrequencySketch<K>
public @Nullable V
get(Object
the key whose associated value is to be returned
key
)

Implements java.util.Map.get.

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.
public Map<K, V>
pack-priv long
getExpirationDelay(long now)

Returns the duration until the next item expires, or Long#MAX_VALUE if none.

public @Nullable V
public @Nullable V
public @Nullable K

Returns:

the key used by the mapping, or null if this cache does not contain a mapping for the key
getKey
(K
the key whose canonical instance is to be returned
key
)

Returns the key associated with the mapping in this cache, or null if there is none.

pack-priv boolean
hasExpired(Node<K, V> node, long now)

Returns if the entry has expired.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.hashCode.

Returns the hash code value for this map.
protected boolean
protected int
pack-priv void
increaseWindow()

Increases the size of the admission window by shrinking the portion allocated to the main space.

public boolean
isAsync()

Implements com.github.benmanes.caffeine.cache.LocalCache.isAsync.

Returns whether this cache is asynchronous.
pack-priv final boolean
isComputingAsync(Node<?, ?> node)

Returns if the node's value is currently being computed asynchronously.

public boolean
isEmpty()

Implements java.util.Map.isEmpty.

Returns true if this map contains no key-value mappings.
public boolean
isPendingEviction(K key)

Implements com.github.benmanes.caffeine.cache.LocalCache.isPendingEviction.

Returns whether an absent entry has expired or has been reference collected but has not yet been removed from the cache.
public boolean
isRecordingStats()

Implements com.github.benmanes.caffeine.cache.LocalCache.isRecordingStats.

Returns whether this cache has statistics enabled.
protected boolean
isWeighted()

Returns if entries may be assigned different weights.

protected ReferenceQueue<K>
public Set<K>
keySet()

Implements java.util.Map.keySet.

Returns a Set view of the keys contained in this map.
pack-priv void
lock()

Acquires the eviction lock.

pack-priv void
logIfAlive(Node<?, ?> node)

Logs if the node cannot be found in the map but is still alive.

protected long
mainProtectedMaximum()

Returns the maximum weighted size of the main's protected space.

protected long
mainProtectedWeightedSize()

Returns the uncorrected combined weight of the values in the main's protected space.

pack-priv void
maintenance(@Nullable Runnable
an additional pending task to run, or null if not present
task
)

Performs the pending maintenance work and sets the state flags during processing to avoid excess scheduling attempts.

pack-priv void
makeDead(Node<K, V>
the entry in the page replacement policy
node
)

Atomically transitions the node to the dead state and decrements the weightedSize.

pack-priv static <K, V> SerializationProxy<K, V>
makeSerializationProxy(BoundedLocalCache<?, ?> cache)

Creates a serialization proxy based on the common configuration shared by all cache types.

protected long
maximum()

Returns the maximum weighted size.

public @Nullable V
merge(K
key with which the resulting value is to be associated
key
,
V
the non-null value to be merged with the existing value associated with the key or, if no existing value or a null value is associated with the key, to be associated with the key
value
,
BiFunction<? super V, ? super V, ? extends V>
the remapping function to recompute a value if present
remappingFunction
)

Overrides default java.util.concurrent.ConcurrentMap.merge.

If the specified key is not already associated with a value or is associated with null, associates it with the given non-null value.
protected int
pack-priv @Nullable Policy.CacheEntry<K, V>
nodeToCacheEntry(Node<K, V> node, Function<V, V> transformer)

Returns an entry for the given node if it can be used externally, else null.

pack-priv void
public void
pack-priv void
onAccess(Node<K, V> node)

Updates the node's location in the page replacement policy.

protected @Nullable Pacer
pacer()

Returns the Pacer used to schedule the maintenance task.

pack-priv void
performCleanUp(@Nullable Runnable
an additional pending task to run, or null if not present
task
)

Performs the maintenance work, blocking until the lock is acquired.

protected double
public @Nullable V
put(K
key with which the specified value is to be associated
key
,
V
value to be associated with the specified key
value
)

Implements java.util.Map.put.

Associates the specified value with the specified key in this map (optional operation).
pack-priv @Nullable V

Returns:

the prior value in or null if no mapping was found
put
(K
key with which the specified value is to be associated
key
,
V
value to be associated with the specified key
value
,
Expiry<K, V>
the calculator for the write expiration time
expiry
,
boolean
a write is performed only if the key is not already associated with a value
onlyIfAbsent
)

Adds a node to the policy and the data store.

public void
putAll(Map<? extends K, ? extends V>
mappings to be stored in this map
map
)

Implements java.util.Map.putAll.

Copies all of the mappings from the specified map to this map (optional operation).
public @Nullable V
putIfAbsent(K
key with which the specified value is to be associated
key
,
V
value to be associated with the specified key
value
)

Implements java.util.concurrent.ConcurrentMap.putIfAbsent.

If the specified key is not already associated with a value, associates it with the given value.
public Object
referenceKey(K key)

Implements com.github.benmanes.caffeine.cache.LocalCache.referenceKey.

Returns the reference key.
protected boolean
refreshAfterWrite()

Returns if the cache refreshes entries after a write time threshold.

protected long
refreshAfterWriteNanos()

Returns how long after the last write an entry becomes a candidate for refresh.

public ConcurrentMap<Object, CompletableFuture<?>>
refreshes()

Implements com.github.benmanes.caffeine.cache.LocalCache.refreshes.

Returns the map of in-flight refresh operations.
pack-priv @Nullable V

Returns:

the refreshed value if immediately loaded, else null
refreshIfNeeded
(Node<K, V>
the entry in the cache to refresh
node
,
long
the current time, in nanoseconds
now
)

Asynchronously refreshes the entry if eligible.

pack-priv @Nullable V

Returns:

the new value associated with the specified key, or null if none
remap
(K
key with which the specified value is to be associated
key
,
Object
the key to associate with or a lookup only key if not computeIfAbsent
keyRef
,
BiFunction<? super K, ? super V, ? extends V>
the function to compute a value
remappingFunction
,
Expiry<? super K, ? super V>
the calculator for the expiration time
expiry
,
long[]
the current time, according to the ticker
now
,
boolean
if an absent entry can be computed
computeIfAbsent
)

Attempts to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping).

protected RemovalListener<K, V>
public @Nullable V
remove(Object
key whose mapping is to be removed from the map
key
)

Implements java.util.Map.remove.

Removes the mapping for a key from this map if it is present (optional operation).
public boolean
remove(Object
key with which the specified value is associated
key
,
Object
value expected to be associated with the specified key
value
)

Implements java.util.concurrent.ConcurrentMap.remove.

Removes the entry for a key only if currently mapped to a given value.
pack-priv void
removeNode(Node<K, V> node, long now)

pack-priv static <K, V> void
reorder(LinkedDeque<Node<K, V>> deque, Node<K, V> node)

Updates the node's location in the policy's deque.

pack-priv void
reorderProbation(Node<K, V> node)

Promote the node from probation to protected on an access.

public @Nullable V
replace(K
key with which the specified value is associated
key
,
V
value to be associated with the specified key
value
)

Implements java.util.concurrent.ConcurrentMap.replace.

Replaces the entry for a key only if currently mapped to some value.
public boolean
replace(K
key with which the specified value is associated
key
,
V
value expected to be associated with the specified key
oldValue
,
V
value to be associated with the specified key
newValue
)

Implements java.util.concurrent.ConcurrentMap.replace.

Replaces the entry for a key only if currently mapped to a given value.
public boolean
replace(K key, V oldValue, V newValue, boolean shouldDiscardRefresh)

Implements com.github.benmanes.caffeine.cache.LocalCache.replace.

See ConcurrentMap#replace(K, K, V).
public void
replaceAll(BiFunction<? super K, ? super V, ? extends V>
the function to apply to each entry
function
)

Overrides default java.util.concurrent.ConcurrentMap.replaceAll.

Replaces each entry's value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception.
pack-priv void
requireIsAlive(Object key, Node<?, ?> node)

Ensures that the node is alive during the map operation.

pack-priv void
rescheduleCleanUpIfIncomplete()

If there remains pending operations that were not handled by the prior clean up then try to schedule an asynchronous maintenance task.

protected int
pack-priv void
scheduleAfterWrite()

Conditionally schedules the asynchronous maintenance task after a write operation.

pack-priv void
scheduleDrainBuffers()

Attempts to schedule an asynchronous task to apply the pending operations to the page replacement policy.

pack-priv void
setAccessTime(Node<K, V> node, long now)

protected void
setAdjustment(long amount)

protected void
setExpiresAfterAccessNanos(long expireAfterAccessNanos)

protected void
setExpiresAfterWriteNanos(long expireAfterWriteNanos)

protected void
setHitsInSample(int hitCount)

protected void
protected void
setMainProtectedWeightedSize(long weightedSize)

protected void
setMaximum(long maximum)

pack-priv void
setMaximumSize(long maximum)

Sets the maximum weighted size of the cache.

protected void
setMissesInSample(int missCount)

protected void
setPreviousSampleHitRate(double hitRate)

protected void
setRefreshAfterWriteNanos(long refreshAfterWriteNanos)

protected void
setSampleCount(int sampleCount)

protected void
setStepSize(double stepSize)

pack-priv void
setVariableTime(Node<K, V> node, long expirationTime)

protected void
setWeightedSize(long weightedSize)

protected void
setWindowMaximum(long maximum)

protected void
setWindowWeightedSize(long weightedSize)

pack-priv void
setWriteTime(Node<K, V> node, long now)

public int
size()

Implements java.util.Map.size.

Returns the number of key-value mappings in this map.
pack-priv boolean
skipReadBuffer()

Returns if the cache should bypass the read buffer.

pack-priv <T> T

Returns:

the computed value
snapshot
(Iterable<Node<K, V>>
the supplier of the entries in the cache
iterable
,
Function<V, V>
a function that unwraps the value
transformer
,
Function<Stream<Policy.CacheEntry<K, V>>, T>
the mapping function to compute a value
mappingFunction
)

Returns the computed result from the ordered traversal of the cache entries.

public StatsCounter
public Ticker
statsTicker()

Implements com.github.benmanes.caffeine.cache.LocalCache.statsTicker.

Returns the Ticker used by this cache for statistics.
protected double
protected TimerWheel<K, V>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
pack-priv void
tryExpireAfterRead(Node<K, V>
the entry in the page replacement policy
node
,
@Nullable K
the key of the entry that was read
key
,
@Nullable V
the value of the entry that was read
value
,
Expiry<K, V>
the calculator for the expiration time
expiry
,
long
the current time, in nanoseconds
now
)

Attempts to update the access time for the entry after a read.

protected ReferenceQueue<V>
public Collection<V>
values()

Implements java.util.Map.values.

Returns a Collection view of the values contained in this map.
protected long
weightedSize()

Returns the combined weight of the values in the cache (may be negative).

protected long
windowMaximum()

Returns the maximum weighted size of the window space.

protected long
windowWeightedSize()

Returns the uncorrected combined weight of the values in the window space.

protected WriteOrderDeque<Node<K, V>>
Inherited from com.github.benmanes.caffeine.cache.BLCHeader.DrainStatusRef:
casDrainStatusdrainStatusAcquiredrainStatusOpaquesetDrainStatusOpaquesetDrainStatusReleaseshouldDrainBuffers