Class CaffeinatedGuavaLoadingCache.BulkLoader<K,​V>

    • Constructor Detail

      • BulkLoader

        BulkLoader​(com.google.common.cache.CacheLoader<K,​V> cacheLoader)
    • 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 to keys. This method is called by LoadingCache.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 and getAll will return the partial results. If the returned map contains extra keys not present in keys then all returned entries will be cached, but only the entries for keys will be returned from getAll.

        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 to LoadingCache.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