org.springframework.data.hadoop.mapreduce
Class StreamJobFactoryBean

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

public class StreamJobFactoryBean
extends Object
implements InitializingBean, FactoryBean<Job>, BeanNameAware

Factory bean focused on creating streaming jobs. As opposed to JobFactoryBean which is Java-specific, this factory is suitable for streaming scenarios (such as invoking Ruby/Python scripts or command-line scripts).

Author:
Costin Leau

Constructor Summary
StreamJobFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 Job getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setArchives(Resource... archives)
          Sets the archives to be unarchive to the map reduce cluster.
 void setBeanName(String name)
           
 void setCmdEnv(Properties cmdEnv)
          Sets the environment for the commands to be executed.
 void setCombiner(String combiner)
          Sets the job combiner.
 void setConfiguration(Configuration configuration)
          Sets the Hadoop configuration to use.
 void setFiles(Resource... files)
          Sets the files to be copied to the map reduce cluster.
 void setInputFormat(String inputFormat)
          Sets the job input format.
 void setInputPath(String... input)
          Sets the job input paths.
 void setLibs(Resource... libJars)
          Sets the jar files to include in the classpath.
 void setMapper(String mapper)
          Sets the job mapper.
 void setNumberReducers(Integer numReduceTasks)
          Sets the job number of reducer tasks.
 void setOutputFormat(String outputFormat)
          Sets the job output format.
 void setOutputPath(String output)
          Sets the job output paths.
 void setPartitioner(String partitioner)
          Sets the job partitioner.
 void setProperties(Properties properties)
          Sets the configuration properties to use.
 void setReducer(String reducer)
          Sets the job reducer.
 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

StreamJobFactoryBean

public StreamJobFactoryBean()
Method Detail

setBeanName

public void setBeanName(String name)
Specified by:
setBeanName in interface BeanNameAware

getObject

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

getObjectType

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

isSingleton

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

afterPropertiesSet

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

setInputPath

public void setInputPath(String... input)
Sets the job input paths.

Parameters:
input - The input to set.

setOutputPath

public void setOutputPath(String output)
Sets the job output paths.

Parameters:
output - The output to set.

setMapper

public void setMapper(String mapper)
Sets the job mapper.

Parameters:
mapper - The mapper to set.

setReducer

public void setReducer(String reducer)
Sets the job reducer.

Parameters:
reducer - The reducer to set.

setCombiner

public void setCombiner(String combiner)
Sets the job combiner.

Parameters:
combiner - The combiner to set.

setInputFormat

public void setInputFormat(String inputFormat)
Sets the job input format.

Parameters:
inputFormat - The inputFormat to set.

setOutputFormat

public void setOutputFormat(String outputFormat)
Sets the job output format.

Parameters:
outputFormat - The outputFormat to set.

setPartitioner

public void setPartitioner(String partitioner)
Sets the job partitioner.

Parameters:
partitioner - The partitioner to set.

setConfiguration

public void setConfiguration(Configuration configuration)
Sets the Hadoop configuration to use.

Parameters:
configuration - The configuration to set.

setCmdEnv

public void setCmdEnv(Properties cmdEnv)
Sets the environment for the commands to be executed.

Parameters:
cmdEnv - The environment command/property to set.

setNumberReducers

public void setNumberReducers(Integer numReduceTasks)
Sets the job number of reducer tasks.

Parameters:
numReduceTasks - The numReduceTasks to set.

setProperties

public void setProperties(Properties properties)
Sets the configuration properties to use.

Parameters:
properties - The properties to set.

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