|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.PigContext
public class PigContext
Field Summary | |
---|---|
boolean |
debug
|
List<URL> |
extraJars
|
static String |
JOB_NAME
|
static String |
JOB_NAME_PREFIX
|
Vector<String> |
skipJars
|
Constructor Summary | |
---|---|
PigContext()
|
|
PigContext(PigServer.ExecType execType,
Properties properties)
|
Method Summary | |
---|---|
void |
addJar(String path)
|
void |
addJar(URL resource)
|
void |
addPathToSkip(String path)
Add a path to be skipped while automatically shipping binaries for streaming. |
void |
connect()
|
void |
copy(String src,
String dst,
boolean localDst)
|
ClassLoader |
createCl(String jarFile)
Creates a Classloader based on the passed jarFile and any extra jar files. |
ExecutableManager |
createExecutableManager()
Create a new ExecutableManager depending on the ExecType. |
Class |
getClassForAlias(String alias)
|
static String |
getClassNameFromSpec(String funcSpec)
|
StreamingCommand |
getCommandForAlias(String alias)
Get the StreamingCommand for the given alias. |
Properties |
getConf()
Deprecated. use getProperties() instead |
DataStorage |
getDfs()
|
PigServer.ExecType |
getExecType()
Returns the type of execution currently in effect. |
ExecutionEngine |
getExecutionEngine()
|
org.apache.hadoop.mapred.JobConf |
getJobConf()
Get the JobConf of the current Map-Reduce job. |
String |
getJobOutputFile()
Get the output file for the current Pig Script. |
DataStorage |
getLfs()
|
List<String> |
getPathsToSkip()
Get paths which are to skipped while automatically shipping binaries for streaming. |
Properties |
getProperties()
Provides configuration information. |
Object |
instantiateFuncFromAlias(String alias)
|
static Object |
instantiateFuncFromSpec(String funcSpec)
|
void |
registerFunction(String function,
String functionSpec)
Defines an alias for the given function spec. |
void |
registerStreamCmd(String alias,
StreamingCommand command)
Defines an alias for the given streaming command. |
void |
rename(String oldName,
String newName)
|
static Class |
resolveClassName(String name)
|
void |
setExecType(PigServer.ExecType execType)
|
void |
setJobConf(org.apache.hadoop.mapred.JobConf jobConf)
Set the JobConf of the current Map-Reduce job. |
void |
setJobOutputFile(String jobOutputFile)
Set the output file for the current Pig Script. |
void |
setJobtrackerLocation(String newLocation)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String JOB_NAME
public static final String JOB_NAME_PREFIX
public transient List<URL> extraJars
public transient Vector<String> skipJars
public boolean debug
Constructor Detail |
---|
public PigContext()
public PigContext(PigServer.ExecType execType, Properties properties)
Method Detail |
---|
public void connect() throws ExecException
ExecException
public void setJobtrackerLocation(String newLocation)
public void addJar(String path) throws MalformedURLException
MalformedURLException
public void addJar(URL resource) throws MalformedURLException
MalformedURLException
public void rename(String oldName, String newName) throws IOException
IOException
public void copy(String src, String dst, boolean localDst) throws IOException
IOException
public ExecutionEngine getExecutionEngine()
public DataStorage getDfs()
public DataStorage getLfs()
public Properties getProperties()
public Properties getConf()
getProperties()
instead
public void registerFunction(String function, String functionSpec)
aliases
- - the new function alias to define.functionSpec
- - the name of the function and any arguments.
It should have the form: classname('arg1', 'arg2', ...)public void registerStreamCmd(String alias, StreamingCommand command)
alias
- - the new command alias to define.command
- - the commandpublic PigServer.ExecType getExecType()
public ClassLoader createCl(String jarFile) throws MalformedURLException
jarFile
- the jar file to be part of the newly created Classloader. This jar file plus any
jars in the extraJars list will constitute the classpath.
MalformedURLException
public static String getClassNameFromSpec(String funcSpec)
public static Class resolveClassName(String name) throws IOException
IOException
public static Object instantiateFuncFromSpec(String funcSpec)
public Class getClassForAlias(String alias) throws IOException
IOException
public Object instantiateFuncFromAlias(String alias) throws IOException
instantiateFuncFromAlias
in interface FunctionInstantiator
IOException
public StreamingCommand getCommandForAlias(String alias)
StreamingCommand
for the given alias.
alias
- the alias for the StreamingCommand
StreamingCommand
for the aliaspublic void setExecType(PigServer.ExecType execType)
public ExecutableManager createExecutableManager() throws ExecException
ExecutableManager
depending on the ExecType.
ExecutableManager
depending on the ExecType
ExecException
public String getJobOutputFile()
public void setJobOutputFile(String jobOutputFile)
jobOutputFile
- the output file for the current Pig Scriptpublic org.apache.hadoop.mapred.JobConf getJobConf()
JobConf
of the current Map-Reduce job.
JobConf
of the current Map-Reduce jobpublic void setJobConf(org.apache.hadoop.mapred.JobConf jobConf)
JobConf
of the current Map-Reduce job.
jobConf
- the JobConf
of the current Map-Reduce jobpublic void addPathToSkip(String path)
path
- path to be skippedpublic List<String> getPathsToSkip()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |