Package org.apache.avro.hadoop.file

# Class SortedKeyValueFile.Writer<K,V>

java.lang.Object
org.apache.avro.hadoop.file.SortedKeyValueFile.Writer<K,V>

Type Parameters:
  `K` - The key type.
  `V` - The value type.

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Enclosing class:
  `SortedKeyValueFile`

public static class SortedKeyValueFile.Writer<K,V> extends Object implements Closeable
Writes a SortedKeyValueFile.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`SortedKeyValueFile.Writer.Options`
A class to encapsulate the various options of a SortedKeyValueFile.Writer.

## Constructor Summary

Constructors
Constructor
Description
`Writer(SortedKeyValueFile.Writer.Options options)`
Creates a writer for a new file.

## Method Summary

Modifier and Type
Method
Description
`void`
`append(K key, V value)`
Appends a record to the SortedKeyValueFile.
`void`
`close()`

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

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

## Constructor Details

### Writer

public Writer(SortedKeyValueFile.Writer.Options options) throws IOException
Creates a writer for a new file.

Parameters:
  `options` - The options.
Throws:
  `IOException` - If there is an error.

## Method Details

### append

public void append(K key, V value) throws IOException
Appends a record to the SortedKeyValueFile.

Parameters:
  `key` - The key.
  `value` - The value.
Throws:
  `IOException` - If there is an error.

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Throws:
  `IOException`