org.apache.hadoop.streaming
Class StreamLineRecordReader

java.lang.Object
  extended by org.apache.hadoop.mapred.LineRecordReader
      extended by org.apache.hadoop.streaming.StreamLineRecordReader
All Implemented Interfaces:
RecordReader

public class StreamLineRecordReader
extends LineRecordReader

Similar to org.apache.hadoop.mapred.TextRecordReader, but delimits key and value with a TAB.

Author:
Michel Tourn

Field Summary
protected static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
StreamLineRecordReader(FSDataInputStream in, FileSplit split, Reporter reporter, JobConf job, FileSystem fs)
           
 
Method Summary
 WritableComparable createKey()
          Create an object of the appropriate type to be used as a key.
 Writable createValue()
          Create an object of the appropriate type to be used as the value.
 boolean next(Writable key, Writable value)
          Read a line.
 
Methods inherited from class org.apache.hadoop.mapred.LineRecordReader
close, getPos, getProgress, readLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Constructor Detail

StreamLineRecordReader

public StreamLineRecordReader(FSDataInputStream in,
                              FileSplit split,
                              Reporter reporter,
                              JobConf job,
                              FileSystem fs)
                       throws IOException
Throws:
IOException
Method Detail

createKey

public WritableComparable createKey()
Description copied from interface: RecordReader
Create an object of the appropriate type to be used as a key.

Specified by:
createKey in interface RecordReader
Overrides:
createKey in class LineRecordReader
Returns:
a new key object

createValue

public Writable createValue()
Description copied from interface: RecordReader
Create an object of the appropriate type to be used as the value.

Specified by:
createValue in interface RecordReader
Overrides:
createValue in class LineRecordReader
Returns:
a new value object

next

public boolean next(Writable key,
                    Writable value)
             throws IOException
Description copied from class: LineRecordReader
Read a line.

Specified by:
next in interface RecordReader
Overrides:
next in class LineRecordReader
Parameters:
key - the key to read data into
value - the value to read data into
Returns:
true iff a key/value was read, false if at EOF
Throws:
IOException
See Also:
Writable.readFields(DataInput)


Copyright © 2006 The Apache Software Foundation