org.springframework.data.hadoop.mapreduce
Class ToolRunner

java.lang.Object
  extended by org.springframework.data.hadoop.mapreduce.ToolRunner
All Implemented Interfaces:
FactoryBean<Integer>, InitializingBean

public class ToolRunner
extends Object
implements FactoryBean<Integer>, InitializingBean

Wrapper around ToolRunner allowing for an easier configuration and execution of Tool instances inside Spring. Optionally returns the execution result (as an int per Tool.run(String[])).

Author:
Costin Leau

Constructor Summary
ToolRunner()
           
 
Method Summary
 void afterPropertiesSet()
           
 Integer getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setArguments(String[] arguments)
          Sets the arguments.
 void setConfiguration(Configuration configuration)
          Sets the configuration.
 void setProperties(Properties properties)
          Sets the properties.
 void setRunAtStartup(boolean runAtStartup)
          Sets the run at startup.
 void setTool(Tool tool)
          Sets the tool.
 void setToolClass(Class<? extends Tool> toolClass)
          Sets the tool class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolRunner

public ToolRunner()
Method Detail

getObject

public Integer getObject()
                  throws Exception
Specified by:
getObject in interface FactoryBean<Integer>
Throws:
Exception

getObjectType

public Class<?> getObjectType()
Specified by:
getObjectType in interface FactoryBean<Integer>

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean<Integer>

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

setTool

public void setTool(Tool tool)
Sets the tool.

Parameters:
tool - The tool to set.

setToolClass

public void setToolClass(Class<? extends Tool> toolClass)
Sets the tool class.

Parameters:
toolClass - the new tool class

setArguments

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

Parameters:
arguments - The arguments to set.

setRunAtStartup

public void setRunAtStartup(boolean runAtStartup)
Sets the run at startup.

Parameters:
runAtStartup - The runAtStartup 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.