org.apache.hadoop.mapred
Class SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader

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

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

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


Constructor Summary
SequenceFileAsBinaryInputFormat.SequenceFileAsBinaryRecordReader(Configuration conf, FileSplit split)
           
 
Method Summary
 void close()
          Close this InputSplit to future operations.
 BytesWritable createKey()
          Create an object of the appropriate type to be used as a key.
 BytesWritable createValue()
          Create an object of the appropriate type to be used as a value.
 String getKeyClassName()
          Retrieve the name of the key class for this SequenceFile.
 long getPos()
          Returns the current position in the input.
 float getProgress()
          Return the progress within the input split
 String getValueClassName()
          Retrieve the name of the value class for this SequenceFile.
 boolean next(BytesWritable key, BytesWritable val)
          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(Configuration conf,
                                                                        FileSplit split)
                                                                 throws IOException
Throws:
IOException
Method Detail

createKey

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

createValue

public BytesWritable 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<BytesWritable,BytesWritable>
Returns:
a new value object.

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()

next

public boolean next(BytesWritable key,
                    BytesWritable val)
             throws IOException
Read raw bytes from a SequenceFile.

Specified by:
next in interface RecordReader<BytesWritable,BytesWritable>
Parameters:
key - the key to read data into
val - the value to read data into
Returns:
true iff a key/value was read, false if at EOF
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<BytesWritable,BytesWritable>
Returns:
the current position in the input.
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<BytesWritable,BytesWritable>
Throws:
IOException

getProgress

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

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


Copyright © 2009 The Apache Software Foundation