org.apache.hadoop.mapred
Class SequenceFileRecordReader<K,V>

java.lang.Object
  extended by org.apache.hadoop.mapred.SequenceFileRecordReader<K,V>
All Implemented Interfaces:
RecordReader<K,V>

public class SequenceFileRecordReader<K,V>
extends Object
implements RecordReader<K,V>

An RecordReader for SequenceFiles.


Field Summary
protected  Configuration conf
           
 
Constructor Summary
SequenceFileRecordReader(Configuration conf, FileSplit split)
           
 
Method Summary
 void close()
          Close this InputSplit to future operations.
 K createKey()
          Create an object of the appropriate type to be used as a key.
 V createValue()
          Create an object of the appropriate type to be used as a value.
protected  void getCurrentValue(V value)
           
 Class getKeyClass()
          The class of key that must be passed to next(Object, Object)..
 long getPos()
          Returns the current position in the input.
 float getProgress()
          Return the progress within the input split
 Class getValueClass()
          The class of value that must be passed to next(Object, Object)..
protected  boolean next(K key)
           
 boolean next(K key, V value)
          Reads the next key/value pair from the input for processing.
protected  void seek(long pos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conf

protected Configuration conf
Constructor Detail

SequenceFileRecordReader

public SequenceFileRecordReader(Configuration conf,
                                FileSplit split)
                         throws IOException
Throws:
IOException
Method Detail

getKeyClass

public Class getKeyClass()
The class of key that must be passed to next(Object, Object)..


getValueClass

public Class getValueClass()
The class of value that must be passed to next(Object, Object)..


createKey

public K 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<K,V>
Returns:
a new key object.

createValue

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

Specified by:
createValue in interface RecordReader<K,V>
Returns:
a new value object.

next

public boolean next(K key,
                    V value)
             throws IOException
Description copied from interface: RecordReader
Reads the next key/value pair from the input for processing.

Specified by:
next in interface RecordReader<K,V>
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

next

protected boolean next(K key)
                throws IOException
Throws:
IOException

getCurrentValue

protected void getCurrentValue(V value)
                        throws IOException
Throws:
IOException

getProgress

public float getProgress()
                  throws IOException
Return the progress within the input split

Specified by:
getProgress in interface RecordReader<K,V>
Returns:
0.0 to 1.0 of the input byte range
Throws:
IOException

getPos

public long getPos()
            throws IOException
Description copied from interface: RecordReader
Returns the current position in the input.

Specified by:
getPos in interface RecordReader<K,V>
Returns:
the current position in the input.
Throws:
IOException

seek

protected void seek(long pos)
             throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: RecordReader
Close this InputSplit to future operations.

Specified by:
close in interface RecordReader<K,V>
Throws:
IOException


Copyright © 2009 The Apache Software Foundation