edu.umd.cloud9.collection.trec
Class TrecDocumentInputFormat.TrecDocumentRecordReader

java.lang.Object
  extended by edu.umd.cloud9.collection.trec.TrecDocumentInputFormat.TrecDocumentRecordReader
All Implemented Interfaces:
RecordReader<LongWritable,TrecDocument>
Enclosing class:
TrecDocumentInputFormat

public static class TrecDocumentInputFormat.TrecDocumentRecordReader
extends Object
implements RecordReader<LongWritable,TrecDocument>

Hadoop RecordReader for reading TREC-formatted documents.


Constructor Summary
TrecDocumentInputFormat.TrecDocumentRecordReader(FileSplit split, JobConf conf)
          Creates a TrecDocumentRecordReader.
 
Method Summary
 void close()
          Closes this InputSplit.
 LongWritable createKey()
          Creates an object for the key.
 TrecDocument createValue()
          Creates an object for the value.
 long getPos()
          Returns the current position in the input.
 float getProgress()
          Returns progress on how much input has been consumed.
 boolean next(LongWritable key, TrecDocument value)
          Reads the next key-value pair.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrecDocumentInputFormat.TrecDocumentRecordReader

public TrecDocumentInputFormat.TrecDocumentRecordReader(FileSplit split,
                                                        JobConf conf)
                                                 throws IOException
Creates a TrecDocumentRecordReader.

Throws:
IOException
Method Detail

next

public boolean next(LongWritable key,
                    TrecDocument value)
             throws IOException
Reads the next key-value pair.

Specified by:
next in interface RecordReader<LongWritable,TrecDocument>
Throws:
IOException

createKey

public LongWritable createKey()
Creates an object for the key.

Specified by:
createKey in interface RecordReader<LongWritable,TrecDocument>

createValue

public TrecDocument createValue()
Creates an object for the value.

Specified by:
createValue in interface RecordReader<LongWritable,TrecDocument>

getPos

public long getPos()
            throws IOException
Returns the current position in the input.

Specified by:
getPos in interface RecordReader<LongWritable,TrecDocument>
Throws:
IOException

close

public void close()
           throws IOException
Closes this InputSplit.

Specified by:
close in interface RecordReader<LongWritable,TrecDocument>
Throws:
IOException

getProgress

public float getProgress()
                  throws IOException
Returns progress on how much input has been consumed.

Specified by:
getProgress in interface RecordReader<LongWritable,TrecDocument>
Throws:
IOException