SetFile.Writer (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.io, class: SetFile, class: Writer

Package org.apache.hadoop.io

# Class SetFile.Writer

java.lang.Object
org.apache.hadoop.io.MapFile.Writer
org.apache.hadoop.io.SetFile.Writer

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Enclosing class:
  SetFile

public static class SetFile.Writer extends MapFile.Writer
Write a new set file.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.hadoop.io.MapFile.Writer

  `MapFile.Writer.Option`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Writer(Configuration conf, FileSystem fs, String dirName, Class<? extends WritableComparable> keyClass, SequenceFile.CompressionType compress)`
  Create a set naming the element class and compression type.
  `Writer(Configuration conf, FileSystem fs, String dirName, WritableComparator comparator, SequenceFile.CompressionType compress)`
  Create a set naming the element comparator and compression type.
  `Writer(FileSystem fs, String dirName, Class<? extends WritableComparable> keyClass)`
  Deprecated.
  pass a Configuration too

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `append(WritableComparable key)`
  Append a key to a set.

  ### Methods inherited from class org.apache.hadoop.io.MapFile.Writer

  `append, close, comparator, compression, compression, getIndexInterval, keyClass, progressable, setIndexInterval, setIndexInterval, valueClass`

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

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

- ## Constructor Details

  - ### Writer

    public Writer(FileSystem fs, String dirName, Class<? extends WritableComparable> keyClass) throws IOException
    Deprecated.
    pass a Configuration too
    Create the named set for keys of the named class.
    Parameters:
      `fs` - input FileSystem.
      `dirName` - input dirName.
      `keyClass` - input keyClass.
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### Writer

    public Writer(Configuration conf, FileSystem fs, String dirName, Class<? extends WritableComparable> keyClass, SequenceFile.CompressionType compress) throws IOException
    Create a set naming the element class and compression type.
    Parameters:
      `conf` - input Configuration.
      `fs` - input FileSystem.
      `dirName` - input dirName.
      `keyClass` - input keyClass.
      `compress` - input compress.
    Throws:
      `IOException` - raised on errors performing I/O.

  - ### Writer

    public Writer(Configuration conf, FileSystem fs, String dirName, WritableComparator comparator, SequenceFile.CompressionType compress) throws IOException
    Create a set naming the element comparator and compression type.
    Parameters:
      `conf` - input Configuration.
      `fs` - input FileSystem.
      `dirName` - input dirName.
      `comparator` - input comparator.
      `compress` - input compress.
    Throws:
      `IOException` - raised on errors performing I/O.

- ## Method Details

  - ### append

    public void append(WritableComparable key) throws IOException
    Append a key to a set. The key must be strictly greater than the previous key added to the set.
    Parameters:
      `key` - input key.
    Throws:
      `IOException` - raised on errors performing I/O.