Search in sources :

Example 11 with JobManagerRunner

use of org.apache.flink.runtime.jobmaster.JobManagerRunner in project flink by apache.

the class Dispatcher method requestExecutionGraphInfo.

@Override
public CompletableFuture<ExecutionGraphInfo> requestExecutionGraphInfo(JobID jobId, Time timeout) {
    Function<Throwable, ExecutionGraphInfo> checkExecutionGraphStoreOnException = throwable -> {
        // check whether it is a completed job
        final ExecutionGraphInfo executionGraphInfo = executionGraphInfoStore.get(jobId);
        if (executionGraphInfo == null) {
            throw new CompletionException(ExceptionUtils.stripCompletionException(throwable));
        } else {
            return executionGraphInfo;
        }
    };
    Optional<JobManagerRunner> maybeJob = getJobManagerRunner(jobId);
    return maybeJob.map(job -> job.requestJob(timeout)).orElse(FutureUtils.completedExceptionally(new FlinkJobNotFoundException(jobId))).exceptionally(checkExecutionGraphStoreOnException);
}
Also used : JobSubmissionException(org.apache.flink.runtime.client.JobSubmissionException) Tuple2(org.apache.flink.api.java.tuple.Tuple2) ClusterOptions(org.apache.flink.configuration.ClusterOptions) JobGraph(org.apache.flink.runtime.jobgraph.JobGraph) RpcServiceUtils(org.apache.flink.runtime.rpc.RpcServiceUtils) ExceptionUtils(org.apache.flink.util.ExceptionUtils) AsynchronousJobOperationKey(org.apache.flink.runtime.rest.handler.job.AsynchronousJobOperationKey) ClusterOverview(org.apache.flink.runtime.messages.webmonitor.ClusterOverview) ResourceSpec(org.apache.flink.api.common.operators.ResourceSpec) FunctionUtils(org.apache.flink.util.function.FunctionUtils) Map(java.util.Map) PermanentlyFencedRpcEndpoint(org.apache.flink.runtime.rpc.PermanentlyFencedRpcEndpoint) Checkpoints(org.apache.flink.runtime.checkpoint.Checkpoints) Preconditions.checkNotNull(org.apache.flink.util.Preconditions.checkNotNull) JobGraphWriter(org.apache.flink.runtime.jobmanager.JobGraphWriter) JobsOverview(org.apache.flink.runtime.messages.webmonitor.JobsOverview) HighAvailabilityServices(org.apache.flink.runtime.highavailability.HighAvailabilityServices) DispatcherResourceCleanerFactory(org.apache.flink.runtime.dispatcher.cleanup.DispatcherResourceCleanerFactory) JobDetails(org.apache.flink.runtime.messages.webmonitor.JobDetails) Collection(java.util.Collection) GatewayRetriever(org.apache.flink.runtime.webmonitor.retriever.GatewayRetriever) Set(java.util.Set) CompletionException(java.util.concurrent.CompletionException) FlinkJobTerminatedWithoutCancellationException(org.apache.flink.runtime.messages.FlinkJobTerminatedWithoutCancellationException) Preconditions(org.apache.flink.util.Preconditions) Collectors(java.util.stream.Collectors) Acknowledge(org.apache.flink.runtime.messages.Acknowledge) HeartbeatServices(org.apache.flink.runtime.heartbeat.HeartbeatServices) MetricNames(org.apache.flink.runtime.metrics.MetricNames) MetricGroup(org.apache.flink.metrics.MetricGroup) List(java.util.List) SerializedValue(org.apache.flink.util.SerializedValue) CoordinationRequest(org.apache.flink.runtime.operators.coordination.CoordinationRequest) FlinkJobNotFoundException(org.apache.flink.runtime.messages.FlinkJobNotFoundException) JobManagerSharedServices(org.apache.flink.runtime.jobmaster.JobManagerSharedServices) OperatorID(org.apache.flink.runtime.jobgraph.OperatorID) Optional(java.util.Optional) JobResultStore(org.apache.flink.runtime.highavailability.JobResultStore) ResourceCleanerFactory(org.apache.flink.runtime.dispatcher.cleanup.ResourceCleanerFactory) Time(org.apache.flink.api.common.time.Time) ResourceManagerGateway(org.apache.flink.runtime.resourcemanager.ResourceManagerGateway) ClusterEntryPointExceptionUtils(org.apache.flink.runtime.entrypoint.ClusterEntryPointExceptionUtils) FlinkException(org.apache.flink.util.FlinkException) SavepointFormatType(org.apache.flink.core.execution.SavepointFormatType) BlobServer(org.apache.flink.runtime.blob.BlobServer) JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) DefaultJobManagerJobMetricGroupFactory(org.apache.flink.runtime.jobmaster.factories.DefaultJobManagerJobMetricGroupFactory) CoordinationResponse(org.apache.flink.runtime.operators.coordination.CoordinationResponse) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) JobStatus(org.apache.flink.api.common.JobStatus) Function(java.util.function.Function) ArrayList(java.util.ArrayList) JobMasterGateway(org.apache.flink.runtime.jobmaster.JobMasterGateway) HashSet(java.util.HashSet) JobResult(org.apache.flink.runtime.jobmaster.JobResult) RpcService(org.apache.flink.runtime.rpc.RpcService) CleanupRunnerFactory(org.apache.flink.runtime.dispatcher.cleanup.CleanupRunnerFactory) ResourceOverview(org.apache.flink.runtime.resourcemanager.ResourceOverview) FutureUtils(org.apache.flink.util.concurrent.FutureUtils) FatalErrorHandler(org.apache.flink.runtime.rpc.FatalErrorHandler) ResourceID(org.apache.flink.runtime.clusterframework.types.ResourceID) ThrowingConsumer(org.apache.flink.util.function.ThrowingConsumer) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) ArchivedExecutionGraph(org.apache.flink.runtime.executiongraph.ArchivedExecutionGraph) JobManagerRunnerResult(org.apache.flink.runtime.jobmaster.JobManagerRunnerResult) Executor(java.util.concurrent.Executor) OperationResult(org.apache.flink.runtime.rest.handler.async.OperationResult) ApplicationStatus(org.apache.flink.runtime.clusterframework.ApplicationStatus) Configuration(org.apache.flink.configuration.Configuration) ThreadDumpInfo(org.apache.flink.runtime.rest.messages.ThreadDumpInfo) IOException(java.io.IOException) ExecutionGraphInfo(org.apache.flink.runtime.scheduler.ExecutionGraphInfo) VisibleForTesting(org.apache.flink.annotation.VisibleForTesting) JobResultEntry(org.apache.flink.runtime.highavailability.JobResultEntry) MultipleJobsDetails(org.apache.flink.runtime.messages.webmonitor.MultipleJobsDetails) JobID(org.apache.flink.api.common.JobID) ResourceCleaner(org.apache.flink.runtime.dispatcher.cleanup.ResourceCleaner) JobManagerRunner(org.apache.flink.runtime.jobmaster.JobManagerRunner) Collections(java.util.Collections) DuplicateJobSubmissionException(org.apache.flink.runtime.client.DuplicateJobSubmissionException) JobManagerMetricGroup(org.apache.flink.runtime.metrics.groups.JobManagerMetricGroup) ExecutionGraphInfo(org.apache.flink.runtime.scheduler.ExecutionGraphInfo) CompletionException(java.util.concurrent.CompletionException) FlinkJobNotFoundException(org.apache.flink.runtime.messages.FlinkJobNotFoundException) JobManagerRunner(org.apache.flink.runtime.jobmaster.JobManagerRunner)

Aggregations

JobManagerRunner (org.apache.flink.runtime.jobmaster.JobManagerRunner)11 Optional (java.util.Optional)4 CompletableFuture (java.util.concurrent.CompletableFuture)4 JobID (org.apache.flink.api.common.JobID)4 JobStatus (org.apache.flink.api.common.JobStatus)4 Collections (java.util.Collections)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 Test (org.junit.Test)3 Duration (java.time.Duration)2 ArrayList (java.util.ArrayList)2 UUID (java.util.UUID)2 BlockingQueue (java.util.concurrent.BlockingQueue)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 ExecutionException (java.util.concurrent.ExecutionException)2 ForkJoinPool (java.util.concurrent.ForkJoinPool)2 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 AtomicReference (java.util.concurrent.atomic.AtomicReference)2 Nonnull (javax.annotation.Nonnull)2