|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.crunch.hadoop.mapreduce.lib.jobcontrol.CrunchControlledJob
public class CrunchControlledJob
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.
Nested Class Summary | |
---|---|
static class |
CrunchControlledJob.State
|
Field Summary | |
---|---|
static String |
CREATE_DIR
|
Constructor Summary | |
---|---|
CrunchControlledJob(org.apache.hadoop.conf.Configuration conf)
Construct a job. |
|
CrunchControlledJob(org.apache.hadoop.mapreduce.Job job,
List<CrunchControlledJob> dependingJobs)
Construct a job. |
Method Summary | |
---|---|
boolean |
addDependingJob(CrunchControlledJob dependingJob)
Add a job to this jobs' dependency list. |
List<CrunchControlledJob> |
getDependentJobs()
|
org.apache.hadoop.mapreduce.Job |
getJob()
|
String |
getJobID()
|
String |
getJobName()
|
CrunchControlledJob.State |
getJobState()
|
org.apache.hadoop.mapreduce.JobID |
getMapredJobID()
|
String |
getMessage()
|
boolean |
isCompleted()
|
boolean |
isReady()
|
void |
killJob()
|
void |
setJob(org.apache.hadoop.mapreduce.Job job)
Set the mapreduce job |
void |
setJobID(String id)
Set the job ID for this job. |
void |
setJobName(String jobName)
Set the job name for this job. |
void |
setMessage(String message)
Set the message for this job. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CREATE_DIR
Constructor Detail |
---|
public CrunchControlledJob(org.apache.hadoop.mapreduce.Job job, List<CrunchControlledJob> dependingJobs) throws IOException
job
- a mapreduce job to be executed.dependingJobs
- an array of jobs the current job depends on
IOException
public CrunchControlledJob(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- 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 IDpublic org.apache.hadoop.mapreduce.JobID getMapredJobID()
public org.apache.hadoop.mapreduce.Job getJob()
public void setJob(org.apache.hadoop.mapreduce.Job job)
job
- the mapreduce job for this job.public CrunchControlledJob.State getJobState()
public String getMessage()
public void setMessage(String message)
message
- the message for this job.public List<CrunchControlledJob> getDependentJobs()
public boolean addDependingJob(CrunchControlledJob dependingJob)
dependingJob
- Job that this Job depends on.
public boolean isCompleted()
public boolean isReady()
public void killJob() throws IOException, InterruptedException
IOException
InterruptedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |