org.springframework.data.hadoop.pig
Class PigRunner

java.lang.Object
  extended by org.springframework.data.hadoop.pig.PigRunner
All Implemented Interfaces:
Callable<List<ExecJob>>, InitializingBean

public class PigRunner
extends Object
implements Callable<List<ExecJob>>

Basic runner of Pig scripts inside a Spring environment. For more advanced functionality, consider using Spring Batch and the PigTasklet.

To make the runner execute at startup, use setRunAtStartup(boolean).

Author:
Costin Leau

Constructor Summary
PigRunner()
           
 
Method Summary
 void afterPropertiesSet()
           
 List<ExecJob> call()
           
protected  List<ExecJob> executePigScripts()
           
 void setPigFactory(PigServerFactory pigFactory)
          Sets the pig server instance used by this class.
 void setPigTemplate(PigOperations pigTemplate)
          Sets the pig template used by this class.
 void setPostAction(Collection<Callable<?>> actions)
          Actions to be invoked after running the action.
 void setPreAction(Collection<Callable<?>> actions)
          Actions to be invoked before running the action.
 void setRunAtStartup(boolean runAtStartup)
          Indicates whether the scripts should run at container startup or not (the default).
 void setScripts(Collection<PigScript> scripts)
          Sets the pig scripts to be executed by this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PigRunner

public PigRunner()
Method Detail

afterPropertiesSet

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

call

public List<ExecJob> call()
                   throws Exception
Specified by:
call in interface Callable<List<ExecJob>>
Throws:
Exception

setRunAtStartup

public void setRunAtStartup(boolean runAtStartup)
Indicates whether the scripts should run at container startup or not (the default).

Parameters:
runAtStartup - The runAtStartup to set.

setPreAction

public void setPreAction(Collection<Callable<?>> actions)
Actions to be invoked before running the action.

Parameters:
actions -

setPostAction

public void setPostAction(Collection<Callable<?>> actions)
Actions to be invoked after running the action.

Parameters:
actions -

executePigScripts

protected List<ExecJob> executePigScripts()

setScripts

public void setScripts(Collection<PigScript> scripts)
Sets the pig scripts to be executed by this class.

Parameters:
scripts - The scripts to set.

setPigFactory

public void setPigFactory(PigServerFactory pigFactory)
Sets the pig server instance used by this class.

Parameters:
pigFactory - The pigFactory to set.

setPigTemplate

public void setPigTemplate(PigOperations pigTemplate)
Sets the pig template used by this class.

Parameters:
pigTemplate -