.jobId(jobId) .netRuntime(Long.MAX_VALUE) .serializedThrowable(new SerializedThrowable(new RuntimeException("expected"))) .build()));
.netRuntime(netRuntime) .accumulatorResults(accumulatorResults) .serializedThrowable(serializedThrowable) .build(); } catch (final RuntimeException e) {
.netRuntime(netRuntime) .accumulatorResults(accumulatorResults) .serializedThrowable(serializedThrowable) .build(); } catch (final RuntimeException e) {
.netRuntime(netRuntime) .accumulatorResults(accumulatorResults) .serializedThrowable(serializedThrowable) .build(); } catch (final RuntimeException e) {
builder.serializedThrowable(errorInfo.getException());
builder.serializedThrowable(errorInfo.getException());
/** * Creates the {@link JobResult} from the given {@link AccessExecutionGraph} which * must be in a globally terminal state. * * @param accessExecutionGraph to create the JobResult from * @return JobResult of the given AccessExecutionGraph */ public static JobResult createFrom(AccessExecutionGraph accessExecutionGraph) { final JobID jobId = accessExecutionGraph.getJobID(); final JobStatus jobStatus = accessExecutionGraph.getState(); checkArgument( jobStatus.isGloballyTerminalState(), "The job " + accessExecutionGraph.getJobName() + '(' + jobId + ") is not in a globally " + "terminal state. It is in state " + jobStatus + '.'); final JobResult.Builder builder = new JobResult.Builder(); builder.jobId(jobId); final long netRuntime = accessExecutionGraph.getStatusTimestamp(jobStatus) - accessExecutionGraph.getStatusTimestamp(JobStatus.CREATED); // guard against clock changes final long guardedNetRuntime = Math.max(netRuntime, 0L); builder.netRuntime(guardedNetRuntime); builder.accumulatorResults(accessExecutionGraph.getAccumulatorsSerialized()); if (jobStatus != JobStatus.FINISHED) { final ErrorInfo errorInfo = accessExecutionGraph.getFailureInfo(); if (errorInfo != null) { builder.serializedThrowable(errorInfo.getException()); } } return builder.build(); }