|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Slice
A grouping of data on that can be processed individually by Pig. Instances of
this interface are created by Slicer
, serialized, and sent to nodes
to be processed.
getLocations()
is called as part of the configuration process to
determine where this Slice should be run for maximal locality with the data
to be read. Once the Slice arrives on the processing node,
init(DataStorage)
is called to give it access to the
DataStorage
it should use to load Tuples. After
init
has been called, any of the other methods on this
interface may be called as part of Pig's processing.
Method Summary | |
---|---|
void |
close()
Closes any streams this Slice has opened as part of its work. |
long |
getLength()
Returns the length in bytes of all of the data that will be processed by this Slice. |
String[] |
getLocations()
Returns string representations of all the files that will be used as part of processing this Slice. |
long |
getPos()
Returns the number of bytes read so far as part of processing this Slice. |
float |
getProgress()
Returns the percentage of Slice that is complete from 0.0 to 1.0. |
long |
getStart()
Returns the offset from which data in this Slice will be processed. |
void |
init(DataStorage store)
Initializes this Slice with the DataStorage it's to use to do its work. |
boolean |
next(Tuple value)
Loads the next value from this Slice into value . |
Method Detail |
---|
String[] getLocations()
This is the only method on Slice that is valid to call before
init(DataStorage)
has been called.
void init(DataStorage store) throws IOException
This will always be called before getLength
,
close
, getPos
, getProgress
and next
.
IOException
long getStart()
long getLength()
Only valid to call after init(DataStorage)
has been called.
void close() throws IOException
Only valid to call after init(DataStorage)
has been called.
IOException
long getPos() throws IOException
Only valid to call after init(DataStorage)
has been called.
IOException
float getProgress() throws IOException
Only valid to call after init(DataStorage)
has been called.
IOException
boolean next(Tuple value) throws IOException
value
.
Only valid to call after init(DataStorage)
has been called.
value
- -
the Tuple to be filled with the next value.
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |