/** * Reattaches to a running job with the given job id. * * @param jobID The job id of the job to attach to * @return The JobExecutionResult for the jobID * @throws JobExecutionException if an error occurs during monitoring the job execution */ public JobListeningContext connectToJob(JobID jobID) throws JobExecutionException { final ActorSystem actorSystem; try { actorSystem = actorSystemLoader.get(); } catch (FlinkException fe) { throw new JobExecutionException( jobID, "Could not start the ActorSystem needed to talk to the JobManager.", fe); } return JobClient.attachToRunningJob( jobID, flinkConfig, actorSystem, highAvailabilityServices, timeout, printStatusDuringExecution); }
/** * Reattaches to a running from the supplied job id. * @param jobID The job id of the job to attach to * @return The JobExecutionResult for the jobID * @throws JobExecutionException if an error occurs during monitoring the job execution */ public JobExecutionResult retrieveJob(JobID jobID) throws JobExecutionException { final ActorSystem actorSystem; try { actorSystem = actorSystemLoader.get(); } catch (FlinkException fe) { throw new JobExecutionException( jobID, "Could not start the ActorSystem needed to talk to the JobManager.", fe); } final JobListeningContext listeningContext = JobClient.attachToRunningJob( jobID, flinkConfig, actorSystem, highAvailabilityServices, timeout, printStatusDuringExecution); return JobClient.awaitJobResult(listeningContext); }
public JobExecutionResult getResult() throws JobExecutionException, InterruptedException { jobMastersToWaitFor.await(); final Throwable jobFailureCause = this.jobException; final Throwable runnerException = this.runnerException; final JobExecutionResult result = this.result; // (1) we check if the job terminated with an exception // (2) we check whether the job completed successfully // (3) we check if we have exceptions from the JobManagers. the job may still have // completed successfully in that case, if multiple JobMasters were running // and other took over. only if all encounter a fatal error, the job cannot finish if (jobFailureCause != null) { if (jobFailureCause instanceof JobExecutionException) { throw (JobExecutionException) jobFailureCause; } else { throw new JobExecutionException(jobId, "The job execution failed", jobFailureCause); } } else if (result != null) { return result; } else if (runnerException != null) { throw new JobExecutionException(jobId, "The job execution failed because all JobManagers encountered fatal errors", runnerException); } else { throw new IllegalStateException("Bug: Job finished with neither error nor result."); } } }
/** * Reattaches to a running job with the given job id. * * @param jobID The job id of the job to attach to * @return The JobExecutionResult for the jobID * @throws JobExecutionException if an error occurs during monitoring the job execution */ public JobListeningContext connectToJob(JobID jobID) throws JobExecutionException { final ActorSystem actorSystem; try { actorSystem = actorSystemLoader.get(); } catch (FlinkException fe) { throw new JobExecutionException( jobID, "Could not start the ActorSystem needed to talk to the JobManager.", fe); } return JobClient.attachToRunningJob( jobID, flinkConfig, actorSystem, highAvailabilityServices, timeout, printStatusDuringExecution); }
/** * Reattaches to a running job with the given job id. * * @param jobID The job id of the job to attach to * @return The JobExecutionResult for the jobID * @throws JobExecutionException if an error occurs during monitoring the job execution */ public JobListeningContext connectToJob(JobID jobID) throws JobExecutionException { final ActorSystem actorSystem; try { actorSystem = actorSystemLoader.get(); } catch (FlinkException fe) { throw new JobExecutionException( jobID, "Could not start the ActorSystem needed to talk to the JobManager.", fe); } return JobClient.attachToRunningJob( jobID, flinkConfig, actorSystem, highAvailabilityServices, timeout, printStatusDuringExecution); }
exception = new JobExecutionException(jobId, "Job execution failed.", cause); } else if (applicationStatus == ApplicationStatus.CANCELED) { exception = new JobCancellationException(jobId, "Job was cancelled.", cause); } else { exception = new JobExecutionException(jobId, "Job completed with illegal application status: " + applicationStatus + '.', cause);
exception = new JobExecutionException(jobId, "Job execution failed.", cause); } else if (applicationStatus == ApplicationStatus.CANCELED) { exception = new JobCancellationException(jobId, "Job was cancelled.", cause); } else { exception = new JobExecutionException(jobId, "Job completed with illegal application status: " + applicationStatus + '.', cause);
/** * This method executes a job in detached mode. The method returns immediately after the job * has been added to the * * @param job The Flink job to execute * * @throws JobExecutionException Thrown if anything went amiss during initial job launch, * or if the job terminally failed. */ public void runDetached(JobGraph job) throws JobExecutionException, InterruptedException { checkNotNull(job, "job is null"); final CompletableFuture<JobSubmissionResult> submissionFuture = submitJob(job); try { submissionFuture.get(); } catch (ExecutionException e) { throw new JobExecutionException(job.getJobID(), ExceptionUtils.stripExecutionException(e)); } }
/** * This method executes a job in detached mode. The method returns immediately after the job * has been added to the * * @param job The Flink job to execute * * @throws JobExecutionException Thrown if anything went amiss during initial job launch, * or if the job terminally failed. */ public void runDetached(JobGraph job) throws JobExecutionException, InterruptedException { checkNotNull(job, "job is null"); final CompletableFuture<JobSubmissionResult> submissionFuture = submitJob(job); try { submissionFuture.get(); } catch (ExecutionException e) { throw new JobExecutionException(job.getJobID(), ExceptionUtils.stripExecutionException(e)); } }
/** * This method runs a job in blocking mode. The method returns only after the job * completed successfully, or after it failed terminally. * * @param job The Flink job to execute * @return The result of the job execution * * @throws JobExecutionException Thrown if anything went amiss during initial job launch, * or if the job terminally failed. */ @Override public JobExecutionResult executeJobBlocking(JobGraph job) throws JobExecutionException, InterruptedException { checkNotNull(job, "job is null"); final CompletableFuture<JobSubmissionResult> submissionFuture = submitJob(job); final CompletableFuture<JobResult> jobResultFuture = submissionFuture.thenCompose( (JobSubmissionResult ignored) -> requestJobResult(job.getJobID())); final JobResult jobResult; try { jobResult = jobResultFuture.get(); } catch (ExecutionException e) { throw new JobExecutionException(job.getJobID(), "Could not retrieve JobResult.", ExceptionUtils.stripExecutionException(e)); } try { return jobResult.toJobExecutionResult(Thread.currentThread().getContextClassLoader()); } catch (IOException | ClassNotFoundException e) { throw new JobExecutionException(job.getJobID(), e); } }
/** * This method runs a job in blocking mode. The method returns only after the job * completed successfully, or after it failed terminally. * * @param job The Flink job to execute * @return The result of the job execution * * @throws JobExecutionException Thrown if anything went amiss during initial job launch, * or if the job terminally failed. */ @Override public JobExecutionResult executeJobBlocking(JobGraph job) throws JobExecutionException, InterruptedException { checkNotNull(job, "job is null"); final CompletableFuture<JobSubmissionResult> submissionFuture = submitJob(job); final CompletableFuture<JobResult> jobResultFuture = submissionFuture.thenCompose( (JobSubmissionResult ignored) -> requestJobResult(job.getJobID())); final JobResult jobResult; try { jobResult = jobResultFuture.get(); } catch (ExecutionException e) { throw new JobExecutionException(job.getJobID(), "Could not retrieve JobResult.", ExceptionUtils.stripExecutionException(e)); } try { return jobResult.toJobExecutionResult(Thread.currentThread().getContextClassLoader()); } catch (IOException | ClassNotFoundException e) { throw new JobExecutionException(job.getJobID(), e); } }
/** * This method executes a job in detached mode. The method returns immediately after the job * has been added to the * * @param job The Flink job to execute * * @throws JobExecutionException Thrown if anything went amiss during initial job launch, * or if the job terminally failed. */ public void runDetached(JobGraph job) throws JobExecutionException, InterruptedException { checkNotNull(job, "job is null"); final CompletableFuture<JobSubmissionResult> submissionFuture = submitJob(job); try { submissionFuture.get(); } catch (ExecutionException e) { throw new JobExecutionException(job.getJobID(), ExceptionUtils.stripExecutionException(e)); } }
/** * Reattaches to a running from the supplied job id. * @param jobID The job id of the job to attach to * @return The JobExecutionResult for the jobID * @throws JobExecutionException if an error occurs during monitoring the job execution */ public JobExecutionResult retrieveJob(JobID jobID) throws JobExecutionException { final ActorSystem actorSystem; try { actorSystem = actorSystemLoader.get(); } catch (FlinkException fe) { throw new JobExecutionException( jobID, "Could not start the ActorSystem needed to talk to the JobManager.", fe); } final JobListeningContext listeningContext = JobClient.attachToRunningJob( jobID, flinkConfig, actorSystem, highAvailabilityServices, timeout, printStatusDuringExecution); return JobClient.awaitJobResult(listeningContext); }
return submissionFuture.get(); } catch (ExecutionException e) { throw new JobExecutionException(job.getJobID(), "Fail to submit Job", ExceptionUtils.stripExecutionException(e)); jobResult = jobResultFuture.get(); } catch (ExecutionException e) { throw new JobExecutionException(job.getJobID(), "Could not retrieve JobResult.", ExceptionUtils.stripExecutionException(e)); return jobResult.toJobExecutionResult(Thread.currentThread().getContextClassLoader()); } catch (JobResult.WrappedJobException e) { throw new JobExecutionException(job.getJobID(), e.getCause()); } catch (IOException | ClassNotFoundException e) { throw new JobExecutionException(job.getJobID(), e);
/** * Reattaches to a running from the supplied job id. * @param jobID The job id of the job to attach to * @return The JobExecutionResult for the jobID * @throws JobExecutionException if an error occurs during monitoring the job execution */ public JobExecutionResult retrieveJob(JobID jobID) throws JobExecutionException { final ActorSystem actorSystem; try { actorSystem = actorSystemLoader.get(); } catch (FlinkException fe) { throw new JobExecutionException( jobID, "Could not start the ActorSystem needed to talk to the JobManager.", fe); } final JobListeningContext listeningContext = JobClient.attachToRunningJob( jobID, flinkConfig, actorSystem, highAvailabilityServices, timeout, printStatusDuringExecution); return JobClient.awaitJobResult(listeningContext); }
log.error("Cannot fetch final accumulators for job {} ({})", jobName, jobID, e); final JobExecutionException exception = new JobExecutionException(jobID, "Failed to retrieve accumulator results. " + "The job is registered as 'FINISHED (successful), but this notification describes " + final JobExecutionException exception = new JobExecutionException( jobID, "Job was cancelled.", new Exception("The job was cancelled")); final JobExecutionException exception = new JobExecutionException( jobID, "Job execution failed.", unpackedError); jobCompletionActions.jobFailed(exception);
actorSystem = actorSystemLoader.get(); } catch (FlinkException fe) { throw new JobExecutionException( jobID, "Could not start the ActorSystem needed to talk to the JobManager.",
actorSystem = actorSystemLoader.get(); } catch (FlinkException fe) { throw new JobExecutionException( jobID, "Could not start the ActorSystem needed to talk to the JobManager.",
throw new JobExecutionException(job.getJobID(), "Could not start the JobManager(s) for the job", t);
throw jee; } catch (Throwable t) { throw new JobExecutionException( jobGraph.getJobID(), "JobSubmission failed.",