public class PigTemplate extends java.lang.Object implements org.springframework.beans.factory.InitializingBean, PigOperations, org.springframework.context.ResourceLoaderAware
| Constructor and Description | 
|---|
| PigTemplate()Constructs a new  PigTemplateinstance. | 
| PigTemplate(PigServerFactory pigFactory)Constructs a new  PigTemplateinstance. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | afterPropertiesSet() | 
| protected org.springframework.dao.DataAccessException | convertPigAccessException(org.apache.pig.backend.executionengine.ExecException ex)Converts the given Pig exception to an appropriate exception from the org.springframework.dao hierarchy. | 
| protected org.springframework.dao.DataAccessException | convertPigAccessException(java.io.IOException ex)Converts the given Pig exception to an appropriate exception from the org.springframework.dao hierarchy. | 
| protected org.apache.pig.PigServer | createPigServer() | 
| <T> T | execute(PigCallback<T> action)Executes the action specified by the given callback object within an active  PigServer. | 
| java.util.List<org.apache.pig.backend.executionengine.ExecJob> | executeScript(java.lang.Iterable<PigScript> scripts)Executes multiple scripts that result in a list of job executions. | 
| java.util.List<org.apache.pig.backend.executionengine.ExecJob> | executeScript(PigScript script)Executes the given script identified by location and arguments that results in a list of job executions. | 
| java.util.List<org.apache.pig.backend.executionengine.ExecJob> | executeScript(java.lang.String script)Executes the given Pig Latin that results in a list of job executions. | 
| java.util.List<org.apache.pig.backend.executionengine.ExecJob> | executeScript(java.lang.String script,
             java.util.Map<?,?> arguments)Executes the given Pig Latin with arguments that results in a list of job executions. | 
| void | setPigFactory(PigServerFactory pigServerFactory)Sets the  PigServerfactory. | 
| void | setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) | 
public PigTemplate()
PigTemplate instance.
 Expects setPigFactory(PigServerFactory) to be called before using it.public PigTemplate(PigServerFactory pigFactory)
PigTemplate instance.pigFactory - pig factorypublic void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic <T> T execute(PigCallback<T> action) throws org.springframework.dao.DataAccessException
PigServer.execute in interface PigOperationsT - action typeaction - callback object that specifies the Hive actionorg.springframework.dao.DataAccessException - exceptionprotected org.springframework.dao.DataAccessException convertPigAccessException(java.io.IOException ex)
ex - Pig exceptionprotected org.springframework.dao.DataAccessException convertPigAccessException(org.apache.pig.backend.executionengine.ExecException ex)
ex - Pig exceptionpublic java.util.List<org.apache.pig.backend.executionengine.ExecJob> executeScript(java.lang.String script)
                                                                             throws org.springframework.dao.DataAccessException
executeScript in interface PigOperationsscript - script URL or pig latin statementorg.springframework.dao.DataAccessException - exceptionpublic java.util.List<org.apache.pig.backend.executionengine.ExecJob> executeScript(java.lang.String script,
                                                                           java.util.Map<?,?> arguments)
                                                                             throws org.springframework.dao.DataAccessException
executeScript in interface PigOperationsscript - script URL or pig latin statementarguments - script argumentsorg.springframework.dao.DataAccessException - exceptionpublic java.util.List<org.apache.pig.backend.executionengine.ExecJob> executeScript(PigScript script) throws org.springframework.dao.DataAccessException
executeScript in interface PigOperationsscript - script location and argumentsorg.springframework.dao.DataAccessException - exceptionpublic java.util.List<org.apache.pig.backend.executionengine.ExecJob> executeScript(java.lang.Iterable<PigScript> scripts) throws org.springframework.dao.DataAccessException
executeScript in interface PigOperationsscripts - scripts location and argumentsorg.springframework.dao.DataAccessException - exceptionprotected org.apache.pig.PigServer createPigServer()
public void setPigFactory(PigServerFactory pigServerFactory)
PigServer factory.pigServerFactory - pig server factorypublic void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader in interface org.springframework.context.ResourceLoaderAware