p2pMapReduce.mapreduceModule.input
Class LineRecordReader

java.lang.Object
  extended by p2pMapReduce.mapreduceModule.input.RecordReader<java.lang.Long,java.lang.String>
      extended by p2pMapReduce.mapreduceModule.input.LineRecordReader
All Implemented Interfaces:
java.io.Closeable

public class LineRecordReader
extends RecordReader<java.lang.Long,java.lang.String>

Treats line number in the file as key and the line itself as value


Constructor Summary
LineRecordReader()
           
 
Method Summary
 void close()
          Close the record reader.
 java.lang.Long getCurrentKey()
          Get the current key
 java.lang.String getCurrentValue()
          Get the current value.
 float getProgress()
          Not correctly implemented yet
 void initialize(InputSplit split, TaskAttemptContext context)
          Called once at initialization.
 boolean nextKeyValue()
          Read the next key, value pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineRecordReader

public LineRecordReader()
Method Detail

initialize

public void initialize(InputSplit split,
                       TaskAttemptContext context)
                throws java.io.IOException,
                       java.lang.InterruptedException
Description copied from class: RecordReader
Called once at initialization.

Specified by:
initialize in class RecordReader<java.lang.Long,java.lang.String>
Parameters:
split - the split that defines the range of records to read
context - the information about the task
Throws:
java.io.IOException
java.lang.InterruptedException

nextKeyValue

public boolean nextKeyValue()
                     throws java.io.IOException,
                            java.lang.InterruptedException
Description copied from class: RecordReader
Read the next key, value pair.

Specified by:
nextKeyValue in class RecordReader<java.lang.Long,java.lang.String>
Returns:
true if a key/value pair was read
Throws:
java.io.IOException
java.lang.InterruptedException

getCurrentKey

public java.lang.Long getCurrentKey()
                             throws java.io.IOException,
                                    java.lang.InterruptedException
Description copied from class: RecordReader
Get the current key

Specified by:
getCurrentKey in class RecordReader<java.lang.Long,java.lang.String>
Returns:
the current key or null if there is no current key
Throws:
java.io.IOException
java.lang.InterruptedException

getCurrentValue

public java.lang.String getCurrentValue()
                                 throws java.io.IOException,
                                        java.lang.InterruptedException
Description copied from class: RecordReader
Get the current value.

Specified by:
getCurrentValue in class RecordReader<java.lang.Long,java.lang.String>
Returns:
the object that was read
Throws:
java.io.IOException
java.lang.InterruptedException

getProgress

public float getProgress()
                  throws java.io.IOException,
                         java.lang.InterruptedException
Not correctly implemented yet

Specified by:
getProgress in class RecordReader<java.lang.Long,java.lang.String>
Returns:
Throws:
java.io.IOException
java.lang.InterruptedException

close

public void close()
           throws java.io.IOException
Description copied from class: RecordReader
Close the record reader.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class RecordReader<java.lang.Long,java.lang.String>
Throws:
java.io.IOException