org.apache.pig.impl.builtin
Class PoissonSampleLoader
java.lang.Object
org.apache.pig.LoadFunc
org.apache.pig.impl.builtin.SampleLoader
org.apache.pig.impl.builtin.PoissonSampleLoader
public class PoissonSampleLoader
- extends SampleLoader
See "Skewed Join sampler" in http://wiki.apache.org/pig/PigSampler
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NUMROWS_TUPLE_MARKER
public static final String NUMROWS_TUPLE_MARKER
- See Also:
- Constant Field Values
PoissonSampleLoader
public PoissonSampleLoader(String funcSpec,
String ns)
getNext
public Tuple getNext()
throws IOException
- Description copied from class:
LoadFunc
- Retrieves the next tuple to be processed. Implementations should NOT reuse
tuple objects (or inner member objects) they return across calls and
should return a different tuple object in each call.
- Specified by:
getNext
in class LoadFunc
- Returns:
- the next tuple to be processed or null if there are no more tuples
to be processed.
- Throws:
IOException
- if there is an exception while retrieving the next
tuple
computeSamples
public void computeSamples(ArrayList<Pair<FileSpec,Boolean>> inputs,
PigContext pc)
throws ExecException
- Computes the number of samples for the loader
- Overrides:
computeSamples
in class SampleLoader
- Parameters:
inputs
- : Set to pig inputspc
- : PigContext object
- Throws:
ExecException
prepareToRead
public void prepareToRead(org.apache.hadoop.mapreduce.RecordReader reader,
PigSplit split)
throws IOException
- Description copied from class:
LoadFunc
- Initializes LoadFunc for reading data. This will be called during execution
before any calls to getNext. The RecordReader needs to be passed here because
it has been instantiated for a particular InputSplit.
- Overrides:
prepareToRead
in class SampleLoader
- Parameters:
reader
- RecordReader
to be used by this instance of the LoadFuncsplit
- The input PigSplit
to process
- Throws:
IOException
- if there is an exception during initialization
Copyright © 2012 The Apache Software Foundation