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, warnpublic 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>IOExceptionpublic 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>IOExceptionpublic 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.Algebraicpublic String getIntermed()
getIntermed in interface org.apache.pig.Algebraicpublic String getFinal()
getFinal in interface org.apache.pig.AlgebraicCopyright © 2015–2020 The Apache Software Foundation. All rights reserved.