org.apache.pig.scripting.jruby
Class JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper<T>

java.lang.Object
  extended by org.apache.pig.EvalFunc<T>
      extended by 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.


Field Summary
protected  boolean isInitialized
           
protected  Object receiver
           
protected  String stage
           
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
JrubyAlgebraicEvalFunc.AlgebraicFunctionWrapper()
           
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.
 
Method Summary
abstract  T exec(Tuple input)
          This callback method must be implemented by all subclasses.
 String getFileName()
           
 String getFunctionName()
           
 Object getReceiver()
           
 String getStage()
           
 void initialize()
           
 boolean isInitialized()
           
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, getCacheFiles, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, isAsynchronous, outputSchema, progress, setPigLogger, setReporter, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

receiver

protected Object receiver

isInitialized

protected boolean isInitialized

stage

protected String stage
Constructor Detail

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.

Method Detail

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