org.springframework.data.hadoop.batch.mapreduce
Class ToolTasklet

java.lang.Object
  extended by org.springframework.data.hadoop.mapreduce.ToolExecutor
      extended by org.springframework.data.hadoop.batch.mapreduce.ToolTasklet
All Implemented Interfaces:
Tasklet, Aware, BeanClassLoaderAware, InitializingBean

public class ToolTasklet
extends org.springframework.data.hadoop.mapreduce.ToolExecutor
implements Tasklet, InitializingBean

Tasklet for executing Hadoop Tools.

Author:
Costin Leau

Constructor Summary
ToolTasklet()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  ClassLoader createClassLoaderForJar(Resource arg0, ClassLoader arg1, Configuration arg2)
           
 RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext)
           
protected  void postExecution(Configuration arg0)
           
protected  void preExecution(Configuration arg0)
           
protected  Configuration resolveConfiguration()
           
protected  Class<T> resolveTargetClass(Configuration arg0)
           
protected  T resolveTargetObject(Class<T> arg0)
           
protected  int runCode()
           
 void setSystemProcessExitCodeMapper(SystemProcessExitCodeMapper systemProcessExitCodeMapper)
           
 
Methods inherited from class org.springframework.data.hadoop.mapreduce.ToolExecutor
invokeTargetObject, loadClass, setTool, setToolClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolTasklet

public ToolTasklet()
Method Detail

execute

public RepeatStatus execute(StepContribution contribution,
                            ChunkContext chunkContext)
                     throws Exception
Specified by:
execute in interface Tasklet
Throws:
Exception

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class org.springframework.data.hadoop.mapreduce.ToolExecutor
Throws:
Exception

setSystemProcessExitCodeMapper

public void setSystemProcessExitCodeMapper(SystemProcessExitCodeMapper systemProcessExitCodeMapper)
Parameters:
systemProcessExitCodeMapper - maps system process return value to ExitStatus returned by Tasklet. SimpleSystemProcessExitCodeMapper is used by default.

runCode

protected int runCode()
               throws Exception
Throws:
Exception

resolveConfiguration

protected Configuration resolveConfiguration()
                                      throws Exception
Throws:
Exception

resolveTargetClass

protected Class<T> resolveTargetClass(Configuration arg0)
                               throws Exception
Throws:
Exception

resolveTargetObject

protected T resolveTargetObject(Class<T> arg0)

createClassLoaderForJar

protected ClassLoader createClassLoaderForJar(Resource arg0,
                                              ClassLoader arg1,
                                              Configuration arg2)

preExecution

protected void preExecution(Configuration arg0)

postExecution

protected void postExecution(Configuration arg0)