FilterOutputFormat (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.mapreduce.lib.output, class: FilterOutputFormat

Package org.apache.hadoop.mapreduce.lib.output

# Class FilterOutputFormat<K,V>

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

Direct Known Subclasses:
  `LazyOutputFormat`

@Public @Stable public class FilterOutputFormat<K,V> extends OutputFormat<K,V>
FilterOutputFormat is a convenience class that wraps OutputFormat.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `org.apache.hadoop.mapreduce.lib.output.FilterOutputFormat.FilterRecordWriter<K,V>`
  `FilterRecordWriter` is a convenience wrapper class that extends the `RecordWriter`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected OutputFormat<K,V>`
  `baseOut`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FilterOutputFormat()`
  `FilterOutputFormat(OutputFormat<K,V> baseOut)`
  Create a FilterOutputFormat based on the underlying output format.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkOutputSpecs(JobContext context)`
  Check for validity of the output-specification for the job.
  `OutputCommitter`
  `getOutputCommitter(TaskAttemptContext context)`
  Get the output committer for this output format.
  `RecordWriter<K,V>`
  `getRecordWriter(TaskAttemptContext context)`
  Get the `RecordWriter` for the given task.

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

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

- ## Field Details

  - ### baseOut

    protected OutputFormat<K,V> baseOut

- ## Constructor Details

  - ### FilterOutputFormat

    public FilterOutputFormat()

  - ### FilterOutputFormat

    public FilterOutputFormat(OutputFormat<K,V> baseOut)
    Create a FilterOutputFormat based on the underlying output format.
    Parameters:
      `baseOut` - the underlying OutputFormat

- ## Method Details

  - ### 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 `OutputFormat<K,V>`
    Parameters:
      `context` - the information about the current task.
    Returns:
      a `RecordWriter` to write the output for the job.
    Throws:
      `IOException`
      `InterruptedException`

  - ### checkOutputSpecs

    public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException
    Description copied from class: `OutputFormat`
    Check for validity of the output-specification for the job.

    This is to validate the output specification for the job when it is a job is submitted. Typically checks that it does not already exist, throwing an exception when it already exists, so that output is not overwritten.

    Implementations which write to filesystems which support delegation tokens usually collect the tokens for the destination path(s) and attach them to the job context's JobConf.
    Specified by:
      `checkOutputSpecs` in class `OutputFormat<K,V>`
    Parameters:
      `context` - information about the job
    Throws:
      `IOException` - when output should not be attempted
      `InterruptedException`

  - ### getOutputCommitter

    public OutputCommitter getOutputCommitter(TaskAttemptContext context) throws IOException, InterruptedException
    Description copied from class: `OutputFormat`
    Get the output committer for this output format. This is responsible for ensuring the output is committed correctly.
    Specified by:
      `getOutputCommitter` in class `OutputFormat<K,V>`
    Parameters:
      `context` - the task context
    Returns:
      an output committer
    Throws:
      `IOException`
      `InterruptedException`