Class ArrayFile.Reader

java.lang.Object
org.apache.hadoop.io.MapFile.Reader
org.apache.hadoop.io.ArrayFile.Reader
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
ArrayFile

public static class ArrayFile.Reader extends MapFile.Reader
Provide access to an existing array file.
  • Constructor Details

    • Reader

      public Reader(FileSystem fs, String file, Configuration conf) throws IOException
      Construct an array reader for the named file.
      Parameters:
      fs - FileSystem.
      file - file.
      conf - configuration.
      Throws:
      IOException - raised on errors performing I/O.
  • Method Details

    • seek

      public void seek(long n) throws IOException
      Positions the reader before its nth value.
      Parameters:
      n - n key.
      Throws:
      IOException - raised on errors performing I/O.
    • next

      public Writable next(Writable value) throws IOException
      Read and return the next value in the file.
      Parameters:
      value - value.
      Returns:
      Writable.
      Throws:
      IOException - raised on errors performing I/O.
    • key

      public long key() throws IOException
      Returns the key associated with the most recent call to seek(long), next(Writable), or get(long,Writable).
      Returns:
      key key.
      Throws:
      IOException - raised on errors performing I/O.
    • get

      public Writable get(long n, Writable value) throws IOException
      Return the nth value in the file.
      Parameters:
      n - n key.
      value - value.
      Returns:
      writable.
      Throws:
      IOException - raised on errors performing I/O.