Package org.apache.flink.api.common
Class JobExecutionResult
- java.lang.Object
-
- org.apache.flink.api.common.JobSubmissionResult
-
- org.apache.flink.api.common.JobExecutionResult
-
- Direct Known Subclasses:
DetachedJobExecutionResult
@Public public class JobExecutionResult extends JobSubmissionResult
The result of a job execution. Gives access to the execution time of the job, and to all accumulators created by this job.
-
-
Constructor Summary
Constructors Constructor Description JobExecutionResult(JobID jobID, long netRuntime, Map<String,OptionalFailure<Object>> accumulators)
Creates a new JobExecutionResult.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getAccumulatorResult(String accumulatorName)
Gets the accumulator with the given name.Map<String,Object>
getAllAccumulatorResults()
Gets all accumulators produced by the job.JobExecutionResult
getJobExecutionResult()
Returns the JobExecutionResult if available.long
getNetRuntime()
Gets the net execution time of the job, i.e., the execution time in the parallel system, without the pre-flight steps like the optimizer.long
getNetRuntime(TimeUnit desiredUnit)
Gets the net execution time of the job, i.e., the execution time in the parallel system, without the pre-flight steps like the optimizer in a desired time unit.boolean
isJobExecutionResult()
Checks if this JobSubmissionResult is also a JobExecutionResult.String
toString()
-
Methods inherited from class org.apache.flink.api.common.JobSubmissionResult
getJobID
-
-
-
-
Constructor Detail
-
JobExecutionResult
public JobExecutionResult(JobID jobID, long netRuntime, Map<String,OptionalFailure<Object>> accumulators)
Creates a new JobExecutionResult.- Parameters:
jobID
- The job's ID.netRuntime
- The net runtime of the job (excluding pre-flight phase like the optimizer) in millisecondsaccumulators
- A map of all accumulators produced by the job.
-
-
Method Detail
-
isJobExecutionResult
public boolean isJobExecutionResult()
Description copied from class:JobSubmissionResult
Checks if this JobSubmissionResult is also a JobExecutionResult. SeegetJobExecutionResult
to retrieve the JobExecutionResult.- Overrides:
isJobExecutionResult
in classJobSubmissionResult
- Returns:
- True if this is a JobExecutionResult, false otherwise
-
getJobExecutionResult
public JobExecutionResult getJobExecutionResult()
Description copied from class:JobSubmissionResult
Returns the JobExecutionResult if available.- Overrides:
getJobExecutionResult
in classJobSubmissionResult
- Returns:
- The JobExecutionResult
-
getNetRuntime
public long getNetRuntime()
Gets the net execution time of the job, i.e., the execution time in the parallel system, without the pre-flight steps like the optimizer.- Returns:
- The net execution time in milliseconds.
-
getNetRuntime
public long getNetRuntime(TimeUnit desiredUnit)
Gets the net execution time of the job, i.e., the execution time in the parallel system, without the pre-flight steps like the optimizer in a desired time unit.- Parameters:
desiredUnit
- the unit of the NetRuntime- Returns:
- The net execution time in the desired unit.
-
getAccumulatorResult
public <T> T getAccumulatorResult(String accumulatorName)
Gets the accumulator with the given name. Returnsnull
, if no accumulator with that name was produced.- Type Parameters:
T
- The generic type of the accumulator value.- Parameters:
accumulatorName
- The name of the accumulator.- Returns:
- The value of the accumulator with the given name.
-
getAllAccumulatorResults
public Map<String,Object> getAllAccumulatorResults()
Gets all accumulators produced by the job. The map contains the accumulators as mappings from the accumulator name to the accumulator value.- Returns:
- A map containing all accumulators produced by the job.
-
-