|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.contrib.index.example.LineDocRecordReader
public class LineDocRecordReader
A simple RecordReader for LineDoc for plain text files where each line is a
doc. Each line is as follows: documentID
Constructor Summary | |
---|---|
LineDocRecordReader(Configuration job,
FileSplit split)
Constructor |
Method Summary | |
---|---|
void |
close()
Close this InputSplit to future operations. |
DocumentID |
createKey()
Create an object of the appropriate type to be used as a key. |
LineDocTextAndOp |
createValue()
Create an object of the appropriate type to be used as a value. |
long |
getPos()
Returns the current position in the input. |
float |
getProgress()
How much of the input has the RecordReader consumed i.e. |
boolean |
next(DocumentID key,
LineDocTextAndOp value)
Reads the next key/value pair from the input for processing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LineDocRecordReader(Configuration job, FileSplit split) throws IOException
job
- split
-
IOException
Method Detail |
---|
public void close() throws IOException
RecordReader
InputSplit
to future operations.
close
in interface RecordReader<DocumentID,LineDocTextAndOp>
IOException
public DocumentID createKey()
RecordReader
createKey
in interface RecordReader<DocumentID,LineDocTextAndOp>
public LineDocTextAndOp createValue()
RecordReader
createValue
in interface RecordReader<DocumentID,LineDocTextAndOp>
public long getPos() throws IOException
RecordReader
getPos
in interface RecordReader<DocumentID,LineDocTextAndOp>
IOException
public float getProgress() throws IOException
RecordReader
RecordReader
consumed i.e.
has been processed by?
getProgress
in interface RecordReader<DocumentID,LineDocTextAndOp>
0.0
to 1.0
.
IOException
public boolean next(DocumentID key, LineDocTextAndOp value) throws IOException
RecordReader
next
in interface RecordReader<DocumentID,LineDocTextAndOp>
key
- the key to read data intovalue
- the value to read data into
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |