Class 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 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 milliseconds
        accumulators - 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. See getJobExecutionResult to retrieve the JobExecutionResult.
        Overrides:
        isJobExecutionResult in class JobSubmissionResult
        Returns:
        True if this is a JobExecutionResult, false otherwise
      • 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. Returns null, 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.
      • getIntCounterResult

        @Deprecated
        @PublicEvolving
        public Integer getIntCounterResult​(String accumulatorName)
        Deprecated.
        Will be removed in future versions. Use getAccumulatorResult(java.lang.String) instead.
        Gets the accumulator with the given name as an integer.
        Parameters:
        accumulatorName - Name of the counter
        Returns:
        Result of the counter, or null if the counter does not exist
        Throws:
        ClassCastException - Thrown, if the accumulator was not aggregating a Integer
      • fromJobSubmissionResult

        @Deprecated
        public static JobExecutionResult fromJobSubmissionResult​(JobSubmissionResult result)
        Deprecated.
        Will be removed in future versions.
        Returns a dummy object for wrapping a JobSubmissionResult.
        Parameters:
        result - The SubmissionResult
        Returns:
        a JobExecutionResult