public abstract class ToolExecutor
extends java.lang.Object
Tool.| Constructor and Description |
|---|
ToolExecutor() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected java.lang.ClassLoader |
createClassLoaderForJar(Resource jar,
java.lang.ClassLoader parentCL,
Configuration cfg) |
protected java.lang.Integer |
invokeTargetObject(Configuration cfg,
Tool target,
java.lang.Class<Tool> targetClass,
java.lang.String[] args) |
protected java.lang.Class<Tool> |
loadClass(java.lang.String className,
java.lang.ClassLoader cl) |
protected void |
postExecution(Configuration cfg) |
protected void |
preExecution(Configuration cfg) |
protected Configuration |
resolveConfiguration() |
protected java.lang.Class<T> |
resolveTargetClass(Configuration cfg) |
protected T |
resolveTargetObject(java.lang.Class<T> type) |
protected int |
runCode() |
void |
setArchives(Resource... archives)
Sets the archives to be unarchive to the map reduce cluster.
|
void |
setArguments(java.lang.String... arguments)
Sets the arguments.
|
void |
setBeanClassLoader(java.lang.ClassLoader classLoader) |
void |
setCloseFs(boolean closeFs)
Indicates whether or not to close the Hadoop file-systems
resulting from the custom code execution.
|
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)
Sets the target code jar.
|
void |
setLibs(Resource... libJars)
Sets the jar files to include in the classpath.
|
void |
setProperties(java.util.Properties properties)
Sets the properties.
|
void |
setTool(Tool tool)
Sets the tool.
|
void |
setToolClass(java.lang.String toolClassName)
Sets the tool class by name.
|
void |
setUser(java.lang.String user)
Sets the user impersonation (optional) for running this job.
|
protected java.lang.Integer invokeTargetObject(Configuration cfg, Tool target, java.lang.Class<Tool> targetClass, java.lang.String[] args) throws java.lang.Exception
java.lang.Exceptionprotected java.lang.Class<Tool> loadClass(java.lang.String className, java.lang.ClassLoader cl)
public void setTool(Tool tool)
tool - The tool to set.public void setToolClass(java.lang.String toolClassName)
toolClassName - the new tool classpublic void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface InitializingBeanjava.lang.Exceptionprotected int runCode()
throws java.lang.Exception
java.lang.Exceptionprotected Configuration resolveConfiguration() throws java.lang.Exception
java.lang.Exceptionprotected java.lang.Class<T> resolveTargetClass(Configuration cfg) throws java.lang.Exception
java.lang.Exceptionprotected T resolveTargetObject(java.lang.Class<T> type)
protected java.lang.ClassLoader createClassLoaderForJar(Resource jar, java.lang.ClassLoader parentCL, Configuration cfg)
protected void preExecution(Configuration cfg)
protected void postExecution(Configuration cfg)
public void setJar(Resource jar)
jar - target jarpublic void setArguments(java.lang.String... arguments)
arguments - The arguments to set.public void setConfiguration(Configuration configuration)
configuration - The configuration to set.public void setProperties(java.util.Properties properties)
properties - The properties to set.public void setBeanClassLoader(java.lang.ClassLoader classLoader)
setBeanClassLoader in interface BeanClassLoaderAwarepublic void setCloseFs(boolean closeFs)
closeFs - the new close fspublic void setLibs(Resource... libJars)
mydir/*.jar), which the
Spring container will automatically resolve.libJars - The jar files to include in the classpath.public void setFiles(Resource... files)
mydir/*.txt), which the
Spring container will automatically resolve.files - The files to copy.public void setArchives(Resource... archives)
mydir/*.zip), which the
Spring container will automatically resolve.archives - The archives to unarchive on the compute machines.public void setUser(java.lang.String user)
user - user/group information