/** * Asynchronously store the table {@code records} with specified {@code keys}. This method must be thread-safe. * The default implementation calls putAsync for each entry and return a combined future. * @param records table records to be written * @return CompletableFuture for the put request */ default CompletableFuture<Void> putAllAsync(Collection<Entry<K, V>> records) { List<CompletableFuture<Void>> putFutures = records.stream().map(e -> putAsync(e.getKey(), e.getValue())).collect(Collectors.toList()); return CompletableFuture.allOf(Iterables.toArray(putFutures, CompletableFuture.class)); }
int getEntryCredits(Collection<Entry<K, V>> entries) { if (creditFn == null) { return entries.size(); } else { return entries.stream().mapToInt(e -> creditFn.getCredits(e.getKey(), e.getValue())).sum(); } }
/** * Asynchronously store the table {@code records} with specified {@code keys}. This method must be thread-safe. * The default implementation calls putAsync for each entry and return a combined future. * @param records table records to be written * @return CompletableFuture for the put request */ default CompletableFuture<Void> putAllAsync(Collection<Entry<K, V>> records) { List<CompletableFuture<Void>> putFutures = records.stream().map(e -> putAsync(e.getKey(), e.getValue())).collect(Collectors.toList()); return CompletableFuture.allOf(Iterables.toArray(putFutures, CompletableFuture.class)); }
int getEntryCredits(Collection<Entry<K, V>> entries) { if (creditFn == null) { return entries.size(); } else { return entries.stream().mapToInt(e -> creditFn.getCredits(e.getKey(), e.getValue())).sum(); } }
/** * Asynchronously store the table {@code records} with specified {@code keys}. This method must be thread-safe. * The default implementation calls putAsync for each entry and return a combined future. * @param records table records to be written * @return CompletableFuture for the put request */ default CompletableFuture<Void> putAllAsync(Collection<Entry<K, V>> records) { List<CompletableFuture<Void>> putFutures = records.stream().map(e -> putAsync(e.getKey(), e.getValue())).collect(Collectors.toList()); return CompletableFuture.allOf(Iterables.toArray(putFutures, CompletableFuture.class)); }
/** * Asynchronously store the table {@code records} with specified {@code keys}. This method must be thread-safe. * The default implementation calls putAsync for each entry and return a combined future. * @param records table records to be written * @return CompletableFuture for the put request */ default CompletableFuture<Void> putAllAsync(Collection<Entry<K, V>> records) { List<CompletableFuture<Void>> putFutures = records.stream().map(e -> putAsync(e.getKey(), e.getValue())).collect(Collectors.toList()); return CompletableFuture.allOf(Iterables.toArray(putFutures, CompletableFuture.class)); }
int getEntryCredits(Collection<Entry<K, V>> entries) { if (creditFn == null) { return entries.size(); } else { return entries.stream().mapToInt(e -> creditFn.getCredits(e.getKey(), e.getValue())).sum(); } }
/** * Asynchronously store the table {@code records} with specified {@code keys}. This method must be thread-safe. * The default implementation calls putAsync for each entry and return a combined future. * @param records table records to be written * @return CompletableFuture for the put request */ default CompletableFuture<Void> putAllAsync(Collection<Entry<K, V>> records) { List<CompletableFuture<Void>> putFutures = records.stream().map(e -> putAsync(e.getKey(), e.getValue())).collect(Collectors.toList()); return CompletableFuture.allOf(Iterables.toArray(putFutures, CompletableFuture.class)); }
int getEntryCredits(Collection<Entry<K, V>> entries) { if (creditFn == null) { return entries.size(); } else { return entries.stream().mapToInt(e -> creditFn.getCredits(e.getKey(), e.getValue())).sum(); } }
@Override public void putAll(List<Entry<K, V>> entries) { for (Entry<K, V> entry : entries) { put(entry.getKey(), entry.getValue()); } }
@Override public void putAll(List<Entry<K, V>> entries) { for (Entry<K, V> entry : entries) { put(entry.getKey(), entry.getValue()); } }
@Override public void putAll(List<Entry<K, V>> entries) { for (Entry<K, V> entry : entries) { put(entry.getKey(), entry.getValue()); } }
@Override public void putAll(List<Entry<K, V>> entries) { for (Entry<K, V> entry : entries) { put(entry.getKey(), entry.getValue()); } }
@Override public void putAll(List<Entry<K, V>> entries) { for (Entry<K, V> entry : entries) { put(entry.getKey(), entry.getValue()); } }
@Override public TimestampedValue<V> next() { Entry<TimeSeriesKey<K>, V> next = wrappedIterator.next(); return new TimestampedValue<>(next.getValue(), next.getKey().getTimestamp()); }
@Override public TimestampedValue<V> next() { Entry<TimeSeriesKey<K>, V> next = wrappedIterator.next(); return new TimestampedValue<>(next.getValue(), next.getKey().getTimestamp()); }
@Override public TimestampedValue<V> next() { Entry<TimeSeriesKey<K>, V> next = wrappedIterator.next(); return new TimestampedValue<>(next.getValue(), next.getKey().getTimestamp()); }
@Override public TimestampedValue<V> next() { Entry<TimeSeriesKey<K>, V> next = wrappedIterator.next(); return new TimestampedValue<>(next.getValue(), next.getKey().getTimestamp()); }
@Override public TimestampedValue<V> next() { Entry<TimeSeriesKey<K>, V> next = wrappedIterator.next(); return new TimestampedValue<>(next.getValue(), next.getKey().getTimestamp()); }
@Override public void putAll(List<Entry<K, V>> entries) { for (Entry<K, V> entry : entries) { put(entry.getKey(), entry.getValue()); } }