datafu.pig.util
Class ContextualEvalFunc<T>

java.lang.Object
  extended by org.apache.pig.EvalFunc<T>
      extended by datafu.pig.util.ContextualEvalFunc<T>
Type Parameters:
T -
Direct Known Subclasses:
AliasableEvalFunc, EmptyBagToNullFields

public abstract class ContextualEvalFunc<T>
extends org.apache.pig.EvalFunc<T>

An abstract class which enables UDFs to store instance properties on the front end which will be available on the back end. For example, properties may be set in the call to outputSchema(), which will be available when exec() is called.


Field Summary
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
ContextualEvalFunc()
           
 
Method Summary
protected  java.util.Properties getContextProperties()
          Helper method to return the context properties for this class
protected  java.lang.String getInstanceName()
           
protected  java.util.Properties getInstanceProperties()
          Helper method to return the context properties for this instance of this class
 void setUDFContextSignature(java.lang.String signature)
           
 
Methods inherited from class org.apache.pig.EvalFunc
exec, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, isAsynchronous, outputSchema, progress, setInputSchema, setPigLogger, setReporter, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextualEvalFunc

public ContextualEvalFunc()
Method Detail

setUDFContextSignature

public void setUDFContextSignature(java.lang.String signature)
Overrides:
setUDFContextSignature in class org.apache.pig.EvalFunc<T>

getContextProperties

protected java.util.Properties getContextProperties()
Helper method to return the context properties for this class

Returns:
context properties

getInstanceProperties

protected java.util.Properties getInstanceProperties()
Helper method to return the context properties for this instance of this class

Returns:
instances properties

getInstanceName

protected java.lang.String getInstanceName()
Returns:
the name of this instance corresponding to the UDF Context Signature
See Also:
setUDFContextSignature(String)


Matthew Hayes, Sam Shah