org.springframework.data.hadoop.mapreduce
Class JobTasklet

java.lang.Object
  extended by 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

Constructor Summary
JobTasklet()
           
 
Method Summary
 void afterPropertiesSet()
           
 RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext)
           
 void setJob(Job job)
          Sets the job to execute.
 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

JobTasklet

public JobTasklet()
Method Detail

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.