## org.apache.hadoop.mapreduce
Class RecordWriter<K,V>

    java.lang.Object
      org.apache.hadoop.mapreduce.RecordWriter<K,V>

Direct Known Subclasses:
  DBOutputFormat.DBRecordWriter, FilterOutputFormat.FilterRecordWriter, TextOutputFormat.LineRecordWriter

    public abstract class RecordWriter<K,V>

extends Object

`RecordWriter` writes the output <key, value> pairs to an output file.

`RecordWriter` implementations write the job outputs to the `FileSystem`.

See Also:
  `OutputFormat`

Constructor Summary
`RecordWriter()`

Method Summary
`abstract void` `close(TaskAttemptContext context)` Close this `RecordWriter` to future operations.
`abstract void` `write(K key, V value)` Writes a key/value pair.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RecordWriter

    public RecordWriter()

Method Detail

### write

    public abstract void write(K key,
                               V value)
                        throws IOException,
                               InterruptedException

  Writes a key/value pair.

  Parameters:
    `key` - the key to write.
    `value` - the value to write.
  Throws:
    `IOException`
    `InterruptedException`

### close

    public abstract void close(TaskAttemptContext context)
                        throws IOException,
                               InterruptedException

  Close this `RecordWriter` to future operations.

  Parameters:
    `context` - the context of the task
  Throws:
    `IOException`
    `InterruptedException`

Copyright © 2009 The Apache Software Foundation