public class JythonScriptEngine extends ScriptEngine
ScriptEngine.SupportedScriptLang
NAMESPACE_SEPARATOR
Constructor and Description |
---|
JythonScriptEngine() |
Modifier and Type | Method and Description |
---|---|
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
|
getInstance, getJarPath, getPigStatsMap, getScriptAsStream, getSupportedScriptLang, run
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 namespaceIOException
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 functionIOException
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 fileIOException
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
Copyright © 2007-2012 The Apache Software Foundation