org.apache.pig.scripting
Class ScriptEngine

java.lang.Object
  extended by org.apache.pig.scripting.ScriptEngine
Direct Known Subclasses:
JythonScriptEngine

public abstract class ScriptEngine
extends Object

Base class for various scripting implementations


Field Summary
static String namespaceSeparator
           
 
Constructor Summary
ScriptEngine()
           
 
Method Summary
static ScriptEngine getInstance(String scriptingLang)
          get instance of the scriptEngine for the given scriptingLang
protected static String getJarPath(Class<?> clazz)
          figure out the jar location from the class
abstract  void registerFunctions(String path, String namespace, PigContext pigContext)
          registers the Jython functions as Pig functions with given namespace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaceSeparator

public static final String namespaceSeparator
See Also:
Constant Field Values
Constructor Detail

ScriptEngine

public ScriptEngine()
Method Detail

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 script
namespace - namespace for the functions
pigContext - 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