|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.scripting.ScriptEngine
org.apache.pig.scripting.jython.JythonScriptEngine
public class JythonScriptEngine
Implementation of the script engine for Jython
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.pig.scripting.ScriptEngine |
---|
ScriptEngine.SupportedScriptLang |
Field Summary |
---|
Fields inherited from class org.apache.pig.scripting.ScriptEngine |
---|
NAMESPACE_SEPARATOR |
Constructor Summary | |
---|---|
JythonScriptEngine()
|
Method Summary | |
---|---|
static org.python.core.PyFunction |
getFunction(String path,
String functionName)
Gets the Python function object. |
protected Map<String,Object> |
getParamsFromVariables()
Returns a map from local variable names to their values |
protected String |
getScriptingLang()
Gets ScriptEngine classname or keyword for the scripting language |
void |
load(InputStream script,
String scriptFile,
PigContext pigContext)
execs the script text using the interpreter. |
protected Map<String,List<PigStats>> |
main(PigContext pigContext,
String scriptFile)
Actually runs the script file. |
void |
registerFunctions(String path,
String namespace,
PigContext pigContext)
Registers scripting language functions as Pig functions with given namespace |
Methods inherited from class org.apache.pig.scripting.ScriptEngine |
---|
getInstance, getJarPath, getPigStatsMap, getScriptAsStream, getSupportedScriptLang, run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JythonScriptEngine()
Method Detail |
---|
public void registerFunctions(String path, String namespace, PigContext pigContext) throws IOException
ScriptEngine
registerFunctions
in class ScriptEngine
path
- path of the scriptnamespace
- namespace for the functionspigContext
- pigcontext to register functions to pig in the given namespace
IOException
public static org.python.core.PyFunction getFunction(String path, String functionName) throws IOException
path
- Path of the jython script file containing the function.functionName
- Name of the function
IOException
protected Map<String,List<PigStats>> main(PigContext pigContext, String scriptFile) throws IOException
ScriptEngine
main
in class ScriptEngine
pigContext
- ScriptPigContext
to run the script filescriptFile
- the file
IOException
public void load(InputStream script, String scriptFile, PigContext pigContext) throws IOException
script
- scriptFile
- pigContext
-
IOException
protected String getScriptingLang()
ScriptEngine
getScriptingLang
in class ScriptEngine
protected Map<String,Object> getParamsFromVariables() throws IOException
ScriptEngine
getParamsFromVariables
in class ScriptEngine
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |