public class ReservoirSampling
extends org.apache.pig.AccumulatorEvalFunc<org.apache.pig.data.Tuple>
implements org.apache.pig.Algebraic
Modifier and Type | Class and Description |
---|---|
static class |
ReservoirSampling.Initial |
static class |
ReservoirSampling.IntermediateFinal |
Constructor and Description |
---|
ReservoirSampling(String kStr)
Reservoir sampling constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accumulate(org.apache.pig.data.Tuple inputTuple) |
void |
cleanup() |
org.apache.pig.data.Tuple |
exec(org.apache.pig.data.Tuple inputTuple) |
String |
getFinal() |
String |
getInitial() |
String |
getIntermed() |
org.apache.pig.data.Tuple |
getValue() |
org.apache.pig.impl.logicalLayer.schema.Schema |
outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input) |
allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLoadCaster, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn
public ReservoirSampling(String kStr)
kStr
- String indicating the maximum number of desired entries in the reservoir.public org.apache.pig.data.Tuple exec(org.apache.pig.data.Tuple inputTuple) throws IOException
exec
in class org.apache.pig.AccumulatorEvalFunc<org.apache.pig.data.Tuple>
IOException
public void accumulate(org.apache.pig.data.Tuple inputTuple) throws IOException
accumulate
in interface org.apache.pig.Accumulator<org.apache.pig.data.Tuple>
accumulate
in class org.apache.pig.AccumulatorEvalFunc<org.apache.pig.data.Tuple>
IOException
public org.apache.pig.data.Tuple getValue()
getValue
in interface org.apache.pig.Accumulator<org.apache.pig.data.Tuple>
getValue
in class org.apache.pig.AccumulatorEvalFunc<org.apache.pig.data.Tuple>
public void cleanup()
cleanup
in interface org.apache.pig.Accumulator<org.apache.pig.data.Tuple>
cleanup
in class org.apache.pig.AccumulatorEvalFunc<org.apache.pig.data.Tuple>
public org.apache.pig.impl.logicalLayer.schema.Schema outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema input)
outputSchema
in class org.apache.pig.EvalFunc<org.apache.pig.data.Tuple>
public String getInitial()
getInitial
in interface org.apache.pig.Algebraic
public String getIntermed()
getIntermed
in interface org.apache.pig.Algebraic
public String getFinal()
getFinal
in interface org.apache.pig.Algebraic
Copyright © 2015–2019 The Apache Software Foundation. All rights reserved.