org.apache.hadoop.mapred
Class SequenceFileAsTextRecordReader

java.lang.Object
  extended by org.apache.hadoop.mapred.SequenceFileRecordReader
      extended by org.apache.hadoop.mapred.SequenceFileAsTextRecordReader
All Implemented Interfaces:
RecordReader

public class SequenceFileAsTextRecordReader
extends SequenceFileRecordReader

This class converts the input keys and values to their String forms by calling toString() method. This class to SequenceFileAsTextInputFormat class is as LineRecordReader class to TextInputFormat class.


Field Summary
 
Fields inherited from class org.apache.hadoop.mapred.SequenceFileRecordReader
conf
 
Constructor Summary
SequenceFileAsTextRecordReader(Configuration conf, FileSplit split)
           
 
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 key/value pair in a line.
 
Methods inherited from class org.apache.hadoop.mapred.SequenceFileRecordReader
close, getCurrentValue, getKeyClass, getPos, getProgress, getValueClass, next, seek
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceFileAsTextRecordReader

public SequenceFileAsTextRecordReader(Configuration conf,
                                      FileSplit split)
                               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 SequenceFileRecordReader
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 SequenceFileRecordReader
Returns:
a new value object

next

public boolean next(Writable key,
                    Writable value)
             throws IOException
Read key/value pair in a line.

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