|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.data.hadoop.mapreduce.JobRunner
public class JobRunner
Simple runner for submitting Hadoop jobs sequentially. By default, the runner waits for the jobs to finish and returns a boolean indicating whether all the jobs succeeded or not (when there's no waiting, the status cannot be determined and null is returned).
For more control over the job execution and outcome consider querying theJob
s or using Spring Batch (see the reference documentation for more info).
To make the runner execute at startup, use setRunAtStartup(boolean)
.
Constructor Summary | |
---|---|
JobRunner()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
Void |
call()
|
protected void |
executeJobs()
|
void |
setBeanFactory(BeanFactory beanFactory)
|
void |
setJob(Job job)
Sets the job to execute. |
void |
setJobNames(String... jobName)
Sets the jobs to execute by (bean) name. |
void |
setJobs(Collection<Job> jobs)
Sets the jobs to execute. |
void |
setPostAction(Collection<Callable<?>> actions)
Actions to be invoked after running the action. |
void |
setPreAction(Collection<Callable<?>> actions)
Actions to be invoked before running the action. |
void |
setRunAtStartup(boolean runAtStartup)
Indicates whether the jobs should be submitted at startup (default) or not. |
void |
setVerbose(boolean verbose)
Indicates whether the job execution is verbose (the default) or not. |
void |
setWaitForJob(boolean waitForJob)
Indicates whether the tasklet should return for the job to complete (default) after submission or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JobRunner()
Method Detail |
---|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public Void call() throws Exception
call
in interface Callable<Void>
Exception
public void setRunAtStartup(boolean runAtStartup)
runAtStartup
- The runAtStartup to set.public void setPreAction(Collection<Callable<?>> actions)
actions
- public void setPostAction(Collection<Callable<?>> actions)
actions
- protected void executeJobs() throws Exception
Exception
public void setJob(Job job)
job
- The job to execute.public void setJobs(Collection<Job> jobs)
jobs
- The job to execute.public void setJobNames(String... jobName)
jobName
- The job to execute.public void setWaitForJob(boolean waitForJob)
waitForJob
- whether to wait for the job to complete or not.public void setVerbose(boolean verbose)
verbose
- whether the job execution is verbose or not.public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |