org.apache.hadoop.mapred.jobcontrol

## Class Job

- java.lang.Object
- - org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob
  - - org.apache.hadoop.mapred.jobcontrol.Job

-     @InterfaceAudience.Public
       @InterfaceStability.Stable
      public class Job
      extends ControlledJob

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob

      `ControlledJob.State`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEPENDENT_FAILED`
    `static int` | `FAILED`
    `static int` | `READY`
    `static int` | `RUNNING`
    `static int` | `SUCCESS`
    `static int` | `WAITING`

    - ### Fields inherited from class org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob

      `CREATE_DIR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Job(JobConf conf)`
    `Job(JobConf jobConf, ArrayList<?> dependingJobs)` Construct a job.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addDependingJob(Job dependingJob)` Add a job to this jobs' dependency list.
    `JobID` | `getAssignedJobID()`
    `ArrayList<Job>` | `getDependingJobs()`
    `JobClient` | `getJobClient()`
    `JobConf` | `getJobConf()`
    `String` | `getMapredJobID()`
    `int` | `getState()`
    `void` | `setAssignedJobID(JobID mapredJobID)` Deprecated. setAssignedJobID should not be called. JOBID is set by the framework.
    `void` | `setJobConf(JobConf jobConf)` Set the mapred job conf for this job.
    `void` | `setMapredJobID(String mapredJobID)` Deprecated.
    `protected void` | `setState(int state)` Deprecated.

    - ### Methods inherited from class org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob

      `addDependingJob, failJob, getDependentJobs, getJob, getJobID, getJobName, getJobState, getMapredJobId, getMessage, isCompleted, isReady, killJob, setJob, setJobID, setJobName, setJobState, setMessage, submit, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### SUCCESS

          public static final int SUCCESS

      See Also:
        Constant Field Values

    - #### WAITING

          public static final int WAITING

      See Also:
        Constant Field Values

    - #### RUNNING

          public static final int RUNNING

      See Also:
        Constant Field Values

    - #### READY

          public static final int READY

      See Also:
        Constant Field Values

    - #### FAILED

          public static final int FAILED

      See Also:
        Constant Field Values

    - #### DEPENDENT_FAILED

          public static final int DEPENDENT_FAILED

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Job

          public Job(JobConf jobConf,
                     ArrayList<?> dependingJobs)
              throws IOException

      Construct a job.
      Parameters:
        `jobConf` - a mapred job configuration representing a job to be executed.
        `dependingJobs` - an array of jobs the current job depends on
      Throws:
        `IOException`

    - #### Job

          public Job(JobConf conf)
              throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### getAssignedJobID

          public JobID getAssignedJobID()

      Returns:
        the mapred ID of this job as assigned by the mapred framework.

    - #### setAssignedJobID

          @Deprecated
          public void setAssignedJobID(JobID mapredJobID)

      Deprecated. setAssignedJobID should not be called. JOBID is set by the framework.

    - #### getJobConf

          public JobConf getJobConf()

      Returns:
        the mapred job conf of this job

    - #### setJobConf

          public void setJobConf(JobConf jobConf)

      Set the mapred job conf for this job.
      Parameters:
        `jobConf` - the mapred job conf for this job.

    - #### getState

          public int getState()

      Returns:
        the state of this job

    - #### setState

          @Deprecated
          protected void setState(int state)

      Deprecated.
      This is a no-op function, Its a behavior change from 1.x We no more can change the state from job
      Parameters:
        `state` - the new state for this job.

    - #### addDependingJob

          public boolean addDependingJob(Job dependingJob)

      Add a job to this jobs' dependency list. Dependent jobs can only be added while a Job is waiting to run, not during or afterwards.
      Parameters:
        `dependingJob` - Job that this Job depends on.
      Returns:
        `true` if the Job was added.

    - #### getJobClient

          public JobClient getJobClient()

      Returns:
        the job client of this job

    - #### getDependingJobs

          public ArrayList<Job> getDependingJobs()

      Returns:
        the depending jobs of this job

    - #### getMapredJobID

          public String getMapredJobID()

      Returns:
        the mapred ID of this job as assigned by the mapred framework.

    - #### setMapredJobID

          @Deprecated
          public void setMapredJobID(String mapredJobID)

      Deprecated.
      This is no-op method for backward compatibility. It's a behavior change from 1.x, we can not change job ids from job.
      Parameters:
        `mapredJobID` - the mapred job ID for this job.

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.