Search in sources :

Example 1 with DirectSegmentAccess

use of io.pravega.segmentstore.server.DirectSegmentAccess in project pravega by pravega.

the class ContainerKeyIndex method validateConditionalUpdateFailures.

private CompletableFuture<Void> validateConditionalUpdateFailures(DirectSegmentAccess segment, Map<TableKey, Long> expectedVersions, TimeoutTimer timer) {
    assert !expectedVersions.isEmpty();
    val bucketReader = TableBucketReader.key(segment, this::getBackpointerOffset, this.executor);
    val searches = expectedVersions.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> findBucketEntry(segment, bucketReader, e.getKey().getKey(), e.getValue(), timer)));
    return Futures.allOf(searches.values()).thenRun(() -> {
        val failed = new HashMap<TableKey, Long>();
        for (val e : searches.entrySet()) {
            val actual = e.getValue().join();
            boolean isValid = actual == null ? e.getKey().getVersion() == TableKey.NOT_EXISTS : e.getKey().getVersion() == actual.getVersion();
            if (!isValid) {
                failed.put(e.getKey(), actual == null ? TableKey.NOT_EXISTS : actual.getVersion());
            }
        }
        if (!failed.isEmpty()) {
            throw new CompletionException(new BadKeyVersionException(segment.getInfo().getName(), failed));
        }
    });
}
Also used : lombok.val(lombok.val) ScheduledFuture(java.util.concurrent.ScheduledFuture) SneakyThrows(lombok.SneakyThrows) RequiredArgsConstructor(lombok.RequiredArgsConstructor) TimeoutException(java.util.concurrent.TimeoutException) SegmentProperties(io.pravega.segmentstore.contracts.SegmentProperties) BufferView(io.pravega.common.util.BufferView) Duration(java.time.Duration) Map(java.util.Map) AsyncReadResultProcessor(io.pravega.segmentstore.server.reading.AsyncReadResultProcessor) TableKey(io.pravega.segmentstore.contracts.tables.TableKey) SegmentStoreMetrics(io.pravega.segmentstore.server.SegmentStoreMetrics) Predicate(java.util.function.Predicate) NonNull(lombok.NonNull) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) CompletionException(java.util.concurrent.CompletionException) ThreadSafe(javax.annotation.concurrent.ThreadSafe) UUID(java.util.UUID) GuardedBy(javax.annotation.concurrent.GuardedBy) Collectors(java.util.stream.Collectors) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) Futures(io.pravega.common.concurrent.Futures) ReadResult(io.pravega.segmentstore.contracts.ReadResult) CacheManager(io.pravega.segmentstore.server.CacheManager) ObjectClosedException(io.pravega.common.ObjectClosedException) TableAttributes(io.pravega.segmentstore.contracts.tables.TableAttributes) Getter(lombok.Getter) Exceptions(io.pravega.common.Exceptions) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) Supplier(java.util.function.Supplier) BadKeyVersionException(io.pravega.segmentstore.contracts.tables.BadKeyVersionException) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) TableSegmentNotEmptyException(io.pravega.segmentstore.contracts.tables.TableSegmentNotEmptyException) SegmentMetadata(io.pravega.segmentstore.server.SegmentMetadata) MultiKeySequentialProcessor(io.pravega.common.concurrent.MultiKeySequentialProcessor) ConditionalTableUpdateException(io.pravega.segmentstore.contracts.tables.ConditionalTableUpdateException) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) StreamSegmentTruncatedException(io.pravega.segmentstore.contracts.StreamSegmentTruncatedException) TimeoutTimer(io.pravega.common.TimeoutTimer) KeyNotExistsException(io.pravega.segmentstore.contracts.tables.KeyNotExistsException) lombok.val(lombok.val) IOException(java.io.IOException) Maps(com.google.common.collect.Maps) Timer(io.pravega.common.Timer) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) DirectSegmentAccess(io.pravega.segmentstore.server.DirectSegmentAccess) AsyncSemaphore(io.pravega.common.concurrent.AsyncSemaphore) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Collections(java.util.Collections) BadKeyVersionException(io.pravega.segmentstore.contracts.tables.BadKeyVersionException) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) CompletionException(java.util.concurrent.CompletionException) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap)

Example 2 with DirectSegmentAccess

use of io.pravega.segmentstore.server.DirectSegmentAccess in project pravega by pravega.

the class ContainerKeyIndex method update.

/**
 * Performs a Batch Update or Removal.
 *
 * If {@link TableKeyBatch#isConditional()} returns true, this will execute an atomic Conditional Update/Removal based
 * on the condition items in the batch ({@link TableKeyBatch#getVersionedItems}. The entire TableKeyBatch will be
 * conditioned on those items, including those items that do not have a condition set. The entire TableKeyBatch will
 * either all be committed as one unit or not at all.
 *
 * Otherwise this will perform an Unconditional Update/Removal, where all the {@link TableKeyBatch.Item}s in
 * {@link TableKeyBatch#getItems()} will be applied regardless of whether they already exist or what their versions are.
 *
 * @param segment The Segment to perform the update/removal on.
 * @param batch   The {@link TableKeyBatch} to apply.
 * @param persist A Supplier that, when invoked, will persist the contents of the batch to the Segment and return
 *                a CompletableFuture to indicate when the operation is done, containing the offset at which the
 *                batch has been written to the Segment. This Future must complete successfully before the effects
 *                of the {@link TableKeyBatch} are applied to the in-memory Index or before downstream conditional
 *                updates on the affected keys are initiated.
 * @param timer   Timer for the operation.
 * @return A CompletableFuture that, when completed, will contain a list of offsets (within the Segment) where each
 * of the items in the batch has been persisted. If the update failed, it will be failed with the appropriate exception.
 * Notable exceptions:
 * <ul>
 * <li>{@link KeyNotExistsException} If a Key in the TableKeyBatch does not exist and was conditioned as having to exist.
 * <li>{@link BadKeyVersionException} If a Key does exist but had a version mismatch.
 * </ul>
 */
CompletableFuture<List<Long>> update(DirectSegmentAccess segment, TableKeyBatch batch, Supplier<CompletableFuture<Long>> persist, TimeoutTimer timer) {
    Exceptions.checkNotClosed(this.closed.get(), this);
    Supplier<CompletableFuture<List<Long>>> update;
    if (batch.isConditional()) {
        // Conditional update.
        // Collect all Cache Keys for the Update Items that have a condition on them; we need this on order to
        // serialize execution across them.
        val keys = batch.getVersionedItems().stream().map(item -> Maps.immutableEntry(segment.getSegmentId(), item.getHash())).collect(Collectors.toList());
        // Serialize the execution (queue it up to run only after all other currently queued up conditional updates
        // for touched keys have finished).
        update = () -> this.conditionalUpdateProcessor.add(keys, () -> validateConditionalUpdate(segment, batch, timer).thenComposeAsync(v -> persist.get(), this.executor).thenApplyAsync(batchOffset -> updateCache(segment, batch, batchOffset), this.executor));
    } else {
        // Unconditional update: persist the entries and update the cache.
        update = () -> persist.get().thenApplyAsync(batchOffset -> updateCache(segment, batch, batchOffset), this.executor);
    }
    // Throttle any requests, if needed.
    return this.segmentTracker.throttleIfNeeded(segment, update, batch.getLength());
}
Also used : lombok.val(lombok.val) ScheduledFuture(java.util.concurrent.ScheduledFuture) SneakyThrows(lombok.SneakyThrows) RequiredArgsConstructor(lombok.RequiredArgsConstructor) TimeoutException(java.util.concurrent.TimeoutException) SegmentProperties(io.pravega.segmentstore.contracts.SegmentProperties) BufferView(io.pravega.common.util.BufferView) Duration(java.time.Duration) Map(java.util.Map) AsyncReadResultProcessor(io.pravega.segmentstore.server.reading.AsyncReadResultProcessor) TableKey(io.pravega.segmentstore.contracts.tables.TableKey) SegmentStoreMetrics(io.pravega.segmentstore.server.SegmentStoreMetrics) Predicate(java.util.function.Predicate) NonNull(lombok.NonNull) Collection(java.util.Collection) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) CompletionException(java.util.concurrent.CompletionException) ThreadSafe(javax.annotation.concurrent.ThreadSafe) UUID(java.util.UUID) GuardedBy(javax.annotation.concurrent.GuardedBy) Collectors(java.util.stream.Collectors) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) Futures(io.pravega.common.concurrent.Futures) ReadResult(io.pravega.segmentstore.contracts.ReadResult) CacheManager(io.pravega.segmentstore.server.CacheManager) ObjectClosedException(io.pravega.common.ObjectClosedException) TableAttributes(io.pravega.segmentstore.contracts.tables.TableAttributes) Getter(lombok.Getter) Exceptions(io.pravega.common.Exceptions) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Function(java.util.function.Function) Supplier(java.util.function.Supplier) BadKeyVersionException(io.pravega.segmentstore.contracts.tables.BadKeyVersionException) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) TableSegmentNotEmptyException(io.pravega.segmentstore.contracts.tables.TableSegmentNotEmptyException) SegmentMetadata(io.pravega.segmentstore.server.SegmentMetadata) MultiKeySequentialProcessor(io.pravega.common.concurrent.MultiKeySequentialProcessor) ConditionalTableUpdateException(io.pravega.segmentstore.contracts.tables.ConditionalTableUpdateException) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) StreamSegmentTruncatedException(io.pravega.segmentstore.contracts.StreamSegmentTruncatedException) TimeoutTimer(io.pravega.common.TimeoutTimer) KeyNotExistsException(io.pravega.segmentstore.contracts.tables.KeyNotExistsException) lombok.val(lombok.val) IOException(java.io.IOException) Maps(com.google.common.collect.Maps) Timer(io.pravega.common.Timer) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) DirectSegmentAccess(io.pravega.segmentstore.server.DirectSegmentAccess) AsyncSemaphore(io.pravega.common.concurrent.AsyncSemaphore) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Collections(java.util.Collections) CompletableFuture(java.util.concurrent.CompletableFuture) AtomicLong(java.util.concurrent.atomic.AtomicLong)

Example 3 with DirectSegmentAccess

use of io.pravega.segmentstore.server.DirectSegmentAccess in project pravega by pravega.

the class HashTableSegmentLayout method newIterator.

private <T> CompletableFuture<AsyncIterator<IteratorItem<T>>> newIterator(@NonNull DirectSegmentAccess segment, @NonNull IteratorArgs args, @NonNull GetBucketReader<T> createBucketReader) {
    Preconditions.checkArgument(args.getFrom() == null && args.getTo() == null, "Range Iterators not supported for HashTableSegments.");
    UUID fromHash;
    BufferView serializedState = args.getContinuationToken();
    try {
        fromHash = KeyHasher.getNextHash(serializedState == null ? null : IteratorStateImpl.deserialize(serializedState).getKeyHash());
    } catch (IOException ex) {
        // Bad IteratorState serialization.
        throw new IllegalDataFormatException("Unable to deserialize `serializedState`.", ex);
    }
    if (fromHash == null) {
        // Nothing to iterate on.
        return CompletableFuture.completedFuture(TableIterator.empty());
    }
    // Create a converter that will use a TableBucketReader to fetch all requested items in the iterated Buckets.
    val bucketReader = createBucketReader.apply(segment, this.keyIndex::getBackpointerOffset, this.executor);
    TableIterator.ConvertResult<IteratorItem<T>> converter = bucket -> bucketReader.findAllExisting(bucket.getSegmentOffset(), new TimeoutTimer(args.getFetchTimeout())).thenApply(result -> new IteratorItemImpl<>(new IteratorStateImpl(bucket.getHash()).serialize(), result));
    // Fetch the Tail (Unindexed) Hashes, then create the TableIterator.
    return this.keyIndex.getUnindexedKeyHashes(segment).thenComposeAsync(cacheHashes -> TableIterator.<IteratorItem<T>>builder().segment(segment).cacheHashes(cacheHashes).firstHash(fromHash).executor(executor).resultConverter(converter).fetchTimeout(args.getFetchTimeout()).build(), this.executor);
}
Also used : lombok.val(lombok.val) TableAttributes(io.pravega.segmentstore.contracts.tables.TableAttributes) TableSegmentConfig(io.pravega.segmentstore.contracts.tables.TableSegmentConfig) Getter(lombok.Getter) OperationPriority(io.pravega.segmentstore.server.logs.operations.OperationPriority) SneakyThrows(lombok.SneakyThrows) RequiredArgsConstructor(lombok.RequiredArgsConstructor) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) RevisionDataInput(io.pravega.common.io.serialization.RevisionDataInput) Function(java.util.function.Function) IteratorArgs(io.pravega.segmentstore.contracts.tables.IteratorArgs) UpdateableSegmentMetadata(io.pravega.segmentstore.server.UpdateableSegmentMetadata) ArrayList(java.util.ArrayList) ArrayView(io.pravega.common.util.ArrayView) SegmentMetadata(io.pravega.segmentstore.server.SegmentMetadata) SegmentType(io.pravega.segmentstore.contracts.SegmentType) IteratorItem(io.pravega.segmentstore.contracts.tables.IteratorItem) Runnables(com.google.common.util.concurrent.Runnables) BufferView(io.pravega.common.util.BufferView) Duration(java.time.Duration) Map(java.util.Map) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) RevisionDataOutput(io.pravega.common.io.serialization.RevisionDataOutput) VersionedSerializer(io.pravega.common.io.serialization.VersionedSerializer) IteratorState(io.pravega.segmentstore.contracts.tables.IteratorState) Attributes(io.pravega.segmentstore.contracts.Attributes) TableKey(io.pravega.segmentstore.contracts.tables.TableKey) TimeoutTimer(io.pravega.common.TimeoutTimer) NonNull(lombok.NonNull) Collection(java.util.Collection) AttributeId(io.pravega.segmentstore.contracts.AttributeId) lombok.val(lombok.val) AsyncIterator(io.pravega.common.util.AsyncIterator) IOException(java.io.IOException) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) ObjectBuilder(io.pravega.common.ObjectBuilder) DirectSegmentAccess(io.pravega.segmentstore.server.DirectSegmentAccess) List(java.util.List) TableSegmentInfo(io.pravega.segmentstore.contracts.tables.TableSegmentInfo) Preconditions(com.google.common.base.Preconditions) IllegalDataFormatException(io.pravega.common.util.IllegalDataFormatException) WriterSegmentProcessor(io.pravega.segmentstore.server.WriterSegmentProcessor) TableEntry(io.pravega.segmentstore.contracts.tables.TableEntry) Collections(java.util.Collections) Futures(io.pravega.common.concurrent.Futures) CacheManager(io.pravega.segmentstore.server.CacheManager) IllegalDataFormatException(io.pravega.common.util.IllegalDataFormatException) BufferView(io.pravega.common.util.BufferView) IteratorItem(io.pravega.segmentstore.contracts.tables.IteratorItem) IOException(java.io.IOException) UUID(java.util.UUID) TimeoutTimer(io.pravega.common.TimeoutTimer)

Example 4 with DirectSegmentAccess

use of io.pravega.segmentstore.server.DirectSegmentAccess in project pravega by pravega.

the class IndexWriter method groupByBucket.

// endregion
// region Updating Table Buckets
/**
 * Groups the given {@link BucketUpdate.KeyUpdate} instances by their associated buckets.
 *
 * @param segment    The Segment to read from.
 * @param keyUpdates A Collection of {@link BucketUpdate.KeyUpdate} instances to index.
 * @param timer      Timer for the operation.
 * @return A CompletableFuture that, when completed, will contain the a collection of {@link BucketUpdate.Builder}s.
 */
CompletableFuture<Collection<BucketUpdate.Builder>> groupByBucket(DirectSegmentAccess segment, Collection<BucketUpdate.KeyUpdate> keyUpdates, TimeoutTimer timer) {
    val updatesByHash = keyUpdates.stream().collect(Collectors.groupingBy(k -> this.hasher.hash(k.getKey())));
    return locateBuckets(segment, updatesByHash.keySet(), timer).thenApplyAsync(buckets -> {
        val result = new HashMap<TableBucket, BucketUpdate.Builder>();
        buckets.forEach((keyHash, bucket) -> {
            // Add the bucket to the result and record this Key as a "new" key in it.
            BucketUpdate.Builder bu = result.computeIfAbsent(bucket, BucketUpdate::forBucket);
            updatesByHash.get(keyHash).forEach(bu::withKeyUpdate);
        });
        return result.values();
    }, this.executor);
}
Also used : lombok.val(lombok.val) TableAttributes(io.pravega.segmentstore.contracts.tables.TableAttributes) Attributes(io.pravega.segmentstore.contracts.Attributes) Getter(lombok.Getter) TimeoutTimer(io.pravega.common.TimeoutTimer) NonNull(lombok.NonNull) Collection(java.util.Collection) AttributeId(io.pravega.segmentstore.contracts.AttributeId) lombok.val(lombok.val) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) BadAttributeUpdateException(io.pravega.segmentstore.contracts.BadAttributeUpdateException) Collectors(java.util.stream.Collectors) AtomicLong(java.util.concurrent.atomic.AtomicLong) AttributeUpdate(io.pravega.segmentstore.contracts.AttributeUpdate) DirectSegmentAccess(io.pravega.segmentstore.server.DirectSegmentAccess) Slf4j(lombok.extern.slf4j.Slf4j) AttributeUpdateCollection(io.pravega.segmentstore.contracts.AttributeUpdateCollection) Duration(java.time.Duration) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) Preconditions(com.google.common.base.Preconditions) AttributeUpdateType(io.pravega.segmentstore.contracts.AttributeUpdateType) Comparator(java.util.Comparator) HashMap(java.util.HashMap)

Example 5 with DirectSegmentAccess

use of io.pravega.segmentstore.server.DirectSegmentAccess in project pravega by pravega.

the class WriterTableProcessor method flushOnce.

/**
 * Performs a single flush attempt.
 *
 * @param segment A {@link DirectSegmentAccess} representing the Segment to flush on.
 * @param timer   Timer for the operation.
 * @return A CompletableFuture that, when completed, will indicate the flush has completed successfully. If the
 * operation failed, it will be failed with the appropriate exception. Notable exceptions:
 * <ul>
 * <li>{@link BadAttributeUpdateException} If a conditional update on the {@link TableAttributes#INDEX_OFFSET} attribute failed.
 * </ul>
 */
private CompletableFuture<TableWriterFlushResult> flushOnce(DirectSegmentAccess segment, TimeoutTimer timer) {
    // Index all the keys in the segment range pointed to by the aggregator.
    long lastOffset = this.aggregator.getLastIndexToProcessAtOnce(this.connector.getMaxFlushSize());
    assert lastOffset - this.aggregator.getFirstOffset() <= this.connector.getMaxFlushSize();
    if (lastOffset < this.aggregator.getLastOffset()) {
        log.info("{}: Partial flush initiated up to offset {}. State: {}.", this.traceObjectId, lastOffset, this.aggregator);
    }
    KeyUpdateCollection keyUpdates = readKeysFromSegment(segment, this.aggregator.getFirstOffset(), lastOffset, timer);
    log.debug("{}: Flush.ReadFromSegment KeyCount={}, UpdateCount={}, HighestCopiedOffset={}, LastIndexedOffset={}.", this.traceObjectId, keyUpdates.getUpdates().size(), keyUpdates.getTotalUpdateCount(), keyUpdates.getHighestCopiedOffset(), keyUpdates.getLastIndexedOffset());
    // for each such bucket and finally (reindex) update the bucket.
    return this.indexWriter.groupByBucket(segment, keyUpdates.getUpdates(), timer).thenComposeAsync(builders -> fetchExistingKeys(builders, segment, timer).thenComposeAsync(v -> {
        val bucketUpdates = builders.stream().map(BucketUpdate.Builder::build).collect(Collectors.toList());
        logBucketUpdates(bucketUpdates);
        return this.indexWriter.updateBuckets(segment, bucketUpdates, this.aggregator.getLastIndexedOffset(), keyUpdates.getLastIndexedOffset(), keyUpdates.getTotalUpdateCount(), timer.getRemaining());
    }, this.executor), this.executor).thenApply(updateCount -> new TableWriterFlushResult(keyUpdates, updateCount));
}
Also used : TableAttributes(io.pravega.segmentstore.contracts.tables.TableAttributes) SneakyThrows(lombok.SneakyThrows) Exceptions(io.pravega.common.Exceptions) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CompletableFuture(java.util.concurrent.CompletableFuture) BadAttributeUpdateException(io.pravega.segmentstore.contracts.BadAttributeUpdateException) BufferView(io.pravega.common.util.BufferView) Duration(java.time.Duration) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) SerializationException(io.pravega.common.io.SerializationException) Operation(io.pravega.segmentstore.server.logs.operations.Operation) WriterFlushResult(io.pravega.segmentstore.server.WriterFlushResult) TimeoutTimer(io.pravega.common.TimeoutTimer) NonNull(lombok.NonNull) Collection(java.util.Collection) lombok.val(lombok.val) ThreadSafe(javax.annotation.concurrent.ThreadSafe) GuardedBy(javax.annotation.concurrent.GuardedBy) Collectors(java.util.stream.Collectors) AtomicLong(java.util.concurrent.atomic.AtomicLong) DirectSegmentAccess(io.pravega.segmentstore.server.DirectSegmentAccess) Slf4j(lombok.extern.slf4j.Slf4j) SegmentOperation(io.pravega.segmentstore.server.SegmentOperation) CachedStreamSegmentAppendOperation(io.pravega.segmentstore.server.logs.operations.CachedStreamSegmentAppendOperation) Preconditions(com.google.common.base.Preconditions) VisibleForTesting(com.google.common.annotations.VisibleForTesting) DataCorruptionException(io.pravega.segmentstore.server.DataCorruptionException) WriterSegmentProcessor(io.pravega.segmentstore.server.WriterSegmentProcessor) ArrayDeque(java.util.ArrayDeque) Futures(io.pravega.common.concurrent.Futures) ReadResult(io.pravega.segmentstore.contracts.ReadResult) lombok.val(lombok.val)

Aggregations

DirectSegmentAccess (io.pravega.segmentstore.server.DirectSegmentAccess)17 CompletableFuture (java.util.concurrent.CompletableFuture)15 Duration (java.time.Duration)14 BufferView (io.pravega.common.util.BufferView)13 lombok.val (lombok.val)13 SegmentMetadata (io.pravega.segmentstore.server.SegmentMetadata)12 IOException (java.io.IOException)12 ArrayList (java.util.ArrayList)12 List (java.util.List)12 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)12 Exceptions (io.pravega.common.Exceptions)11 TimeoutTimer (io.pravega.common.TimeoutTimer)10 Collection (java.util.Collection)10 CompletionException (java.util.concurrent.CompletionException)10 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)10 Function (java.util.function.Function)10 Collectors (java.util.stream.Collectors)10 Futures (io.pravega.common.concurrent.Futures)9 HashMap (java.util.HashMap)9 Cleanup (lombok.Cleanup)9