org.springframework.data.hadoop.mapreduce
Class ToolTasklet

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

public class ToolTasklet
extends Object
implements Tasklet

Tasklet for executing Hadoop Tools.

Author:
Costin Leau

Constructor Summary
ToolTasklet()
           
 
Method Summary
 RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext)
           
 void setArchives(Resource... archives)
          Sets the archives to be unarchive to the map reduce cluster.
 void setArguments(String... arguments)
          Sets the arguments.
 void setBeanClassLoader(ClassLoader classLoader)
           
 void setConfiguration(Configuration configuration)
          Sets the configuration.
 void setFiles(Resource... files)
          Sets the files to be copied to the map reduce cluster.
 void setJar(Resource jar)
           
 void setLibs(Resource... libJars)
          Sets the jar files to include in the classpath.
 void setProperties(Properties properties)
          Sets the properties.
 void setTool(Tool tool)
          Sets the tool.
 void setToolClass(String toolClassName)
          Sets the tool class by name.
 void setUser(String user)
          Sets the user impersonation (optional) for running this job.
 
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

setTool

public void setTool(Tool tool)
Sets the tool.

Parameters:
tool - The tool to set.

setToolClass

public void setToolClass(String toolClassName)
Sets the tool class by name.

Parameters:
toolClassName - the new tool class

setJar

public void setJar(Resource jar)

setArguments

public void setArguments(String... arguments)
Sets the arguments.

Parameters:
arguments - The arguments to set.

setConfiguration

public void setConfiguration(Configuration configuration)
Sets the configuration.

Parameters:
configuration - The configuration to set.

setProperties

public void setProperties(Properties properties)
Sets the properties.

Parameters:
properties - The properties to set.

setBeanClassLoader

public void setBeanClassLoader(ClassLoader classLoader)
Specified by:
setBeanClassLoader in interface BeanClassLoaderAware

setLibs

public void setLibs(Resource... libJars)
Sets the jar files to include in the classpath. Note that a pattern can be used (e.g. mydir/*.jar), which the Spring container will automatically resolve.

Parameters:
libJars - The jar files to include in the classpath.

setFiles

public void setFiles(Resource... files)
Sets the files to be copied to the map reduce cluster. Note that a pattern can be used (e.g. mydir/*.txt), which the Spring container will automatically resolve.

Parameters:
files - The files to copy.

setArchives

public void setArchives(Resource... archives)
Sets the archives to be unarchive to the map reduce cluster. Note that a pattern can be used (e.g. mydir/*.zip), which the Spring container will automatically resolve.

Parameters:
archives - The archives to unarchive on the compute machines.

setUser

public void setUser(String user)
Sets the user impersonation (optional) for running this job. Should be used when running against a Hadoop Kerberos cluster.

Parameters:
user - user/group information