com.github.benmanes.caffeine.cache.Caffeine builder.
A com.github.benmanes.caffeine.cache.Cache provides similar characteristics to
java.util.concurrent.ConcurrentHashMap, with additional support for policies to bound the
map. When built with a com.github.benmanes.caffeine.cache.CacheLoader, the
com.github.benmanes.caffeine.cache.LoadingCache variant allows the cache to populate
itself on a miss and offers refresh capabilities.
A com.github.benmanes.caffeine.cache.AsyncCache is similar to a
com.github.benmanes.caffeine.cache.Cache, except that a cache entry holds a
java.util.concurrent.CompletableFuture of the value. This entry will be automatically
removed if the future fails, resolves to null, or based on an eviction policy. When built
with a com.github.benmanes.caffeine.cache.AsyncCacheLoader, the
com.github.benmanes.caffeine.cache.AsyncLoadingCache variant allows the cache to populate
itself on a miss and offers refresh capabilities.
Additional functionality such as bounding by the entry's size, removal notifications, statistics,
and eviction policies are described in the com.github.benmanes.caffeine.cache.Caffeine
builder.
| Modifier and Type | Interface and Description |
|---|---|
| public interface | AsyncCache<
the type of keys maintained by this cache K, the type of mapped values V>A semi-persistent mapping from keys to values. |
| public interface | AsyncCacheLoader<K, V>
Computes or retrieves values asynchronously based on a key, for use in populating a
|
| public interface | AsyncLoadingCache<
the type of keys maintained by this cache K, the type of mapped values V>A semi-persistent mapping from keys to values. |
| pack-priv interface | Buffer<
the type of elements maintained by this buffer E>A multiple-producer / single-consumer buffer that rejects new elements if it is full or fails spuriously due to contention. |
| public interface | Cache<
the type of keys maintained by this cache K, the type of mapped values V>A semi-persistent mapping from keys to values. |
| public interface | CacheLoader<K, V>
Computes or retrieves values, based on a key, for use in populating a |
| public interface | |
| public interface | |
| pack-priv interface | LinkedDeque<
the type of elements held in this collection E>A linked list extension of the |
| public interface | LoadingCache<
the type of keys maintained by this cache K, the type of mapped values V>A semi-persistent mapping from keys to values. |
| pack-priv interface | LocalAsyncCache<K, V>
This class provides a skeletal implementation of the |
| pack-priv interface | |
| pack-priv interface | LocalCacheFactory
A factory for caches optimized for a particular configuration. |
| pack-priv interface | LocalLoadingCache<K, V>
This class provides a skeletal implementation of the |
| pack-priv interface | LocalManualCache<K, V>
This class provides a skeletal implementation of the |
| pack-priv interface | |
| public interface | Policy<K, V>
An access point for inspecting and performing low-level operations based on the cache's runtime characteristics. |
| public interface | RemovalListener<
the most general type of keys this listener can listen for; for example K, Object
if any key is acceptablethe most general type of values this listener can listen for; for example
V>Object if any value is acceptableAn object that can receive a notification when an entry is removed from a cache. |
| public interface | Scheduler
A scheduler that submits a task to an executor after a given delay. |
| public interface | Ticker
A time source that returns a time value representing the number of nanoseconds elapsed since some fixed but arbitrary point in time. |
| public interface |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract class | AbstractLinkedDeque<
the type of elements held in this collection E>This class provides a skeletal implementation of the |
| pack-priv class | AccessOrderDeque<
the type of elements held in this collection E extends AccessOrderDeque.A linked deque implementation used to represent an access-order queue. |
| pack-priv class | Async
Static utility methods and classes pertaining to asynchronous operations. |
| pack-priv abstract class | |
| pack-priv abstract class | |
| pack-priv abstract class | |
| pack-priv abstract class | |
| pack-priv abstract class | |
| pack-priv abstract class | |
| pack-priv abstract class | |
| pack-priv class | BBHeader
The namespace for field padding through inheritance. |
| pack-priv class | BLCHeader
The namespace for field padding through inheritance. |
| pack-priv class | BoundedBuffer<
the type of elements maintained by this buffer E>A striped, non-blocking, bounded buffer. |
| pack-priv abstract class | BoundedLocalCache<
the type of keys maintained by this cache K, the type of mapped values V>An in-memory cache implementation that supports full concurrency of retrievals, a high expected concurrency for updates, and multiple ways to bound the cache. |
| pack-priv class | |
| public class | Caffeine<
the most general key type this builder will be able to create caches for. This is
normally K, Object unless it is constrained by using a method like #removalListenerthe most general value type this builder will be able to create caches for. This is
normally V>Object unless it is constrained by using a method like #removalListenerA builder of
|
| public class | CaffeineSpec
A specification of a |
| pack-priv class | |
| pack-priv class | FrequencySketch<E>
A probabilistic multiset for estimating the popularity of an element within a time window. |
| pack-priv class | |
| pack-priv class | |
| pack-priv abstract class | LocalAsyncLoadingCache<K, V>
This class provides a skeletal implementation of the |
| pack-priv abstract class | |
| pack-priv abstract class | |
| pack-priv class | MpscGrowableArrayQueue<E>
An MPSC array queue which starts at initialCapacity and grows to maxCapacity in linked chunks of the initial size. |
| pack-priv abstract class | |
| pack-priv class | Pacer
A pacing scheduler that prevents executions from happening too frequently. |
| pack-priv class | References
Static utility methods and classes pertaining to weak and soft references. |
| pack-priv class | SerializationProxy<K, V>
Serializes the configuration of the cache, reconstituting it as a |
| pack-priv class | SnapshotEntry<K, V>
An immutable entry that includes a snapshot of the policy metadata at its time of creation. |
| pack-priv abstract class | StripedBuffer<E>
A base class providing the mechanics for supporting dynamic striping of bounded buffers. |
| pack-priv class | |
| pack-priv class | TimerWheel<K, V>
A hierarchical timer wheel to add, remove, and fire expiration events in amortized O(1) time. |
| pack-priv class | |
| pack-priv class | |
| pack-priv class | WriteOrderDeque<
the type of elements held in this collection E extends WriteOrderDeque.A linked deque implementation used to represent a write-order queue. |
| pack-priv class |
| Modifier and Type | Enum and Description |
|---|---|
| pack-priv enum | |
| pack-priv enum | |
| pack-priv enum | |
| pack-priv enum | |
| public enum | RemovalCause
The reason why a cached entry was removed. |
| pack-priv enum | |
| pack-priv enum | |
| pack-priv enum |