org.apache.pig.scripting
Class ScriptEngine
java.lang.Object
org.apache.pig.scripting.ScriptEngine
- Direct Known Subclasses:
- JythonScriptEngine
public abstract class ScriptEngine
- extends Object
Base class for various scripting implementations
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
namespaceSeparator
public static final String namespaceSeparator
- See Also:
- Constant Field Values
ScriptEngine
public ScriptEngine()
registerFunctions
public abstract void registerFunctions(String path,
String namespace,
PigContext pigContext)
throws IOException
- registers the Jython functions as Pig functions with given namespace
- Parameters:
path
- path of the scriptnamespace
- namespace for the functionspigContext
- pigcontext to register functions to pig in the given namespace
- Throws:
IOException
getJarPath
protected static String getJarPath(Class<?> clazz)
throws FileNotFoundException
- figure out the jar location from the class
- Parameters:
clazz
-
- Returns:
- the jar file location, null if the class was not loaded from a jar
- Throws:
FileNotFoundException
getInstance
public static ScriptEngine getInstance(String scriptingLang)
throws IOException
- get instance of the scriptEngine for the given scriptingLang
- Parameters:
scriptingLang
- ScriptEngine classname or keyword for the scriptingLang
- Returns:
- scriptengine for the given scripting language
- Throws:
IOException
Copyright © ${year} The Apache Software Foundation