org.apache.hadoop.streaming
Class StreamLineRecordReader

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

public class StreamLineRecordReader
extends StreamBaseRecordReader

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

Author:
Michel Tourn

Field Summary
 
Fields inherited from class org.apache.hadoop.streaming.StreamBaseRecordReader
LOG
 
Constructor Summary
StreamLineRecordReader(FSDataInputStream in, FileSplit split, Reporter reporter, JobConf job, FileSystem fs)
           
 
Method Summary
 boolean next(Writable key, Writable value)
          Read a record.
 void seekNextRecordBoundary()
          Implementation should seek forward in_ to the first byte of the next record.
 
Methods inherited from class org.apache.hadoop.streaming.StreamBaseRecordReader
close, createKey, createValue, getPos, getProgress, init, validateInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamLineRecordReader

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

seekNextRecordBoundary

public void seekNextRecordBoundary()
                            throws IOException
Description copied from class: StreamBaseRecordReader
Implementation should seek forward in_ to the first byte of the next record. The initial byte offset in the stream is arbitrary.

Specified by:
seekNextRecordBoundary in class StreamBaseRecordReader
Throws:
IOException

next

public boolean next(Writable key,
                    Writable value)
             throws IOException
Description copied from class: StreamBaseRecordReader
Read a record. Implementation should call numRecStats at the end

Specified by:
next in interface RecordReader
Specified by:
next in class StreamBaseRecordReader
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