|
|||||||||
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.CrunchJobControl
public class CrunchJobControl
This class encapsulates a set of MapReduce jobs and its dependency. It tracks the states of the jobs by placing them into different tables according to their states. This class provides APIs for the client app to add a job to the group and to get the jobs in the group in different states. When a job is added, an ID unique to the group is assigned to the job. This class has a thread that submits jobs when they become ready, monitors the states of the running jobs, and updates the states of jobs based on the state changes of their depending jobs states. The class provides APIs for suspending/resuming the thread, and for stopping the thread. TODO This is mostly a copy of the JobControl class in Hadoop MapReduce core. Once the location and interface of the class are more stable in CDH, this class should be removed completely and be based on the hadoop-core class.
Nested Class Summary | |
---|---|
static class |
CrunchJobControl.ThreadState
|
Constructor Summary | |
---|---|
CrunchJobControl(String groupName)
Construct a job control for a group of jobs. |
Method Summary | |
---|---|
String |
addJob(CrunchControlledJob aJob)
Add a new job. |
void |
addJobCollection(Collection<CrunchControlledJob> jobs)
Add a collection of jobs |
boolean |
allFinished()
|
List<CrunchControlledJob> |
getFailedJobList()
|
List<CrunchControlledJob> |
getReadyJobsList()
|
List<CrunchControlledJob> |
getRunningJobList()
|
List<CrunchControlledJob> |
getSuccessfulJobList()
|
CrunchJobControl.ThreadState |
getThreadState()
|
List<CrunchControlledJob> |
getWaitingJobList()
|
void |
resume()
resume the suspended thread |
void |
run()
The main loop for the thread. |
void |
stop()
set the thread state to STOPPING so that the thread will stop when it wakes up. |
void |
suspend()
suspend the running thread |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CrunchJobControl(String groupName)
groupName
- a name identifying this groupMethod Detail |
---|
public List<CrunchControlledJob> getWaitingJobList()
public List<CrunchControlledJob> getRunningJobList()
public List<CrunchControlledJob> getReadyJobsList()
public List<CrunchControlledJob> getSuccessfulJobList()
public List<CrunchControlledJob> getFailedJobList()
public String addJob(CrunchControlledJob aJob)
aJob
- the new jobpublic void addJobCollection(Collection<CrunchControlledJob> jobs)
jobs
- public CrunchJobControl.ThreadState getThreadState()
public void stop()
public void suspend()
public void resume()
public boolean allFinished()
public void run()
run
in interface Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |