|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.mapred.jobcontrol.Job
public class Job
This class encapsulates a MapReduce job and its dependency. It monitors the states of the depending jobs and updates the state of this job. A job starts in the WAITING state. If it does not have any depending jobs, or all of the depending jobs are in SUCCESS state, then the job state will become READY. If any depending jobs fail, the job will fail too. When in READY state, the job can be submitted to Hadoop for execution, with the state changing into RUNNING state. From RUNNING state, the job can get into SUCCESS or FAILED state, depending the status of the job execution.
Field Summary | |
---|---|
static int |
DEPENDENT_FAILED
|
static int |
FAILED
|
static int |
READY
|
static int |
RUNNING
|
static int |
SUCCESS
|
static int |
WAITING
|
Constructor Summary | |
---|---|
Job(JobConf jobConf)
Construct a job. |
|
Job(JobConf jobConf,
ArrayList<Job> dependingJobs)
Construct a job. |
Method Summary | |
---|---|
boolean |
addDependingJob(Job dependingJob)
Add a job to this jobs' dependency list. |
JobID |
getAssignedJobID()
|
ArrayList<Job> |
getDependingJobs()
|
JobClient |
getJobClient()
|
JobConf |
getJobConf()
|
String |
getJobID()
|
String |
getJobName()
|
String |
getMapredJobID()
Deprecated. use getAssignedJobID() instead |
String |
getMessage()
|
int |
getState()
|
boolean |
isCompleted()
|
boolean |
isReady()
|
void |
setAssignedJobID(JobID mapredJobID)
Set the mapred ID for this job as assigned by the mapred framework. |
void |
setJobConf(JobConf jobConf)
Set the mapred job conf for this job. |
void |
setJobID(String id)
Set the job ID for this job. |
void |
setJobName(String jobName)
Set the job name for this job. |
void |
setMapredJobID(String mapredJobID)
Deprecated. use setAssignedJobID(JobID) instead |
void |
setMessage(String message)
Set the message for this job. |
protected void |
setState(int state)
Set the state for this job. |
protected void |
submit()
Submit this job to mapred. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SUCCESS
public static final int WAITING
public static final int RUNNING
public static final int READY
public static final int FAILED
public static final int DEPENDENT_FAILED
Constructor Detail |
---|
public Job(JobConf jobConf, ArrayList<Job> dependingJobs) throws IOException
jobConf
- a mapred job configuration representing a job to be executed.dependingJobs
- an array of jobs the current job depends on
IOException
public Job(JobConf jobConf) throws IOException
jobConf
- mapred job configuration representing a job to be executed.
IOException
Method Detail |
---|
public String toString()
toString
in class Object
public String getJobName()
public void setJobName(String jobName)
jobName
- the job namepublic String getJobID()
public void setJobID(String id)
id
- the job ID@Deprecated public String getMapredJobID()
getAssignedJobID()
instead
@Deprecated public void setMapredJobID(String mapredJobID)
setAssignedJobID(JobID)
instead
mapredJobID
- the mapred job ID for this job.public JobID getAssignedJobID()
public void setAssignedJobID(JobID mapredJobID)
mapredJobID
- the mapred job ID for this job.public JobConf getJobConf()
public void setJobConf(JobConf jobConf)
jobConf
- the mapred job conf for this job.public int getState()
protected void setState(int state)
state
- the new state for this job.public String getMessage()
public void setMessage(String message)
message
- the message for this job.public JobClient getJobClient()
public ArrayList<Job> getDependingJobs()
public boolean addDependingJob(Job dependingJob)
dependingJob
- Job that this Job depends on.
public boolean isCompleted()
public boolean isReady()
protected void submit()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |