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

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

public static class SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader
extends RecordReader<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>

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


Constructor Summary
SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader()
           
 
Method Summary
 void close()
          Close the record reader.
 org.apache.hadoop.io.BytesWritable getCurrentKey()
          Get the current key
 org.apache.hadoop.io.BytesWritable getCurrentValue()
          Get the current value.
 java.lang.String getKeyClassName()
          Retrieve the name of the key class for this SequenceFile.
 float getProgress()
          Return the progress within the input split
 java.lang.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 java.io.IOException,
                       java.lang.InterruptedException
Description copied from class: RecordReader
Called once at initialization.

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

getCurrentKey

public org.apache.hadoop.io.BytesWritable getCurrentKey()
                                                 throws java.io.IOException,
                                                        java.lang.InterruptedException
Description copied from class: RecordReader
Get the current key

Specified by:
getCurrentKey in class RecordReader<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
Returns:
the current key or null if there is no current key
Throws:
java.io.IOException
java.lang.InterruptedException

getCurrentValue

public org.apache.hadoop.io.BytesWritable getCurrentValue()
                                                   throws java.io.IOException,
                                                          java.lang.InterruptedException
Description copied from class: RecordReader
Get the current value.

Specified by:
getCurrentValue in class RecordReader<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
Returns:
the object that was read
Throws:
java.io.IOException
java.lang.InterruptedException

getKeyClassName

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

See Also:
SequenceFile.Reader.getKeyClassName()

getValueClassName

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

See Also:
SequenceFile.Reader.getValueClassName()

nextKeyValue

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

Specified by:
nextKeyValue in class RecordReader<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
Returns:
true if a key/value pair was read
Throws:
java.io.IOException
java.lang.InterruptedException

close

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

Specified by:
close in interface java.io.Closeable
Specified by:
close in class RecordReader<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
Throws:
java.io.IOException

getProgress

public float getProgress()
                  throws java.io.IOException,
                         java.lang.InterruptedException
Return the progress within the input split

Specified by:
getProgress in class RecordReader<org.apache.hadoop.io.BytesWritable,org.apache.hadoop.io.BytesWritable>
Returns:
0.0 to 1.0 of the input byte range
Throws:
java.io.IOException
java.lang.InterruptedException


Copyright © 2009 The Apache Software Foundation