Class JobResult
- java.lang.Object
-
- org.apache.flink.runtime.jobmaster.JobResult
-
- All Implemented Interfaces:
Serializable
public class JobResult extends Object implements Serializable
Similar toJobExecutionResultbut with an optionalSerializedThrowablewhen the job failed.This is used by the
JobMasterto send the results to theDispatcher.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJobResult.BuilderBuilder forJobResult.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JobResultcreateFrom(AccessExecutionGraph accessExecutionGraph)Creates theJobResultfrom the givenAccessExecutionGraphwhich must be in a globally terminal state.Map<String,org.apache.flink.util.SerializedValue<org.apache.flink.util.OptionalFailure<Object>>>getAccumulatorResults()ApplicationStatusgetApplicationStatus()org.apache.flink.api.common.JobIDgetJobId()longgetNetRuntime()Optional<org.apache.flink.util.SerializedThrowable>getSerializedThrowable()Returns an emptyOptionalif the job finished successfully, otherwise theOptionalwill carry the failure cause.booleanisSuccess()Returnstrueif the job finished successfully.org.apache.flink.api.common.JobExecutionResulttoJobExecutionResult(ClassLoader classLoader)Converts theJobResultto aJobExecutionResult.
-
-
-
Method Detail
-
isSuccess
public boolean isSuccess()
Returnstrueif the job finished successfully.
-
getJobId
public org.apache.flink.api.common.JobID getJobId()
-
getApplicationStatus
public ApplicationStatus getApplicationStatus()
-
getAccumulatorResults
public Map<String,org.apache.flink.util.SerializedValue<org.apache.flink.util.OptionalFailure<Object>>> getAccumulatorResults()
-
getNetRuntime
public long getNetRuntime()
-
getSerializedThrowable
public Optional<org.apache.flink.util.SerializedThrowable> getSerializedThrowable()
Returns an emptyOptionalif the job finished successfully, otherwise theOptionalwill carry the failure cause.
-
toJobExecutionResult
public org.apache.flink.api.common.JobExecutionResult toJobExecutionResult(ClassLoader classLoader) throws JobExecutionException, IOException, ClassNotFoundException
Converts theJobResultto aJobExecutionResult.- Parameters:
classLoader- to use for deserialization- Returns:
- JobExecutionResult
- Throws:
JobCancellationException- if the job was cancelledJobExecutionException- if the job execution did not succeedIOException- if the accumulator could not be deserializedClassNotFoundException- if the accumulator could not deserialized
-
createFrom
public static JobResult createFrom(AccessExecutionGraph accessExecutionGraph)
Creates theJobResultfrom the givenAccessExecutionGraphwhich must be in a globally terminal state.- Parameters:
accessExecutionGraph- to create the JobResult from- Returns:
- JobResult of the given AccessExecutionGraph
-
-