AsyncCache interface to minimize the
effort required to implement a LocalCache.
| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | |
| public static class | |
| public static class | |
| public static class | LocalAsyncCache.AsyncBulkCompleter<K, V>
A function executed asynchronously after a bulk load completes. |
| public static class |
| Modifier and Type | Method and Description |
|---|---|
| public LocalCache | |
| public static <K, V> CompletableFuture | composeResult(Map<K, CompletableFuture<V>> futures)
Returns a future that waits for all of the dependent futures to complete and returns the combined mapping if successful. |
| public default CompletableFuture | get(K
the key with which the specified value is to be associated key, Function<? super K, ? extends V> the function to asynchronously compute a value mappingFunction)Implements com. key in this cache, obtaining that value from
mappingFunction if necessary.
|
| public default CompletableFuture | get(K
the key with which the specified value is to be associated key, BiFunction<? super K, ? super Executor, ? extends CompletableFuture<? extends V>> the function to asynchronously compute a value, optionally using the
given executor mappingFunction)Implements com. key in this cache, obtaining that value from
mappingFunction if necessary.
|
| public default CompletableFuture | get(K key, BiFunction<? super K, ? super Executor, ? extends CompletableFuture<? extends V>> mappingFunction, boolean recordStats)
|
| public default CompletableFuture | getAll(Iterable<? extends K>
the keys whose associated values are to be returned keys, Function<? super Set<? extends K>, ? extends Map<? extends K, ? extends V>> the function to asynchronously compute the values mappingFunction)Implements com. keys, creating or
retrieving those values if necessary.
|
| public default CompletableFuture | getAll(Iterable<? extends K>
the keys whose associated values are to be returned keys, BiFunction<? super Set<? extends K>, ? super Executor, ? extends CompletableFuture<? extends Map<? extends K, ? extends V>>> the function to asynchronously compute the values, optionally using the
given executor mappingFunction)Implements com. keys, creating or
retrieving those values if necessary.
|
| public default @Nullable CompletableFuture | getIfPresent(K
the key whose associated value is to be returned key)Implements com. key in this cache, or null if there is
no cached future for the key.
|
| public default void | handleCompletion(K key, CompletableFuture<? extends V> valueFuture, long startTime, boolean recordMiss)
|
| public Policy | |
| public default void | put(K
the key with which the specified value is to be associated key, CompletableFuture<? extends V> the value to be associated with the specified key valueFuture)Implements com. value with key in this cache.
|