@Override public CompletableFuture<V> getAsync(K key) { Preconditions.checkNotNull(key); readMetrics.numGets.inc(); return execute(readRateLimiter, key, readFn::getAsync, readMetrics.getNs) .exceptionally(e -> { throw new SamzaException("Failed to get the record for " + key, e); }); }
@Override public CompletableFuture<Map<K, V>> getAllAsync(List<K> keys) { Preconditions.checkNotNull(keys); if (keys.isEmpty()) { return CompletableFuture.completedFuture(Collections.EMPTY_MAP); } readMetrics.numGetAlls.inc(); return execute(readRateLimiter, keys, readFn::getAllAsync, readMetrics.getAllNs) .handle((result, e) -> { if (e != null) { throw new SamzaException("Failed to get the records for " + keys, e); } return result; }); }
@Override public CompletableFuture<V> getAsync(K key) { Preconditions.checkNotNull(key); readMetrics.numGets.inc(); return execute(readRateLimiter, key, readFn::getAsync, readMetrics.getNs) .exceptionally(e -> { throw new SamzaException("Failed to get the record for " + key, e); }); }
@Override public CompletableFuture<V> getAsync(K key) { Preconditions.checkNotNull(key); readMetrics.numGets.inc(); return execute(readRateLimiter, key, readFn::getAsync, readMetrics.getNs) .exceptionally(e -> { throw new SamzaException("Failed to get the record for " + key, e); }); }
@Override public CompletableFuture<V> getAsync(K key) { Preconditions.checkNotNull(key); readMetrics.numGets.inc(); return execute(readRateLimiter, key, readFn::getAsync, readMetrics.getNs) .exceptionally(e -> { throw new SamzaException("Failed to get the record for " + key, e); }); }
@Override public CompletableFuture<Map<K, V>> getAllAsync(List<K> keys) { Preconditions.checkNotNull(keys); if (keys.isEmpty()) { return CompletableFuture.completedFuture(Collections.EMPTY_MAP); } readMetrics.numGetAlls.inc(); return execute(readRateLimiter, keys, readFn::getAllAsync, readMetrics.getAllNs) .handle((result, e) -> { if (e != null) { throw new SamzaException("Failed to get the records for " + keys, e); } return result; }); }
@Override public CompletableFuture<Map<K, V>> getAllAsync(List<K> keys) { Preconditions.checkNotNull(keys); if (keys.isEmpty()) { return CompletableFuture.completedFuture(Collections.EMPTY_MAP); } readMetrics.numGetAlls.inc(); return execute(readRateLimiter, keys, readFn::getAllAsync, readMetrics.getAllNs) .handle((result, e) -> { if (e != null) { throw new SamzaException("Failed to get the records for " + keys, e); } return result; }); }
@Override public CompletableFuture<Map<K, V>> getAllAsync(List<K> keys) { Preconditions.checkNotNull(keys); if (keys.isEmpty()) { return CompletableFuture.completedFuture(Collections.EMPTY_MAP); } readMetrics.numGetAlls.inc(); return execute(readRateLimiter, keys, readFn::getAllAsync, readMetrics.getAllNs) .handle((result, e) -> { if (e != null) { throw new SamzaException("Failed to get the records for " + keys, e); } return result; }); }