org.apache.pig.scripting.jruby
Class JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper<T>
java.lang.Object
org.apache.pig.EvalFunc<T>
org.apache.pig.scripting.jruby.JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper<T>
- Direct Known Subclasses:
- JrubyAlgebraicEvalFunc.Final, JrubyAlgebraicEvalFunc.Initial, JrubyAlgebraicEvalFunc.Intermed
- Enclosing class:
- JrubyAlgebraicEvalFunc<T>
public abstract static class JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper<T>
- extends EvalFunc<T>
This is a lightweight wrapper shell that registers information on the method being called,
and provides the initializer that the static Algebraic classes (Initial, Intermed, Final)
will use to execute.
Methods inherited from class org.apache.pig.EvalFunc |
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, isAsynchronous, outputSchema, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
receiver
protected Object receiver
isInitialized
protected boolean isInitialized
stage
protected String stage
JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper
public JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper()
JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper
public JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper(String fileName,
String functionName,
String stage)
- In addition to registering the fileName and the functionName (which are given based on the
arguments passed to super() in the containing class's constructor, each extending class
will register their "stage," which will serve as the method to invoke on the Ruby class.
getStage
public String getStage()
getReceiver
public Object getReceiver()
getFileName
public String getFileName()
getFunctionName
public String getFunctionName()
isInitialized
public boolean isInitialized()
initialize
public void initialize()
exec
public abstract T exec(Tuple input)
throws IOException
- Description copied from class:
EvalFunc
- This callback method must be implemented by all subclasses. This
is the method that will be invoked on every Tuple of a given dataset.
Since the dataset may be divided up in a variety of ways the programmer
should not make assumptions about state that is maintained between
invocations of this method.
- Specified by:
exec
in class EvalFunc<T>
- Parameters:
input
- the Tuple to be processed.
- Returns:
- result, of type T.
- Throws:
IOException
Copyright © 2007-2012 The Apache Software Foundation