@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,
java.util.Properties properties) |
ToolsPigServer(PigContext ctx) |
ToolsPigServer(java.lang.String execTypeString) |
Modifier and Type | Method and Description |
---|---|
ToolsPigServer.PigPlans |
getPlans()
Get a class containing the Pig plans.
|
void |
registerNoRun(java.lang.String fileName,
java.util.Map<java.lang.String,java.lang.String> params,
java.util.List<java.lang.String> paramFiles)
Register a script without running it.
|
java.util.List<ExecJob> |
runPlan(LogicalPlan newPlan,
java.lang.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, getJobs, getLastRel, getLogicalPlanData, getPigContext, isBatchEmpty, isBatchOn, 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(java.lang.String execTypeString) throws ExecException, java.io.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 PigServerjava.io.IOException
- if throws by PigServerpublic ToolsPigServer(PigContext ctx) throws ExecException, java.io.IOException
ctx
- the context to use to construct the PigServerExecException
- if throws by PigServerjava.io.IOException
- if throws by PigServerpublic ToolsPigServer(ExecType execType, java.util.Properties properties) throws ExecException
execType
- execution type to start the engine in.properties
- to use for this runExecException
- if throws by PigServerpublic void registerNoRun(java.lang.String fileName, java.util.Map<java.lang.String,java.lang.String> params, java.util.List<java.lang.String> paramFiles) throws java.io.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 settingjava.io.IOException
- if it encounters problems reading the scriptFrontendException
- if it encounters problems parsing the scriptpublic ToolsPigServer.PigPlans getPlans()
public java.util.List<ExecJob> runPlan(LogicalPlan newPlan, java.lang.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-2012 The Apache Software Foundation