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(java.lang.String path,
java.lang.String functionName)
Gets the Python function object.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getParamsFromVariables()
Returns a map from local variable names to their values
|
protected java.lang.String |
getScriptingLang()
Gets ScriptEngine classname or keyword for the scripting language
|
void |
load(java.io.InputStream script,
java.lang.String scriptFile,
PigContext pigContext)
execs the script text using the interpreter.
|
protected java.util.Map<java.lang.String,java.util.List<PigStats>> |
main(PigContext pigContext,
java.lang.String scriptFile)
Actually runs the script file.
|
void |
registerFunctions(java.lang.String path,
java.lang.String namespace,
PigContext pigContext)
Registers scripting language functions as Pig functions with given namespace
|
getInstance, getJarPath, getPigStatsMap, getScriptAsStream, getSupportedScriptLang, run
public void registerFunctions(java.lang.String path, java.lang.String namespace, PigContext pigContext) throws java.io.IOException
ScriptEngine
registerFunctions
in class ScriptEngine
path
- path of the scriptnamespace
- namespace for the functionspigContext
- pigcontext to register functions to pig in the given namespacejava.io.IOException
public static org.python.core.PyFunction getFunction(java.lang.String path, java.lang.String functionName) throws java.io.IOException
path
- Path of the jython script file containing the function.functionName
- Name of the functionjava.io.IOException
protected java.util.Map<java.lang.String,java.util.List<PigStats>> main(PigContext pigContext, java.lang.String scriptFile) throws java.io.IOException
ScriptEngine
main
in class ScriptEngine
pigContext
- ScriptPigContext
to run the script filescriptFile
- the filejava.io.IOException
public void load(java.io.InputStream script, java.lang.String scriptFile, PigContext pigContext) throws java.io.IOException
script
- scriptFile
- pigContext
- java.io.IOException
protected java.lang.String getScriptingLang()
ScriptEngine
getScriptingLang
in class ScriptEngine
protected java.util.Map<java.lang.String,java.lang.Object> getParamsFromVariables() throws java.io.IOException
ScriptEngine
getParamsFromVariables
in class ScriptEngine
java.io.IOException
Copyright © 2007-2012 The Apache Software Foundation