org.springframework.data.hadoop.mapreduce
Class JobTasklet
java.lang.Object
org.springframework.data.hadoop.mapreduce.JobTasklet
- All Implemented Interfaces:
- Tasklet, InitializingBean
public class JobTasklet
- extends Object
- implements InitializingBean, Tasklet
Batch tasklet for executing one Hadoop job.
Can be configured to not wait for the job to finish - by default the tasklet waits for the job submitted to finish.
- Author:
- Costin Leau
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JobTasklet
public JobTasklet()
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interface InitializingBean
execute
public RepeatStatus execute(StepContribution contribution,
ChunkContext chunkContext)
throws Exception
- Specified by:
execute
in interface Tasklet
- Throws:
Exception
setJob
public void setJob(Job job)
- Sets the job to execute.
- Parameters:
job
- The job to execute.
setWaitForJob
public void setWaitForJob(boolean waitForJob)
- Indicates whether the tasklet should return for the job to complete (default)
after submission or not.
- Parameters:
waitForJob
- whether to wait for the job to complete or not.