org.apache.pig.impl.builtin
Class PoissonSampleLoader

java.lang.Object
  extended by org.apache.pig.LoadFunc
      extended by org.apache.pig.impl.builtin.SampleLoader
          extended by org.apache.pig.impl.builtin.PoissonSampleLoader

public class PoissonSampleLoader
extends SampleLoader

See "Skewed Join sampler" in http://wiki.apache.org/pig/PigSampler


Field Summary
static String NUMROWS_TUPLE_MARKER
           
 
Fields inherited from class org.apache.pig.impl.builtin.SampleLoader
loader, numSamples
 
Constructor Summary
PoissonSampleLoader(String funcSpec, String ns)
           
 
Method Summary
 void computeSamples(ArrayList<Pair<FileSpec,Boolean>> inputs, PigContext pc)
          Computes the number of samples for the loader
 Tuple getNext()
          Retrieves the next tuple to be processed.
 void prepareToRead(org.apache.hadoop.mapreduce.RecordReader reader, PigSplit split)
          Initializes LoadFunc for reading data.
 
Methods inherited from class org.apache.pig.impl.builtin.SampleLoader
getInputFormat, getLoadCaster, getNumSamples, relativeToAbsolutePath, setLocation, setNumSamples, setUDFContextSignature, skipNext
 
Methods inherited from class org.apache.pig.LoadFunc
getAbsolutePath, getPathStrings, join, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUMROWS_TUPLE_MARKER

public static final String NUMROWS_TUPLE_MARKER
See Also:
Constant Field Values
Constructor Detail

PoissonSampleLoader

public PoissonSampleLoader(String funcSpec,
                           String ns)
Method Detail

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 inputs
pc - : 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 LoadFunc
split - The input PigSplit to process
Throws:
IOException - if there is an exception during initialization


Copyright © 2007-2012 The Apache Software Foundation