Class SetFile.Reader

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

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

    • Reader

      public Reader(FileSystem fs, String dirName, Configuration conf) throws IOException
      Construct a set reader for the named set.
      Parameters:
      fs - input FileSystem.
      dirName - input dirName.
      conf - input Configuration.
      Throws:
      IOException - raised on errors performing I/O.
    • Reader

      public Reader(FileSystem fs, String dirName, WritableComparator comparator, Configuration conf) throws IOException
      Construct a set reader for the named set using the named comparator.
      Parameters:
      fs - input FileSystem.
      dirName - input dirName.
      comparator - input comparator.
      conf - input Configuration.
      Throws:
      IOException - raised on errors performing I/O.
  • Method Details

    • seek

      public boolean seek(WritableComparable key) throws IOException
      Description copied from class: MapFile.Reader
      Positions the reader at the named key, or if none such exists, at the first entry after the named key. Returns true iff the named key exists in this map.
      Overrides:
      seek in class MapFile.Reader
      Parameters:
      key - key.
      Returns:
      if the named key exists in this map true, not false.
      Throws:
      IOException - raised on errors performing I/O.
    • next

      public boolean next(WritableComparable key) throws IOException
      Read the next key in a set into key.
      Parameters:
      key - input key.
      Returns:
      Returns true if such a key exists and false when at the end of the set.
      Throws:
      IOException - raised on errors performing I/O.
    • get

      Read the matching key from a set into key.
      Parameters:
      key - input key.
      Returns:
      Returns key, or null if no match exists.
      Throws:
      IOException - raised on errors performing I/O.