|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SamplableLoader
Implementing this interface indicates to Pig that a given loader can be used by a sampling loader. The requirement for this is that the loader can handle a getNext() call without knowing the position in the file. This will not be the case for loaders that handle structured data such as XML where they must start at the beginning of the file in order to understand their position. Record oriented loaders such as PigStorage can handle this by seeking to the next record delimiter and starting from that point. Another requirement is that the loader be able to skip or seek in its input stream.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.pig.LoadFunc |
---|
LoadFunc.RequiredField, LoadFunc.RequiredFieldList, LoadFunc.RequiredFieldResponse |
Method Summary | |
---|---|
long |
getPosition()
Get the current position in the stream. |
Tuple |
getSampledTuple()
Get the next tuple from the stream starting from the current read position. |
long |
skip(long n)
Skip ahead in the input stream. |
Methods inherited from interface org.apache.pig.LoadFunc |
---|
bindTo, bytesToBag, bytesToCharArray, bytesToDouble, bytesToFloat, bytesToInteger, bytesToLong, bytesToMap, bytesToTuple, determineSchema, fieldsToRead, getNext |
Method Detail |
---|
long skip(long n) throws IOException
n
- number of bytes to skip
InpuStream
IOException
long getPosition() throws IOException
IOException
Tuple getSampledTuple() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |