@Test public void testLoaderError() { final LocalAsyncCache<String, String> cache = createCache(); assertComposableFutureError(TIMEOUT_MESSAGE,RuntimeException.class,cache.getBulkAsync(Arrays.asList("newKey", TIMEOUT_KEY))); }
@Override public ComposableFuture<Map<K, V>> getBulkAsync(final Iterable<? extends K> keys) { try { final ImmutableMap<K, ComposableFuture<V>> innerMap; if (loadingCache != null) { innerMap = loadingCache.getAll(keys); unloadErrorsFromCache(innerMap, keys); } else { innerMap = localCache.getAllPresent(keys); } final Map<K, ComposableFuture<V>> result = new HashMap<>(); for (final K key : innerMap.keySet()) { final ComposableFuture<V> value = innerMap.get(key); result.put(key, value); } return all(true, result); } catch (final com.google.common.util.concurrent.UncheckedExecutionException e) { return fromError(e.getCause()); } catch (final ExecutionException | UncheckedExecutionException | ExecutionError e) { return fromError(e.getCause()); } }
LocalAsyncCache implements TypedCache<K,V> { @Override public ComposableFuture<Map<K, V>> getBulkAsync(final Iterable<? extends K> keys) { try { final ImmutableMap<K, ComposableFuture<V>> innerMap; if (loadingCache != null) { innerMap = loadingCache.getAll(keys); unloadErrorsFromCache(innerMap, keys); } else { innerMap = localCache.getAllPresent(keys); } final Map<K, ComposableFuture<V>> result = new HashMap<>(); for (final K key : innerMap.keySet()) { final ComposableFuture<V> value = innerMap.get(key); result.put(key, value); } return all(true, result); } catch (final com.google.common.util.concurrent.UncheckedExecutionException e) { return fromError(e.getCause()); } catch (final ExecutionException | UncheckedExecutionException | ExecutionError e) { return fromError(e.getCause()); } } }
LocalAsyncCache implements TypedCache<K,V> { @Override public ComposableFuture<Map<K, V>> getBulkAsync(final Iterable<? extends K> keys) { try { final ImmutableMap<K, ComposableFuture<V>> innerMap; if (loadingCache != null) { innerMap = loadingCache.getAll(keys); unloadErrorsFromCache(innerMap, keys); } else { innerMap = localCache.getAllPresent(keys); } final Map<K, ComposableFuture<V>> result = new HashMap<>(); for (final K key : innerMap.keySet()) { final ComposableFuture<V> value = innerMap.get(key); result.put(key, value); } return all(true, result); } catch (final com.google.common.util.concurrent.UncheckedExecutionException e) { return fromError(e.getCause()); } catch (final ExecutionException | UncheckedExecutionException | ExecutionError e) { return fromError(e.getCause()); } } LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader,
                         final MetricFactory metricFactory, final String cacheName);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader,
                         final MetricFactory metricFactory, final String cacheName, final boolean failOnMissingEntries);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final MetricFactory metricFactory, final String cacheName);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit);  LocalAsyncCache(); }
LocalAsyncCache implements TypedCache<K,V> { @Override public ComposableFuture<Map<K, V>> getBulkAsync(final Iterable<? extends K> keys) { try { final ImmutableMap<K, ComposableFuture<V>> innerMap; if (loadingCache != null) { innerMap = loadingCache.getAll(keys); unloadErrorsFromCache(innerMap, keys); } else { innerMap = localCache.getAllPresent(keys); } final Map<K, ComposableFuture<V>> result = new HashMap<>(); for (final K key : innerMap.keySet()) { final ComposableFuture<V> value = innerMap.get(key); result.put(key, value); } return all(true, result); } catch (final com.google.common.util.concurrent.UncheckedExecutionException e) { return fromError(e.getCause()); } catch (final ExecutionException | UncheckedExecutionException | ExecutionError e) { return fromError(e.getCause()); } } LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader,
                         final MetricFactory metricFactory, final String cacheName);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader,
                         final MetricFactory metricFactory, final String cacheName, final boolean failOnMissingEntries);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final MetricFactory metricFactory, final String cacheName);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit);  LocalAsyncCache(); @Override ComposableFuture<V> getAsync(final K key); @Override ComposableFuture<Map<K, V>> getBulkAsync(final Iterable<? extends K> keys); @Override ComposableFuture<Boolean> deleteAsync(final K key); @Override ComposableFuture<Boolean> setAsync(final K key, final V value); @Override ComposableFuture<Boolean> setIfAbsentAsync(final K key, final V value); @Override ComposableFuture<Boolean> setAsync(final K key, final EntryMapper<K, V> mapper, final int maxIterations); @Override ComposableFuture<Map<K, Boolean>> setBulkAsync(final Map<? extends K, ? extends V> entries); }
LocalAsyncCache implements TypedCache<K,V> { @Override public ComposableFuture<Map<K, V>> getBulkAsync(final Iterable<? extends K> keys) { try { final ImmutableMap<K, ComposableFuture<V>> innerMap; if (loadingCache != null) { innerMap = loadingCache.getAll(keys); unloadErrorsFromCache(innerMap, keys); } else { innerMap = localCache.getAllPresent(keys); } final Map<K, ComposableFuture<V>> result = new HashMap<>(); for (final K key : innerMap.keySet()) { final ComposableFuture<V> value = innerMap.get(key); result.put(key, value); } return all(true, result); } catch (final com.google.common.util.concurrent.UncheckedExecutionException e) { return fromError(e.getCause()); } catch (final ExecutionException | UncheckedExecutionException | ExecutionError e) { return fromError(e.getCause()); } } LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader,
                         final MetricFactory metricFactory, final String cacheName);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader,
                         final MetricFactory metricFactory, final String cacheName, final boolean failOnMissingEntries);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final CacheLoader<K, V> loader);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit, final MetricFactory metricFactory, final String cacheName);  LocalAsyncCache(final int maximumSize, final int ttl, final TimeUnit unit);  LocalAsyncCache(); @Override ComposableFuture<V> getAsync(final K key); @Override ComposableFuture<Map<K, V>> getBulkAsync(final Iterable<? extends K> keys); @Override ComposableFuture<Boolean> deleteAsync(final K key); @Override ComposableFuture<Boolean> setAsync(final K key, final V value); @Override ComposableFuture<Boolean> setIfAbsentAsync(final K key, final V value); @Override ComposableFuture<Boolean> setAsync(final K key, final EntryMapper<K, V> mapper, final int maxIterations); @Override ComposableFuture<Map<K, Boolean>> setBulkAsync(final Map<? extends K, ? extends V> entries);  }