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.

  • Field Details

    • DATA_FILENAME

      public static final String DATA_FILENAME
      The name of the data file within the SortedKeyValueFile directory.
      See Also:
    • INDEX_FILENAME

      public static final String INDEX_FILENAME
      The name of the index file within the SortedKeyValueFile directory.
      See Also:
  • Constructor Details

    • SortedKeyValueFile

      public SortedKeyValueFile()