Class CaffeinatedGuavaLoadingCache.BulkLoader<K,V>
- java.lang.Object
-
- com.github.benmanes.caffeine.guava.CaffeinatedGuavaLoadingCache.SingleLoader<K,V>
-
- com.github.benmanes.caffeine.guava.CaffeinatedGuavaLoadingCache.BulkLoader<K,V>
-
- All Implemented Interfaces:
AsyncCacheLoader<K,V>
,CacheLoader<K,V>
,java.io.Serializable
- Enclosing class:
- CaffeinatedGuavaLoadingCache<K,V>
static final class CaffeinatedGuavaLoadingCache.BulkLoader<K,V> extends CaffeinatedGuavaLoadingCache.SingleLoader<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Fields inherited from class com.github.benmanes.caffeine.guava.CaffeinatedGuavaLoadingCache.SingleLoader
cacheLoader
-
-
Constructor Summary
Constructors Constructor Description BulkLoader(com.google.common.cache.CacheLoader<K,V> cacheLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<K,V>
loadAll(java.lang.Iterable<? extends K> keys)
Computes or retrieves the values corresponding tokeys
.-
Methods inherited from class com.github.benmanes.caffeine.guava.CaffeinatedGuavaLoadingCache.SingleLoader
load, reload
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.benmanes.caffeine.cache.CacheLoader
asyncLoad, asyncLoadAll, asyncReload
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
loadAll
public java.util.Map<K,V> loadAll(java.lang.Iterable<? extends K> keys)
Description copied from interface:CacheLoader
Computes or retrieves the values corresponding tokeys
. This method is called byLoadingCache.getAll(java.lang.Iterable<? extends K>)
.If the returned map doesn't contain all requested
keys
then the entries it does contain will be cached andgetAll
will return the partial results. If the returned map contains extra keys not present inkeys
then all returned entries will be cached, but only the entries forkeys
will be returned fromgetAll
.This method should be overridden when bulk retrieval is significantly more efficient than many individual lookups. Note that
LoadingCache.getAll(java.lang.Iterable<? extends K>)
will defer to individual calls toLoadingCache.get(K)
if this method is not overridden.Warning: loading must not attempt to update any mappings of this cache directly.
- Parameters:
keys
- the unique, non-null keys whose values should be loaded- Returns:
- a map from each key in
keys
to the value associated with that key; may not contain null values
-
-