@InterfaceAudience.LimitedPrivate(value="Penny") @InterfaceStability.Unstable public class ToolsPigServer extends PigServer
Modifier and Type | Class and Description |
---|---|
static class |
ToolsPigServer.PigPlans |
PigServer.Graph
graphs, log, pigContext, PRETTY_PRINT_SCHEMA_PROPERTY, scope
Constructor and Description |
---|
ToolsPigServer(ExecType execType,
Properties properties) |
ToolsPigServer(PigContext ctx) |
ToolsPigServer(String execTypeString) |
Modifier and Type | Method and Description |
---|---|
ToolsPigServer.PigPlans |
getPlans()
Get a class containing the Pig plans.
|
void |
registerNoRun(String fileName,
Map<String,String> params,
List<String> paramFiles)
Register a script without running it.
|
List<ExecJob> |
runPlan(LogicalPlan newPlan,
String jobName)
Given a (modified) new logical plan, run the script.
|
addPathToSkip, capacity, debugOff, debugOn, deleteFile, discardBatch, dumpSchema, dumpSchemaNested, executeBatch, executeBatch, existsFile, explain, explain, fileSize, getAliases, getAliasKeySet, getClonedGraph, getCurrentDAG, getExamples, getJobName, getJobPriority, getJobs, getLastRel, getLogicalPlanData, getPigContext, isBatchEmpty, isBatchOn, isDebugOn, launchPlan, listPaths, mkdirs, openIterator, paramMapToList, parseAndBuild, printAliases, printHistory, registerCode, registerFunction, registerJar, registerQuery, registerQuery, registerScript, registerScript, registerScript, registerScript, registerScript, registerScript, registerScript, registerScript, registerStreamingCommand, renameFile, resetScope, setBatchOn, setDefaultParallel, setJobName, setJobPriority, setSkipParseInRegisterForBatch, setValidateEachStatement, shutdown, store, store
public ToolsPigServer(String execTypeString) throws ExecException, IOException
execTypeString
- can be 'mapreduce' or 'local'. Local mode will
use Hadoop's local job runner to execute the job on the local machine.
Mapreduce mode will connect to a cluster to execute the job.ExecException
- if throws by PigServerIOException
- if throws by PigServerpublic ToolsPigServer(PigContext ctx) throws ExecException, IOException
ctx
- the context to use to construct the PigServerExecException
- if throws by PigServerIOException
- if throws by PigServerpublic ToolsPigServer(ExecType execType, Properties properties) throws ExecException
execType
- execution type to start the engine in.properties
- to use for this runExecException
- if throws by PigServerpublic void registerNoRun(String fileName, Map<String,String> params, List<String> paramFiles) throws IOException, FrontendException
PigServer.registerQuery(String)
, PigServer.registerScript(String)
,
PigServer.store(String, String)
or PigServer.openIterator(String)
. It can be
used with getPlans()
and runPlan(LogicalPlan, String)
in this class
only. The proper control flow is for the caller to call registerNoRun() and then
getPlans() to get a copy of the plans. The user can then modify the
logical plan. It can then be returned via runPlan(), which will execute
the plan.fileName
- File containing Pig Latin script to register.params
- the key is the parameter name, and the value is the parameter valueparamFiles
- files which have the parameter settingIOException
- if it encounters problems reading the scriptFrontendException
- if it encounters problems parsing the scriptpublic ToolsPigServer.PigPlans getPlans()
public List<ExecJob> runPlan(LogicalPlan newPlan, String jobName) throws FrontendException, ExecException
newPlan
- plan to runjobName
- name to give the MR jobs associated with this runFrontendException
- if plan translation fails.ExecException
- if running the job fails.Copyright © 2007-2017 The Apache Software Foundation