org.apache.hadoop.mapreduce.lib.output

## Class SequenceFileOutputFormat<K,V>

- java.lang.Object
- - org.apache.hadoop.mapreduce.OutputFormat<K,V>
  - - org.apache.hadoop.mapreduce.lib.output.FileOutputFormat<K,V>
    - - org.apache.hadoop.mapreduce.lib.output.SequenceFileOutputFormat<K,V>

- Direct Known Subclasses:
    SequenceFileAsBinaryOutputFormat

      @InterfaceAudience.Public
       @InterfaceStability.Stable
      public class SequenceFileOutputFormat<K,V>
      extends FileOutputFormat<K,V>

  An `OutputFormat` that writes `SequenceFile`s.

- - ### Field Summary

    - ### Fields inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat

      `BASE_OUTPUT_NAME, COMPRESS, COMPRESS_CODEC, COMPRESS_TYPE, OUTDIR, PART`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SequenceFileOutputFormat()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static org.apache.hadoop.io.SequenceFile.CompressionType` | `getOutputCompressionType(JobContext job)` Get the `SequenceFile.CompressionType` for the output `SequenceFile`.
    `RecordWriter<K,V>` | `getRecordWriter(TaskAttemptContext context)` Get the `RecordWriter` for the given task.
    `protected org.apache.hadoop.io.SequenceFile.Writer` | `getSequenceWriter(TaskAttemptContext context, Class<?> keyClass, Class<?> valueClass)`
    `static void` | `setOutputCompressionType(Job job, org.apache.hadoop.io.SequenceFile.CompressionType style)` Set the `SequenceFile.CompressionType` for the output `SequenceFile`.

    - ### Methods inherited from class org.apache.hadoop.mapreduce.lib.output.FileOutputFormat

      `checkOutputSpecs, getCompressOutput, getDefaultWorkFile, getOutputCommitter, getOutputCompressorClass, getOutputName, getOutputPath, getPathForWorkFile, getUniqueFile, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputName, setOutputPath`

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

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

- - ### Constructor Detail

    - #### SequenceFileOutputFormat

          public SequenceFileOutputFormat()

  - ### Method Detail

    - #### getSequenceWriter

          protected org.apache.hadoop.io.SequenceFile.Writer getSequenceWriter(TaskAttemptContext context,
                                                                               Class<?> keyClass,
                                                                               Class<?> valueClass)
                                                                        throws IOException

      Throws:
        `IOException`

    - #### getRecordWriter

          public RecordWriter<K,V> getRecordWriter(TaskAttemptContext context)
                                            throws IOException,
                                                   InterruptedException

      Description copied from class: `OutputFormat`
      Get the `RecordWriter` for the given task.
      Specified by:
        `getRecordWriter` in class `FileOutputFormat<K,V>`
      Parameters:
        `context` - the information about the current task.
      Returns:
        a `RecordWriter` to write the output for the job.
      Throws:
        `IOException`
        `InterruptedException`

    - #### getOutputCompressionType

          public static org.apache.hadoop.io.SequenceFile.CompressionType getOutputCompressionType(JobContext job)

      Get the `SequenceFile.CompressionType` for the output `SequenceFile`.
      Parameters:
        `job` - the `Job`
      Returns:
        the `SequenceFile.CompressionType` for the output `SequenceFile`, defaulting to `SequenceFile.CompressionType.RECORD`

    - #### setOutputCompressionType

          public static void setOutputCompressionType(Job job,
                                                      org.apache.hadoop.io.SequenceFile.CompressionType style)

      Set the `SequenceFile.CompressionType` for the output `SequenceFile`.
      Parameters:
        `job` - the `Job` to modify
        `style` - the `SequenceFile.CompressionType` for the output `SequenceFile`

Copyright © 2022 Apache Software Foundation. All rights reserved.