SequenceFileRecordReader (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.mapreduce.lib.input, class: SequenceFileRecordReader

Package org.apache.hadoop.mapreduce.lib.input

# Class SequenceFileRecordReader<K,V>

java.lang.Object
org.apache.hadoop.mapreduce.RecordReader<K,V>
org.apache.hadoop.mapreduce.lib.input.SequenceFileRecordReader<K,V>

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

@Public @Stable public class SequenceFileRecordReader<K,V> extends RecordReader<K,V>
An `RecordReader` for `SequenceFile`s.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Configuration`
  `conf`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SequenceFileRecordReader()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Close the record reader.
  `K`
  `getCurrentKey()`
  Get the current key
  `V`
  `getCurrentValue()`
  Get the current value.
  `float`
  `getProgress()`
  Return the progress within the input split
  `void`
  `initialize(InputSplit split, TaskAttemptContext context)`
  Called once at initialization.
  `boolean`
  `nextKeyValue()`
  Read the next key, value pair.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### conf

    protected Configuration conf

- ## Constructor Details

  - ### SequenceFileRecordReader

    public SequenceFileRecordReader()

- ## Method Details

  - ### 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<K,V>`
    Parameters:
      `split` - the split that defines the range of records to read
      `context` - the information about the task
    Throws:
      `IOException`
      `InterruptedException`

  - ### nextKeyValue

    public boolean nextKeyValue() throws IOException, InterruptedException
    Description copied from class: `RecordReader`
    Read the next key, value pair.
    Specified by:
      `nextKeyValue` in class `RecordReader<K,V>`
    Returns:
      true if a key/value pair was read
    Throws:
      `IOException`
      `InterruptedException`

  - ### getCurrentKey

    public K getCurrentKey()
    Description copied from class: `RecordReader`
    Get the current key
    Specified by:
      `getCurrentKey` in class `RecordReader<K,V>`
    Returns:
      the current key or null if there is no current key

  - ### getCurrentValue

    public V getCurrentValue()
    Description copied from class: `RecordReader`
    Get the current value.
    Specified by:
      `getCurrentValue` in class `RecordReader<K,V>`
    Returns:
      the object that was read

  - ### getProgress

    public float getProgress() throws IOException
    Return the progress within the input split
    Specified by:
      `getProgress` in class `RecordReader<K,V>`
    Returns:
      0.0 to 1.0 of the input byte range
    Throws:
      `IOException`

  - ### close

    public void close() throws IOException
    Description copied from class: `RecordReader`
    Close the record reader.
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `Closeable`
    Specified by:
      `close` in class `RecordReader<K,V>`
    Throws:
      `IOException`