Additional top-level class in compilation unit: BLCHeader.
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.
| Modifier and Type | Class 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 | |
| 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.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 | |
| pack-priv static class | |
| pack-priv static class | |
| pack-priv static class | BoundedLocalCache.WeightLimiter<K, V>
A function that produces an unmodifiable map up to the weighted limit in stream order. |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Consumer | |
| pack-priv static final int | ADMIT_HASHDOS_THRESHOLD
The minimum popularity for allowing randomized admission. |
| pack-priv final @Nullable AsyncCacheLoader | |
| pack-priv final ConcurrentHashMap | |
| pack-priv final BoundedLocalCache. | |
| pack-priv @Nullable Set | |
| pack-priv final @Nullable RemovalListener | |
| 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 | |
| pack-priv static final System. | |
| 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 | |
| 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 | |
| pack-priv static final VarHandle | REFRESHES
The handle for the in-flight refresh operations. |
| pack-priv volatile @Nullable ConcurrentMap | |
| pack-priv @Nullable Collection | |
| 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 | |
| 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 |
| Access | Constructor and Description |
|---|---|
| protected | BoundedLocalCache(Caffeine<K, V> builder, @Nullable AsyncCacheLoader<K, V> cacheLoader, boolean isAsync)
Creates an instance based on the builder's configuration. |
| Modifier and Type | Method and Description |
|---|---|
| protected AccessOrderDeque | |
| protected AccessOrderDeque | |
| protected AccessOrderDeque | |
| protected long | |
| pack-priv boolean | Returns: if the candidate should be admitted and the victim ejectedthe 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 | |
| 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. |
| pack-priv void | |
| protected boolean | |
| protected boolean | |
| 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. 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. |
| public boolean | containsKey(Object
key whose presence in this map is to be tested key)Implements java. 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. 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 |
| pack-priv void | |
| 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 | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| public Set | entrySet()
Implements java. 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. Implements java. |
| public long | |
| pack-priv void | |
| pack-priv boolean | Returns: if the entry was evictedthe 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 | Returns: the first candidate promoted into the probation spaceEvicts entries from the window space into the main space while the window size exceeds a maximum. |
| pack-priv <T> T | Returns: the computed valuethe coldest or hottest iteration order hottest, Function<V, V> a function that unwraps the value transformer, Function<Stream<Policy.the mapping function to compute a value mappingFunctionReturns the computed result from the ordered traversal of the cache entries. |
| protected boolean | |
| public final Executor | executor()
Implements com. Executor used by this cache.
|
| public Ticker | |
| pack-priv void | |
| 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 valuethe youngest or oldest iteration order oldest, Function<V, V> a function that unwraps the value transformer, Function<Stream<Policy.the mapping function to compute a value mappingFunctionReturns the computed result from the ordered traversal of the cache entries. |
| pack-priv long | Returns: the expiration timethe 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 timethe 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 timethe 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 | |
| pack-priv void | |
| protected boolean | |
| protected long | expiresAfterAccessNanos()
Returns how long after the last access to an entry the map will retain that entry. |
| protected boolean | |
| protected long | expiresAfterWriteNanos()
Returns how long after the last write to an entry the map will retain that entry. |
| protected boolean | |
| pack-priv void | |
| public Expiry | expiry()
Implements com. Expiry used by this cache.
|
| protected boolean | |
| public void | forEach(BiConsumer<? super K, ? super V>
The action to be performed for each entry action)Overrides default java. |
| protected FrequencySketch | |
| public @Nullable V | get(Object
the key whose associated value is to be returned key)Implements java. null if this map contains no mapping for the key.
|
| public Map | getAllPresent(Iterable<? extends K> keys)
Implements com. Cache#getAllPresent.
|
| pack-priv long | getExpirationDelay(long now)
Returns the duration until the next item expires, or |
| public @Nullable V | getIfPresent(Object key, boolean recordStats)
Implements com. Cache#getIfPresent(K).
|
| public @Nullable V | |
| public @Nullable K | Returns: the key used by the mapping, ornull if this cache does not contain a mapping
for the keythe key whose canonical instance is to be returned key)Returns the key associated with the mapping in this cache, or |
| pack-priv boolean | |
| public int | hashCode()
Overrides java. Implements java. |
| 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. |
| pack-priv final boolean | isComputingAsync(Node<?, ?> node)
Returns if the node's value is currently being computed asynchronously. |
| public boolean | |
| public boolean | isPendingEviction(K key)
Implements com. |
| public boolean | isRecordingStats()
Implements com. |
| protected boolean | |
| protected ReferenceQueue | |
| public Set | |
| pack-priv void | |
| pack-priv void | |
| protected long | |
| 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 task)null if not presentPerforms the pending maintenance work and sets the state flags during processing to avoid excess scheduling attempts. |
| pack-priv void | |
| pack-priv static <K, V> SerializationProxy | makeSerializationProxy(BoundedLocalCache<?, ?> cache)
Creates a serialization proxy based on the common configuration shared by all cache types. |
| protected long | |
| 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. |
| protected int | |
| pack-priv @Nullable Policy. | 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 | |
| protected @Nullable Pacer | |
| pack-priv void | performCleanUp(@Nullable Runnable
an additional pending task to run, or task)null if not presentPerforms 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. |
| pack-priv @Nullable V | Returns: the prior value in or null if no mapping was foundkey 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. |
| 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. |
| public Object | referenceKey(K key)
Implements com. |
| protected boolean | |
| protected long | refreshAfterWriteNanos()
Returns how long after the last write an entry becomes a candidate for refresh. |
| public ConcurrentMap | refreshes()
Implements com. |
| pack-priv @Nullable V | Returns: the refreshed value if immediately loaded, else nullthe 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 nonekey 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
|
| protected RemovalListener | |
| public @Nullable V | remove(Object
key whose mapping is to be removed from the map key)Implements java. |
| 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. |
| pack-priv void | |
| 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 | |
| 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. |
| 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. |
| public boolean | replace(K key, V oldValue, V newValue, boolean shouldDiscardRefresh)
Implements com. 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. |
| pack-priv void | |
| 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 | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| pack-priv void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| pack-priv void | |
| protected void | |
| protected void | |
| protected void | |
| pack-priv void | |
| public int | |
| pack-priv boolean | |
| pack-priv <T> T | Returns: the computed valuethe supplier of the entries in the cache iterable, Function<V, V> a function that unwraps the value transformer, Function<Stream<Policy.the mapping function to compute a value mappingFunctionReturns the computed result from the ordered traversal of the cache entries. |
| public StatsCounter | statsCounter()
Implements com. StatsCounter used by this cache.
|
| public Ticker | statsTicker()
Implements com. Ticker used by this cache for statistics.
|
| protected double | |
| protected TimerWheel | |
| public String | |
| 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 | |
| public Collection | values()
Implements java. Collection view of the values contained in this map.
|
| protected long | |
| protected long | |
| protected long | |
| protected WriteOrderDeque |