public class RandomSampleLoader extends SampleLoader
| Modifier and Type | Field and Description |
|---|---|
protected int |
nextSampleIdx |
loader, numSamples| Constructor and Description |
|---|
RandomSampleLoader(String funcSpec,
String ns)
Construct with a class of loader to use.
|
| Modifier and Type | Method and Description |
|---|---|
Tuple |
getNext()
Allocate a buffer for numSamples elements, populate it with the
first numSamples tuples, and continue scanning rest of the input.
|
void |
prepareToRead(org.apache.hadoop.mapreduce.RecordReader reader,
PigSplit split)
Initializes LoadFunc for reading data.
|
computeSamples, getInputFormat, getLoadCaster, getNumSamples, relativeToAbsolutePath, setLocation, setNumSamples, setUDFContextSignature, skipNextgetAbsolutePath, getCacheFiles, getPathStrings, getShipFiles, join, warnpublic RandomSampleLoader(String funcSpec, String ns)
funcSpec - func spec of the loader to use.ns - Number of samples per map to collect.
Arguments are passed as strings instead of actual types (FuncSpec, int)
because FuncSpec only supports string arguments to
UDF constructors.public Tuple getNext() throws IOException
getNext in class LoadFuncIOException - if there is an exception while retrieving the next
tuplepublic void prepareToRead(org.apache.hadoop.mapreduce.RecordReader reader,
PigSplit split)
throws IOException
LoadFuncprepareToRead in class SampleLoaderreader - RecordReader to be used by this instance of the LoadFuncsplit - The input PigSplit to processIOException - if there is an exception during initializationCopyright © 2007-2017 The Apache Software Foundation