List of usage examples for com.google.common.cache LoadingCache getAll
ImmutableMap<K, V> getAll(Iterable<? extends K> keys) throws ExecutionException;
From source file:com.facebook.presto.hive.CachingHiveMetastore.java
private static <K, V, E extends Exception> Map<K, V> getAll(LoadingCache<K, V> cache, Iterable<K> keys, Class<E> exceptionClass) throws E { try {//from w ww . ja v a 2 s .c om return cache.getAll(keys); } catch (ExecutionException | UncheckedExecutionException e) { Throwable t = e.getCause(); Throwables.propagateIfInstanceOf(t, exceptionClass); throw Throwables.propagate(t); } }
From source file:io.prestosql.plugin.hive.metastore.CachingHiveMetastore.java
private static <K, V> Map<K, V> getAll(LoadingCache<K, V> cache, Iterable<K> keys) { try {//from w ww .j a v a 2 s . com return cache.getAll(keys); } catch (ExecutionException | UncheckedExecutionException e) { throwIfInstanceOf(e.getCause(), PrestoException.class); throwIfUnchecked(e); throw new UncheckedExecutionException(e); } }
From source file:com.facebook.presto.hive.metastore.CachingHiveMetastore.java
private static <K, V> Map<K, V> getAll(LoadingCache<K, V> cache, Iterable<K> keys) { try {// w w w. j a va 2 s.c o m return cache.getAll(keys); } catch (ExecutionException | UncheckedExecutionException | ExecutionError e) { throw Throwables.propagate(e.getCause()); } }