datafu.pig.sampling
Class SimpleRandomSampleWithReplacementElect

java.lang.Object
  extended by org.apache.pig.EvalFunc<T>
      extended by org.apache.pig.AccumulatorEvalFunc<T>
          extended by org.apache.pig.AlgebraicEvalFunc<org.apache.pig.data.DataBag>
              extended by datafu.pig.sampling.SimpleRandomSampleWithReplacementElect
All Implemented Interfaces:
org.apache.pig.Accumulator<org.apache.pig.data.DataBag>, org.apache.pig.Algebraic

public class SimpleRandomSampleWithReplacementElect
extends org.apache.pig.AlgebraicEvalFunc<org.apache.pig.data.DataBag>

Select the candidate with the smallest score for each position from the candidates proposed by SimpleRandomSampleWithReplacementVote.

Author:
ximeng
See Also:
SimpleRandomSampleWithReplacementVote

Nested Class Summary
static class SimpleRandomSampleWithReplacementElect.Final
           
static class SimpleRandomSampleWithReplacementElect.Initial
           
static class SimpleRandomSampleWithReplacementElect.Intermediate
           
 
Field Summary
static org.apache.pig.data.BagFactory bagFactory
           
static java.lang.String OUTPUT_BAG_NAME_PREFIX
          Prefix for the output bag name.
static org.apache.pig.data.TupleFactory tupleFactory
           
 
Fields inherited from class org.apache.pig.EvalFunc
log, pigLogger, reporter, returnType
 
Constructor Summary
SimpleRandomSampleWithReplacementElect()
           
 
Method Summary
 java.lang.String getFinal()
           
 java.lang.String getInitial()
           
 java.lang.String getIntermed()
           
 org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
           
 
Methods inherited from class org.apache.pig.AlgebraicEvalFunc
accumulate, cleanup, getValue
 
Methods inherited from class org.apache.pig.AccumulatorEvalFunc
exec
 
Methods inherited from class org.apache.pig.EvalFunc
finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, isAsynchronous, progress, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUTPUT_BAG_NAME_PREFIX

public static final java.lang.String OUTPUT_BAG_NAME_PREFIX
Prefix for the output bag name.

See Also:
Constant Field Values

tupleFactory

public static final org.apache.pig.data.TupleFactory tupleFactory

bagFactory

public static final org.apache.pig.data.BagFactory bagFactory
Constructor Detail

SimpleRandomSampleWithReplacementElect

public SimpleRandomSampleWithReplacementElect()
Method Detail

getInitial

public java.lang.String getInitial()
Specified by:
getInitial in interface org.apache.pig.Algebraic
Specified by:
getInitial in class org.apache.pig.AlgebraicEvalFunc<org.apache.pig.data.DataBag>

getIntermed

public java.lang.String getIntermed()
Specified by:
getIntermed in interface org.apache.pig.Algebraic
Specified by:
getIntermed in class org.apache.pig.AlgebraicEvalFunc<org.apache.pig.data.DataBag>

getFinal

public java.lang.String getFinal()
Specified by:
getFinal in interface org.apache.pig.Algebraic
Specified by:
getFinal in class org.apache.pig.AlgebraicEvalFunc<org.apache.pig.data.DataBag>

outputSchema

public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
Overrides:
outputSchema in class org.apache.pig.EvalFunc<org.apache.pig.data.DataBag>


Matthew Hayes, Sam Shah