|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.data.hadoop.pig.PigTemplate
public class PigTemplate
Helper class that simplifies Pig data access code. Automatically handles the creation of a PigServer (which is non-thread-safe) and converts Pig exceptions into DataAccessExceptions.
| Constructor Summary | |
|---|---|
PigTemplate()
Constructs a new PigTemplate instance. |
|
PigTemplate(PigServerFactory pigFactory)
Constructs a new PigTemplate instance. |
|
| Method Summary | ||
|---|---|---|
void |
afterPropertiesSet()
|
|
protected DataAccessException |
convertPigAccessException(ExecException ex)
Converts the given Pig exception to an appropriate exception from the org.springframework.dao hierarchy. |
|
protected DataAccessException |
convertPigAccessException(IOException ex)
Converts the given Pig exception to an appropriate exception from the org.springframework.dao hierarchy. |
|
protected PigServer |
createPigServer()
|
|
|
execute(PigCallback<T> action)
Executes the action specified by the given callback object within an active PigServer. |
|
List<ExecJob> |
executeScript(Iterable<PigScript> scripts)
Executes multiple scripts that result in a list of job executions. |
|
List<ExecJob> |
executeScript(PigScript script)
Executes the given script identified by location and arguments that results in a list of job executions. |
|
List<ExecJob> |
executeScript(String script)
Executes the given Pig Latin that results in a list of job executions. |
|
List<ExecJob> |
executeScript(String script,
Map<?,?> arguments)
Executes the given Pig Latin with arguments that results in a list of job executions. |
|
void |
setPigFactory(PigServerFactory pigServerFactory)
Sets the PigServer factory. |
|
void |
setResourceLoader(ResourceLoader resourceLoader)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PigTemplate()
PigTemplate instance.
Expects setPigFactory(PigServerFactory) to be called before using it.
public PigTemplate(PigServerFactory pigFactory)
PigTemplate instance.
pigFactory - pig factory| Method Detail |
|---|
public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBean
public <T> T execute(PigCallback<T> action)
throws DataAccessException
PigServer.
execute in interface PigOperationsT - action typeaction - callback object that specifies the Hive action
DataAccessException - exceptionprotected DataAccessException convertPigAccessException(IOException ex)
ex - Pig exception
protected DataAccessException convertPigAccessException(ExecException ex)
ex - Pig exception
public List<ExecJob> executeScript(String script)
throws DataAccessException
executeScript in interface PigOperationsscript - script URL or pig latin statement
DataAccessException - exception
public List<ExecJob> executeScript(String script,
Map<?,?> arguments)
throws DataAccessException
executeScript in interface PigOperationsscript - script URL or pig latin statementarguments - script arguments
DataAccessException - exception
public List<ExecJob> executeScript(PigScript script)
throws DataAccessException
executeScript in interface PigOperationsscript - script location and arguments
DataAccessException - exception
public List<ExecJob> executeScript(Iterable<PigScript> scripts)
throws DataAccessException
executeScript in interface PigOperationsscripts - scripts location and arguments
DataAccessException - exceptionprotected PigServer createPigServer()
public void setPigFactory(PigServerFactory pigServerFactory)
PigServer factory.
pigServerFactory - pig server factorypublic void setResourceLoader(ResourceLoader resourceLoader)
setResourceLoader in interface ResourceLoaderAware
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||