org.apache.hadoop.mapreduce.lib.input
Class SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader

java.lang.Object
  extended by org.apache.hadoop.mapreduce.RecordReader<BytesWritable,BytesWritable>
      extended by org.apache.hadoop.mapreduce.lib.input.SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader
All Implemented Interfaces:
Closeable
Enclosing class:
SequenceFileAsBinaryInputFormat

public static class SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader
extends RecordReader<BytesWritable,BytesWritable>

Read records from a SequenceFile as binary (raw) bytes.


Constructor Summary
SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader()
           
 
Method Summary
 void close()
          Close the record reader.
 BytesWritable getCurrentKey()
          Get the current key
 BytesWritable getCurrentValue()
          Get the current value.
 String getKeyClassName()
          Retrieve the name of the key class for this SequenceFile.
 float getProgress()
          Return the progress within the input split
 String getValueClassName()
          Retrieve the name of the value class for this SequenceFile.
 void initialize(InputSplit split, TaskAttemptContext context)
          Called once at initialization.
 boolean nextKeyValue()
          Read raw bytes from a SequenceFile.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader

public SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader()
Method Detail

initialize

public void initialize(InputSplit split,
                       TaskAttemptContext context)
                throws IOException,
                       InterruptedException
Description copied from class: RecordReader
Called once at initialization.

Specified by:
initialize in class RecordReader<BytesWritable,BytesWritable>
Parameters:
split - the split that defines the range of records to read
context - the information about the task
Throws:
IOException
InterruptedException

getCurrentKey

public BytesWritable getCurrentKey()
                            throws IOException,
                                   InterruptedException
Description copied from class: RecordReader
Get the current key

Specified by:
getCurrentKey in class RecordReader<BytesWritable,BytesWritable>
Returns:
the current key or null if there is no current key
Throws:
IOException
InterruptedException

getCurrentValue

public BytesWritable getCurrentValue()
                              throws IOException,
                                     InterruptedException
Description copied from class: RecordReader
Get the current value.

Specified by:
getCurrentValue in class RecordReader<BytesWritable,BytesWritable>
Returns:
the object that was read
Throws:
IOException
InterruptedException

getKeyClassName

public String getKeyClassName()
Retrieve the name of the key class for this SequenceFile.

See Also:
SequenceFile.Reader.getKeyClassName()

getValueClassName

public String getValueClassName()
Retrieve the name of the value class for this SequenceFile.

See Also:
SequenceFile.Reader.getValueClassName()

nextKeyValue

public boolean nextKeyValue()
                     throws IOException,
                            InterruptedException
Read raw bytes from a SequenceFile.

Specified by:
nextKeyValue in class RecordReader<BytesWritable,BytesWritable>
Returns:
true if a key/value pair was read
Throws:
IOException
InterruptedException

close

public void close()
           throws IOException
Description copied from class: RecordReader
Close the record reader.

Specified by:
close in interface Closeable
Specified by:
close in class RecordReader<BytesWritable,BytesWritable>
Throws:
IOException

getProgress

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

Specified by:
getProgress in class RecordReader<BytesWritable,BytesWritable>
Returns:
0.0 to 1.0 of the input byte range
Throws:
IOException
InterruptedException


Copyright © 2009 The Apache Software Foundation