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 and 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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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 Detail

    - #### 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.
      Throws:
        `IOException`

    - #### 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.
      Throws:
        `IOException`

    - #### 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.
      Throws:
        `IOException`

  - ### Method Detail

    - #### 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.
      Throws:
        `IOException`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.