Search in sources :

Example 41 with CompletionException

use of java.util.concurrent.CompletionException in project redisson by redisson.

the class RedissonKeys method deleteByPatternAsync.

@Override
public RFuture<Long> deleteByPatternAsync(String pattern) {
    if (commandExecutor instanceof CommandBatchService || commandExecutor instanceof CommandReactiveBatchService || commandExecutor instanceof CommandRxBatchService) {
        if (getConnectionManager().isClusterMode()) {
            throw new IllegalStateException("This method doesn't work in batch for Redis cluster mode. For Redis cluster execute it as non-batch method");
        }
        return commandExecutor.evalWriteAsync((String) null, null, RedisCommands.EVAL_LONG, "local keys = redis.call('keys', ARGV[1]) " + "local n = 0 " + "for i=1, #keys,5000 do " + "n = n + redis.call('del', unpack(keys, i, math.min(i+4999, table.getn(keys)))) " + "end " + "return n;", Collections.emptyList(), pattern);
    }
    int batchSize = 500;
    List<CompletableFuture<Long>> futures = new ArrayList<>();
    for (MasterSlaveEntry entry : commandExecutor.getConnectionManager().getEntrySet()) {
        commandExecutor.getConnectionManager().getExecutor().execute(() -> {
            long count = 0;
            try {
                Iterator<String> keysIterator = createKeysIterator(entry, RedisCommands.SCAN, pattern, batchSize);
                List<String> keys = new ArrayList<>();
                while (keysIterator.hasNext()) {
                    String key = keysIterator.next();
                    keys.add(key);
                    if (keys.size() % batchSize == 0) {
                        count += delete(keys.toArray(new String[0]));
                        keys.clear();
                    }
                }
                if (!keys.isEmpty()) {
                    count += delete(keys.toArray(new String[0]));
                    keys.clear();
                }
                RFuture<Long> future = RedissonPromise.newSucceededFuture(count);
                futures.add(future.toCompletableFuture());
            } catch (Exception e) {
                CompletableFuture<Long> future = new CompletableFuture<>();
                future.completeExceptionally(e);
                futures.add(future);
            }
        });
    }
    CompletableFuture<Void> future = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
    CompletableFuture<Long> res = future.handle((r, e) -> {
        long cc = futures.stream().filter(f -> f.isDone()).mapToLong(f -> f.getNow(0L)).sum();
        if (e != null) {
            if (cc > 0) {
                RedisException ex = new RedisException(cc + " keys have been deleted. But one or more nodes has an error", e);
                throw new CompletionException(ex);
            } else {
                throw new CompletionException(e);
            }
        }
        return cc;
    });
    return new CompletableFutureWrapper<>(res);
}
Also used : RedisException(org.redisson.client.RedisException) CommandAsyncExecutor(org.redisson.command.CommandAsyncExecutor) java.util(java.util) StringCodec(org.redisson.client.codec.StringCodec) CommandBatchService(org.redisson.command.CommandBatchService) CompletableFuture(java.util.concurrent.CompletableFuture) RedisClient(org.redisson.client.RedisClient) CompositeIterable(org.redisson.misc.CompositeIterable) RFuture(org.redisson.api.RFuture) CompletableFutureWrapper(org.redisson.misc.CompletableFutureWrapper) CommandRxBatchService(org.redisson.rx.CommandRxBatchService) StreamSupport(java.util.stream.StreamSupport) RObject(org.redisson.api.RObject) CommandReactiveBatchService(org.redisson.reactive.CommandReactiveBatchService) RType(org.redisson.api.RType) ConnectionManager(org.redisson.connection.ConnectionManager) RedissonPromise(org.redisson.misc.RedissonPromise) CompletionException(java.util.concurrent.CompletionException) RedissonBaseIterator(org.redisson.iterator.RedissonBaseIterator) RKeys(org.redisson.api.RKeys) RedisCommands(org.redisson.client.protocol.RedisCommands) TimeUnit(java.util.concurrent.TimeUnit) AtomicLong(java.util.concurrent.atomic.AtomicLong) Stream(java.util.stream.Stream) MasterSlaveEntry(org.redisson.connection.MasterSlaveEntry) RedisCommand(org.redisson.client.protocol.RedisCommand) CommandBatchService(org.redisson.command.CommandBatchService) RedisException(org.redisson.client.RedisException) CompletionException(java.util.concurrent.CompletionException) CompletableFuture(java.util.concurrent.CompletableFuture) CompletableFutureWrapper(org.redisson.misc.CompletableFutureWrapper) CommandRxBatchService(org.redisson.rx.CommandRxBatchService) MasterSlaveEntry(org.redisson.connection.MasterSlaveEntry) CompletionException(java.util.concurrent.CompletionException) AtomicLong(java.util.concurrent.atomic.AtomicLong) RedisException(org.redisson.client.RedisException) CommandReactiveBatchService(org.redisson.reactive.CommandReactiveBatchService)

Example 42 with CompletionException

use of java.util.concurrent.CompletionException in project alluxio by Alluxio.

the class RaftJournalSystem method sendMessageAsync.

/**
 * Sends a message to a raft server asynchronously.
 *
 * @param server the raft peer id of the target server
 * @param message the message to send
 * @return a future to be completed with the client reply
 */
public synchronized CompletableFuture<RaftClientReply> sendMessageAsync(RaftPeerId server, Message message) {
    RaftClient client = createClient();
    RaftClientRequest request = RaftClientRequest.newBuilder().setClientId(mRawClientId).setServerId(server).setGroupId(RAFT_GROUP_ID).setCallId(nextCallId()).setMessage(message).setType(RaftClientRequest.staleReadRequestType(0)).setSlidingWindowEntry(null).build();
    return client.getClientRpc().sendRequestAsync(request).whenComplete((reply, t) -> {
        try {
            client.close();
        } catch (IOException e) {
            throw new CompletionException(e);
        }
    });
}
Also used : RaftClientRequest(org.apache.ratis.protocol.RaftClientRequest) CompletionException(java.util.concurrent.CompletionException) IOException(java.io.IOException) RaftClient(org.apache.ratis.client.RaftClient)

Example 43 with CompletionException

use of java.util.concurrent.CompletionException in project alluxio by Alluxio.

the class SnapshotReplicationManager method installSnapshotFromLeader.

/**
 * Downloads and installs a snapshot from the leader.
 *
 * @return a future with the term index of the installed snapshot
 */
public CompletableFuture<TermIndex> installSnapshotFromLeader() {
    if (mJournalSystem.isLeader()) {
        return RaftJournalUtils.completeExceptionally(new IllegalStateException("Abort snapshot installation after becoming a leader"));
    }
    if (!transitionState(DownloadState.IDLE, DownloadState.STREAM_DATA)) {
        return RaftJournalUtils.completeExceptionally(new IllegalStateException("State is not IDLE when starting a snapshot installation"));
    }
    try (RaftJournalServiceClient client = getJournalServiceClient()) {
        String address = String.valueOf(client.getAddress());
        SnapshotDownloader<DownloadSnapshotPRequest, DownloadSnapshotPResponse> observer = SnapshotDownloader.forFollower(mStorage, address);
        Timer.Context ctx = MetricsSystem.timer(MetricKey.MASTER_EMBEDDED_JOURNAL_SNAPSHOT_DOWNLOAD_TIMER.getName()).time();
        client.downloadSnapshot(observer);
        return observer.getFuture().thenApplyAsync((termIndex) -> {
            ctx.close();
            mDownloadedSnapshot = observer.getSnapshotToInstall();
            transitionState(DownloadState.STREAM_DATA, DownloadState.DOWNLOADED);
            long index = installDownloadedSnapshot();
            if (index == RaftLog.INVALID_LOG_INDEX) {
                throw new CompletionException(new RuntimeException(String.format("Failed to install the downloaded snapshot %s", termIndex)));
            }
            if (index != termIndex.getIndex()) {
                throw new CompletionException(new IllegalStateException(String.format("Mismatched snapshot installed - downloaded %d, installed %d", termIndex.getIndex(), index)));
            }
            return termIndex;
        }).whenComplete((termIndex, throwable) -> {
            if (throwable != null) {
                LOG.error("Unexpected exception downloading snapshot from leader {}.", address, throwable);
                transitionState(DownloadState.STREAM_DATA, DownloadState.IDLE);
            }
        });
    } catch (Exception e) {
        transitionState(DownloadState.STREAM_DATA, DownloadState.IDLE);
        return RaftJournalUtils.completeExceptionally(e);
    }
}
Also used : DownloadSnapshotPRequest(alluxio.grpc.DownloadSnapshotPRequest) TermIndex(org.apache.ratis.server.protocol.TermIndex) PriorityQueue(java.util.PriorityQueue) LoggerFactory(org.slf4j.LoggerFactory) LogUtils(alluxio.util.LogUtils) GetSnapshotInfoResponse(alluxio.grpc.GetSnapshotInfoResponse) StreamObserver(io.grpc.stub.StreamObserver) JournalQueryRequest(alluxio.grpc.JournalQueryRequest) MetricKey(alluxio.metrics.MetricKey) Map(java.util.Map) Status(io.grpc.Status) ClientContext(alluxio.ClientContext) SnapshotInfo(org.apache.ratis.statemachine.SnapshotInfo) SingleFileSnapshotInfo(org.apache.ratis.statemachine.impl.SingleFileSnapshotInfo) UnsafeByteOperations(org.apache.ratis.thirdparty.com.google.protobuf.UnsafeByteOperations) ServerConfiguration(alluxio.conf.ServerConfiguration) JournalQueryResponse(alluxio.grpc.JournalQueryResponse) CompletionException(java.util.concurrent.CompletionException) SimpleStateMachineStorage(org.apache.ratis.statemachine.impl.SimpleStateMachineStorage) Collectors(java.util.stream.Collectors) FileNotFoundException(java.io.FileNotFoundException) RaftClientReply(org.apache.ratis.protocol.RaftClientReply) Timer(com.codahale.metrics.Timer) FileInfo(org.apache.ratis.server.storage.FileInfo) SnapshotData(alluxio.grpc.SnapshotData) MD5FileUtil(org.apache.ratis.util.MD5FileUtil) GetSnapshotInfoRequest(alluxio.grpc.GetSnapshotInfoRequest) UploadSnapshotPResponse(alluxio.grpc.UploadSnapshotPResponse) RaftLog(org.apache.ratis.server.raftlog.RaftLog) DownloadSnapshotPRequest(alluxio.grpc.DownloadSnapshotPRequest) CompletableFuture(java.util.concurrent.CompletableFuture) AtomicReference(java.util.concurrent.atomic.AtomicReference) Function(java.util.function.Function) Message(org.apache.ratis.protocol.Message) GetSnapshotRequest(alluxio.grpc.GetSnapshotRequest) QuorumServerState(alluxio.grpc.QuorumServerState) SnapshotMetadata(alluxio.grpc.SnapshotMetadata) ClientIpAddressInjector(alluxio.security.authentication.ClientIpAddressInjector) AbortedException(alluxio.exception.status.AbortedException) MetricsSystem(alluxio.metrics.MetricsSystem) AlluxioStatusException(alluxio.exception.status.AlluxioStatusException) DownloadSnapshotPResponse(alluxio.grpc.DownloadSnapshotPResponse) Logger(org.slf4j.Logger) RaftPeerId(org.apache.ratis.protocol.RaftPeerId) IOException(java.io.IOException) Pair(alluxio.collections.Pair) NotFoundException(alluxio.exception.status.NotFoundException) File(java.io.File) MessageLite(com.google.protobuf.MessageLite) UploadSnapshotPRequest(alluxio.grpc.UploadSnapshotPRequest) MasterClientContext(alluxio.master.MasterClientContext) Preconditions(com.google.common.base.Preconditions) VisibleForTesting(com.google.common.annotations.VisibleForTesting) Timer(com.codahale.metrics.Timer) CompletionException(java.util.concurrent.CompletionException) DownloadSnapshotPResponse(alluxio.grpc.DownloadSnapshotPResponse) CompletionException(java.util.concurrent.CompletionException) FileNotFoundException(java.io.FileNotFoundException) AbortedException(alluxio.exception.status.AbortedException) AlluxioStatusException(alluxio.exception.status.AlluxioStatusException) IOException(java.io.IOException) NotFoundException(alluxio.exception.status.NotFoundException)

Example 44 with CompletionException

use of java.util.concurrent.CompletionException in project flink by apache.

the class RestClusterClient method disposeSavepoint.

@Override
public CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath) {
    final SavepointDisposalRequest savepointDisposalRequest = new SavepointDisposalRequest(savepointPath);
    final CompletableFuture<TriggerResponse> savepointDisposalTriggerFuture = sendRequest(SavepointDisposalTriggerHeaders.getInstance(), savepointDisposalRequest);
    final CompletableFuture<AsynchronousOperationInfo> savepointDisposalFuture = savepointDisposalTriggerFuture.thenCompose((TriggerResponse triggerResponse) -> {
        final TriggerId triggerId = triggerResponse.getTriggerId();
        final SavepointDisposalStatusHeaders savepointDisposalStatusHeaders = SavepointDisposalStatusHeaders.getInstance();
        final SavepointDisposalStatusMessageParameters savepointDisposalStatusMessageParameters = savepointDisposalStatusHeaders.getUnresolvedMessageParameters();
        savepointDisposalStatusMessageParameters.triggerIdPathParameter.resolve(triggerId);
        return pollResourceAsync(() -> sendRequest(savepointDisposalStatusHeaders, savepointDisposalStatusMessageParameters));
    });
    return savepointDisposalFuture.thenApply((AsynchronousOperationInfo asynchronousOperationInfo) -> {
        if (asynchronousOperationInfo.getFailureCause() == null) {
            return Acknowledge.get();
        } else {
            throw new CompletionException(asynchronousOperationInfo.getFailureCause());
        }
    });
}
Also used : SavepointDisposalStatusHeaders(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointDisposalStatusHeaders) SavepointDisposalStatusMessageParameters(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointDisposalStatusMessageParameters) TriggerId(org.apache.flink.runtime.rest.messages.TriggerId) CompletionException(java.util.concurrent.CompletionException) SavepointDisposalRequest(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointDisposalRequest) TriggerResponse(org.apache.flink.runtime.rest.handler.async.TriggerResponse) AsynchronousOperationInfo(org.apache.flink.runtime.rest.handler.async.AsynchronousOperationInfo)

Example 45 with CompletionException

use of java.util.concurrent.CompletionException in project flink by apache.

the class RestClusterClient method triggerSavepoint.

private CompletableFuture<String> triggerSavepoint(final JobID jobId, @Nullable final String savepointDirectory, final boolean cancelJob, final SavepointFormatType formatType) {
    final SavepointTriggerHeaders savepointTriggerHeaders = SavepointTriggerHeaders.getInstance();
    final SavepointTriggerMessageParameters savepointTriggerMessageParameters = savepointTriggerHeaders.getUnresolvedMessageParameters();
    savepointTriggerMessageParameters.jobID.resolve(jobId);
    final CompletableFuture<TriggerResponse> responseFuture = sendRequest(savepointTriggerHeaders, savepointTriggerMessageParameters, new SavepointTriggerRequestBody(savepointDirectory, cancelJob, formatType, null));
    return responseFuture.thenCompose(savepointTriggerResponseBody -> {
        final TriggerId savepointTriggerId = savepointTriggerResponseBody.getTriggerId();
        return pollSavepointAsync(jobId, savepointTriggerId);
    }).thenApply(savepointInfo -> {
        if (savepointInfo.getFailureCause() != null) {
            throw new CompletionException(savepointInfo.getFailureCause());
        }
        return savepointInfo.getLocation();
    });
}
Also used : JobAccumulatorsHeaders(org.apache.flink.runtime.rest.messages.JobAccumulatorsHeaders) JobSubmissionException(org.apache.flink.runtime.client.JobSubmissionException) Tuple2(org.apache.flink.api.java.tuple.Tuple2) JobAccumulatorsInfo(org.apache.flink.runtime.rest.messages.JobAccumulatorsInfo) SavepointDisposalTriggerHeaders(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointDisposalTriggerHeaders) AsynchronousOperationInfo(org.apache.flink.runtime.rest.handler.async.AsynchronousOperationInfo) DefaultClientHighAvailabilityServicesFactory(org.apache.flink.runtime.highavailability.DefaultClientHighAvailabilityServicesFactory) EmptyMessageParameters(org.apache.flink.runtime.rest.messages.EmptyMessageParameters) EmptyRequestBody(org.apache.flink.runtime.rest.messages.EmptyRequestBody) ExponentialWaitStrategy(org.apache.flink.client.program.rest.retry.ExponentialWaitStrategy) JobSubmitHeaders(org.apache.flink.runtime.rest.messages.job.JobSubmitHeaders) Path(org.apache.flink.core.fs.Path) Map(java.util.Map) ShutdownHeaders(org.apache.flink.runtime.rest.messages.cluster.ShutdownHeaders) ClientCoordinationHeaders(org.apache.flink.runtime.rest.messages.job.coordination.ClientCoordinationHeaders) JobStatusMessage(org.apache.flink.runtime.client.JobStatusMessage) JobExecutionResultHeaders(org.apache.flink.runtime.rest.messages.job.JobExecutionResultHeaders) RestConstants(org.apache.flink.runtime.rest.util.RestConstants) JobsOverviewHeaders(org.apache.flink.runtime.rest.messages.JobsOverviewHeaders) Executors(java.util.concurrent.Executors) ConnectTimeoutException(org.apache.flink.shaded.netty4.io.netty.channel.ConnectTimeoutException) JobMessageParameters(org.apache.flink.runtime.rest.messages.JobMessageParameters) ClusterClient(org.apache.flink.client.program.ClusterClient) Time(org.apache.flink.api.common.time.Time) JobSubmitResponseBody(org.apache.flink.runtime.rest.messages.job.JobSubmitResponseBody) FlinkException(org.apache.flink.util.FlinkException) CoordinationResponse(org.apache.flink.runtime.operators.coordination.CoordinationResponse) JobStatus(org.apache.flink.api.common.JobStatus) AccumulatorHelper(org.apache.flink.api.common.accumulators.AccumulatorHelper) Supplier(java.util.function.Supplier) HttpResponseStatus(org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseStatus) ArrayList(java.util.ArrayList) FutureUtils(org.apache.flink.util.concurrent.FutureUtils) StopWithSavepointRequestBody(org.apache.flink.runtime.rest.messages.job.savepoints.stop.StopWithSavepointRequestBody) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) BiConsumer(java.util.function.BiConsumer) ObjectOutputStream(java.io.ObjectOutputStream) SavepointStatusMessageParameters(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointStatusMessageParameters) CheckedSupplier(org.apache.flink.util.function.CheckedSupplier) Nullable(javax.annotation.Nullable) TriggerResponse(org.apache.flink.runtime.rest.handler.async.TriggerResponse) SavepointDisposalStatusMessageParameters(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointDisposalStatusMessageParameters) Files(java.nio.file.Files) ApplicationStatus(org.apache.flink.runtime.clusterframework.ApplicationStatus) JobDetailsInfo(org.apache.flink.runtime.rest.messages.job.JobDetailsInfo) SavepointInfo(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointInfo) IOException(java.io.IOException) VisibleForTesting(org.apache.flink.annotation.VisibleForTesting) ExecutionException(java.util.concurrent.ExecutionException) SavepointTriggerMessageParameters(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointTriggerMessageParameters) JobID(org.apache.flink.api.common.JobID) Paths(java.nio.file.Paths) TerminationModeQueryParameter(org.apache.flink.runtime.rest.messages.TerminationModeQueryParameter) SavepointStatusHeaders(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointStatusHeaders) SavepointDisposalRequest(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointDisposalRequest) MessageParameters(org.apache.flink.runtime.rest.messages.MessageParameters) TriggerId(org.apache.flink.runtime.rest.messages.TriggerId) URL(java.net.URL) QueueStatus(org.apache.flink.runtime.rest.messages.queue.QueueStatus) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) LoggerFactory(org.slf4j.LoggerFactory) ExceptionUtils(org.apache.flink.util.ExceptionUtils) ClientCoordinationRequestBody(org.apache.flink.runtime.rest.messages.job.coordination.ClientCoordinationRequestBody) JobAccumulatorsMessageParameters(org.apache.flink.runtime.rest.messages.JobAccumulatorsMessageParameters) SavepointTriggerRequestBody(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointTriggerRequestBody) RequestBody(org.apache.flink.runtime.rest.messages.RequestBody) Preconditions.checkNotNull(org.apache.flink.util.Preconditions.checkNotNull) SavepointDisposalStatusHeaders(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointDisposalStatusHeaders) RestClientException(org.apache.flink.runtime.rest.util.RestClientException) JobSubmitRequestBody(org.apache.flink.runtime.rest.messages.job.JobSubmitRequestBody) LeaderRetriever(org.apache.flink.runtime.webmonitor.retriever.LeaderRetriever) ExecutorThreadFactory(org.apache.flink.util.concurrent.ExecutorThreadFactory) Predicate(java.util.function.Predicate) Collection(java.util.Collection) CompletionException(java.util.concurrent.CompletionException) SavepointTriggerHeaders(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointTriggerHeaders) DistributedCache(org.apache.flink.api.common.cache.DistributedCache) Collectors(java.util.stream.Collectors) Acknowledge(org.apache.flink.runtime.messages.Acknowledge) StopWithSavepointTriggerHeaders(org.apache.flink.runtime.rest.messages.job.savepoints.stop.StopWithSavepointTriggerHeaders) ExecutorUtils(org.apache.flink.util.ExecutorUtils) FileUpload(org.apache.flink.runtime.rest.FileUpload) List(java.util.List) SerializedValue(org.apache.flink.util.SerializedValue) CoordinationRequest(org.apache.flink.runtime.operators.coordination.CoordinationRequest) OperatorID(org.apache.flink.runtime.jobgraph.OperatorID) SavepointFormatType(org.apache.flink.core.execution.SavepointFormatType) ScheduledExecutorServiceAdapter(org.apache.flink.util.concurrent.ScheduledExecutorServiceAdapter) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CompletableFuture(java.util.concurrent.CompletableFuture) MessageHeaders(org.apache.flink.runtime.rest.messages.MessageHeaders) JobCancellationHeaders(org.apache.flink.runtime.rest.messages.JobCancellationHeaders) JobResult(org.apache.flink.runtime.jobmaster.JobResult) WaitStrategy(org.apache.flink.client.program.rest.retry.WaitStrategy) ClientCoordinationMessageParameters(org.apache.flink.runtime.rest.messages.job.coordination.ClientCoordinationMessageParameters) ClientHighAvailabilityServices(org.apache.flink.runtime.highavailability.ClientHighAvailabilityServices) LeaderRetrievalService(org.apache.flink.runtime.leaderretrieval.LeaderRetrievalService) JobDetailsHeaders(org.apache.flink.runtime.rest.messages.job.JobDetailsHeaders) AsynchronouslyCreatedResource(org.apache.flink.runtime.rest.messages.queue.AsynchronouslyCreatedResource) Nonnull(javax.annotation.Nonnull) ExecutorService(java.util.concurrent.ExecutorService) EmptyResponseBody(org.apache.flink.runtime.rest.messages.EmptyResponseBody) Logger(org.slf4j.Logger) MalformedURLException(java.net.MalformedURLException) Configuration(org.apache.flink.configuration.Configuration) ClientHighAvailabilityServicesFactory(org.apache.flink.runtime.highavailability.ClientHighAvailabilityServicesFactory) TimeUnit(java.util.concurrent.TimeUnit) ResponseBody(org.apache.flink.runtime.rest.messages.ResponseBody) JobCancellationMessageParameters(org.apache.flink.runtime.rest.messages.JobCancellationMessageParameters) Collections(java.util.Collections) RestClient(org.apache.flink.runtime.rest.RestClient) TriggerId(org.apache.flink.runtime.rest.messages.TriggerId) CompletionException(java.util.concurrent.CompletionException) SavepointTriggerMessageParameters(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointTriggerMessageParameters) TriggerResponse(org.apache.flink.runtime.rest.handler.async.TriggerResponse) SavepointTriggerRequestBody(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointTriggerRequestBody) SavepointTriggerHeaders(org.apache.flink.runtime.rest.messages.job.savepoints.SavepointTriggerHeaders) StopWithSavepointTriggerHeaders(org.apache.flink.runtime.rest.messages.job.savepoints.stop.StopWithSavepointTriggerHeaders)

Aggregations

CompletionException (java.util.concurrent.CompletionException)199 Test (org.junit.Test)80 CompletableFuture (java.util.concurrent.CompletableFuture)62 List (java.util.List)52 ArrayList (java.util.ArrayList)51 IOException (java.io.IOException)45 Map (java.util.Map)39 Collection (java.util.Collection)31 ExecutionException (java.util.concurrent.ExecutionException)31 HashMap (java.util.HashMap)30 Collections (java.util.Collections)24 TimeUnit (java.util.concurrent.TimeUnit)22 Collectors (java.util.stream.Collectors)22 FlinkException (org.apache.flink.util.FlinkException)22 Before (org.junit.Before)21 Duration (java.time.Duration)19 Arrays (java.util.Arrays)19 BeforeClass (org.junit.BeforeClass)19 ExecutorService (java.util.concurrent.ExecutorService)18 Nonnull (javax.annotation.Nonnull)17