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

Package org.apache.hadoop.mapred.lib

# Class FilterOutputFormat<K,V>

java.lang.Object
org.apache.hadoop.mapred.lib.FilterOutputFormat<K,V>

All Implemented Interfaces:
  `OutputFormat<K,V>`

Direct Known Subclasses:
  `LazyOutputFormat`

@Public @Stable public class FilterOutputFormat<K,V> extends Object implements 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.mapred.lib.FilterOutputFormat.FilterRecordWriter<K,V>`
  `FilterRecordWriter` is a convenience wrapper class that implements `RecordWriter`.

- ## Field Summary

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

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `checkOutputSpecs(FileSystem ignored, JobConf job)`
  Check for validity of the output-specification for the job.
  `RecordWriter<K,V>`
  `getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress)`
  Get the `RecordWriter` for the given job.

  ### 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> out)
    Create a FilterOutputFormat based on the supplied output format.
    Parameters:
      `out` - the underlying OutputFormat

- ## Method Details

  - ### getRecordWriter

    public RecordWriter<K,V> getRecordWriter(FileSystem ignored, JobConf job, String name, Progressable progress) throws IOException
    Description copied from interface: `OutputFormat`
    Get the `RecordWriter` for the given job.
    Specified by:
      `getRecordWriter` in interface `OutputFormat<K,V>`
      `job` - configuration for the job whose output is being written.
      `name` - the unique name for this part of the output.
      `progress` - mechanism for reporting progress while writing to file.
    Returns:
      a `RecordWriter` to write the output for the job.
    Throws:
      `IOException`

  - ### checkOutputSpecs

    public void checkOutputSpecs(FileSystem ignored, JobConf job) throws IOException
    Description copied from interface: `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 configuration.
    Specified by:
      `checkOutputSpecs` in interface `OutputFormat<K,V>`
      `job` - job configuration.
    Throws:
      `IOException` - when output should not be attempted