/** * {@inheritDoc} */ @Override public void close() { tables.forEach(t -> t.close()); tableExecutors.values().forEach(e -> e.shutdown()); callbackExecutors.values().forEach(e -> e.shutdown()); }
@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); }); }
/** * {@inheritDoc} */ @Override public Map<K, V> getAll(List<K> keys) { readMetrics.numGetAlls.inc(); try { return getAllAsync(keys).get(); } catch (Exception e) { throw new SamzaException(e); } }
table = new RemoteReadableTable(tableSpec.getId(), readFn, readRateLimiter, tableExecutors.get(tableId), callbackExecutors.get(tableId)); } else { table.init(this.context); tables.add(table); return table;
/** * {@inheritDoc} */ @Override public V get(K key) { try { return getAsync(key).get(); } catch (Exception e) { throw new SamzaException(e); } }
/** * {@inheritDoc} */ @Override public void init(Context context) { super.init(context); writeMetrics = new DefaultTableWriteMetrics(context, this, tableId); TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId); writeRateLimiter.setTimerMetric(tableMetricsUtil.newTimer("put-throttle-ns")); }
table = new RemoteReadableTable(tableSpec.getId(), readFn, readRateLimiter, tableExecutors.get(tableId), callbackExecutors.get(tableId)); } else { table.init(this.context); tables.add(table); return table;
/** * {@inheritDoc} */ @Override public V get(K key) { try { return getAsync(key).get(); } catch (Exception e) { throw new SamzaException(e); } }
/** * {@inheritDoc} */ @Override public void init(Context context) { super.init(context); writeMetrics = new DefaultTableWriteMetrics(context, this, tableId); TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId); writeRateLimiter.setTimerMetric(tableMetricsUtil.newTimer("put-throttle-ns")); }
table = new RemoteReadableTable(tableSpec.getId(), readFn, readRateLimiter, tableExecutors.get(tableId), callbackExecutors.get(tableId)); } else { table.init(this.context); tables.add(table); return table;
/** * {@inheritDoc} */ @Override public void close() { tables.forEach(t -> t.close()); tableExecutors.values().forEach(e -> e.shutdown()); callbackExecutors.values().forEach(e -> e.shutdown()); }
@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); }); }
/** * {@inheritDoc} */ @Override public V get(K key) { try { return getAsync(key).get(); } catch (Exception e) { throw new SamzaException(e); } }
/** * {@inheritDoc} */ @Override public void init(Context context) { super.init(context); writeMetrics = new DefaultTableWriteMetrics(context, this, tableId); TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId); writeRateLimiter.setTimerMetric(tableMetricsUtil.newTimer("put-throttle-ns")); }
/** * {@inheritDoc} */ @Override public Map<K, V> getAll(List<K> keys) { readMetrics.numGetAlls.inc(); try { return getAllAsync(keys).get(); } catch (Exception e) { throw new SamzaException(e); } }
table = new RemoteReadableTable(tableSpec.getId(), readFn, readRateLimiter, tableExecutors.get(tableId), callbackExecutors.get(tableId)); } else { table.init(this.context); tables.add(table); return table;
/** * {@inheritDoc} */ @Override public void close() { tables.forEach(t -> t.close()); tableExecutors.values().forEach(e -> e.shutdown()); callbackExecutors.values().forEach(e -> e.shutdown()); }
@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); }); }
/** * {@inheritDoc} */ @Override public V get(K key) { try { return getAsync(key).get(); } catch (Exception e) { throw new SamzaException(e); } }
/** * {@inheritDoc} */ @Override public void init(Context context) { super.init(context); writeMetrics = new DefaultTableWriteMetrics(context, this, tableId); TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId); writeRateLimiter.setTimerMetric(tableMetricsUtil.newTimer("put-throttle-ns")); }