org.apache.avro.hadoop.file

## Class SortedKeyValueFile

- java.lang.Object
- - org.apache.avro.hadoop.file.SortedKeyValueFile

    public class SortedKeyValueFile
    extends Object

A SortedKeyValueFile is an indexed Avro container file of KeyValue records sorted by key.

The SortedKeyValueFile is a directory with two files, named 'data' and 'index'. The 'data' file is an ordinary Avro container file with records. Each record has exactly two fields, 'key' and 'value'. The keys are sorted lexicographically. The 'index' file is a small Avro container file mapping keys in the 'data' file to their byte positions. The index file is intended to fit in memory, so it should remain small. There is one entry in the index file for each data block in the Avro container file.

SortedKeyValueFile is to Avro container file as MapFile is to SequenceFile.

### Nested Class Summary

Nested Classes
`static class` `SortedKeyValueFile.Reader<K,V>` Reads a SortedKeyValueFile by loading the key index into memory.
`static class` `SortedKeyValueFile.Writer<K,V>` Writes a SortedKeyValueFile.

### Field Summary

Fields
`static String` `DATA_FILENAME` The name of the data file within the SortedKeyValueFile directory.
`static String` `INDEX_FILENAME` The name of the index file within the SortedKeyValueFile directory.

### Constructor Summary

Constructors
Constructor and Description
`SortedKeyValueFile()`

### Method Summary

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

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

### Field Detail

#### DATA_FILENAME

    public static final String DATA_FILENAME

The name of the data file within the SortedKeyValueFile directory.

See Also:
  Constant Field Values

#### INDEX_FILENAME

    public static final String INDEX_FILENAME

The name of the index file within the SortedKeyValueFile directory.

See Also:
  Constant Field Values

### Constructor Detail

#### SortedKeyValueFile

    public SortedKeyValueFile()