org.springframework.data.hadoop.pig
Class PigServerFactoryBean

java.lang.Object
  extended by org.springframework.data.hadoop.pig.PigServerFactoryBean
All Implemented Interfaces:
BeanNameAware, FactoryBean<PigServer>

public class PigServerFactoryBean
extends Object
implements FactoryBean<PigServer>, BeanNameAware

Factory for creating a PigServer instance. Note that since PigServer is not thread-safe, this factory will create a new instance for every getObject() invocation. The caller needs to handle the object clean-up, specifically calling PigServer.shutdown().

Author:
Costin Leau

Constructor Summary
PigServerFactoryBean()
           
 
Method Summary
protected  PigServer createPigInstance()
           
 PigServer getObject()
           
 Class<?> getObjectType()
           
 boolean isSingleton()
           
 void setBeanName(String name)
           
 void setJobName(String jobName)
          Sets the job name.
 void setJobPriority(String jobPriority)
          Sets the job priority.
 void setParallelism(Integer parallelism)
          Sets the parallelism.
 void setPathsToSkip(Collection<String> pathToSkip)
          Sets the paths to skip.
 void setPigContext(PigContext pigContext)
          Sets the PigContext to use.
 void setScripts(Collection<PigScript> scripts)
          Sets the scripts to execute at startup.
 void setValidateEachStatement(Boolean validateEachStatement)
          Indicates whether each statement should be validated or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PigServerFactoryBean

public PigServerFactoryBean()
Method Detail

getObject

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

getObjectType

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

isSingleton

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

createPigInstance

protected PigServer createPigInstance()
                               throws IOException
Throws:
IOException

setBeanName

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

setPigContext

public void setPigContext(PigContext pigContext)
Sets the PigContext to use.

Parameters:
pigContext - The pigContext to set.

setPathsToSkip

public void setPathsToSkip(Collection<String> pathToSkip)
Sets the paths to skip.

Parameters:
pathToSkip - The pathToSkip to set.

setScripts

public void setScripts(Collection<PigScript> scripts)
Sets the scripts to execute at startup.

Parameters:
scripts - The scripts to set.

setParallelism

public void setParallelism(Integer parallelism)
Sets the parallelism.

Parameters:
parallelism - The parallelism to set.

setJobName

public void setJobName(String jobName)
Sets the job name.

Parameters:
jobName - The jobName to set.

setJobPriority

public void setJobPriority(String jobPriority)
Sets the job priority.

Parameters:
jobPriority - The jobPriority to set.

setValidateEachStatement

public void setValidateEachStatement(Boolean validateEachStatement)
Indicates whether each statement should be validated or not.

Parameters:
validateEachStatement - whether to validate each statement or not.