org.apache.hadoop.streaming
Class StreamSequenceRecordReader

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

public class StreamSequenceRecordReader
extends StreamBaseRecordReader


Field Summary
 
Fields inherited from class org.apache.hadoop.streaming.StreamBaseRecordReader
LOG
 
Constructor Summary
StreamSequenceRecordReader(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 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, getPos, getProgress, validateInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamSequenceRecordReader

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

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)

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

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 StreamBaseRecordReader
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 StreamBaseRecordReader
Returns:
a new value object


Copyright © 2006 The Apache Software Foundation