Package org.apache.avro.hadoop.file
Class SortedKeyValueFile
java.lang.Object
org.apache.avro.hadoop.file.SortedKeyValueFile
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
Modifier and TypeClassDescriptionstatic class
Reads a SortedKeyValueFile by loading the key index into memory.static class
Writes a SortedKeyValueFile. -
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
DATA_FILENAME
The name of the data file within the SortedKeyValueFile directory.- See Also:
-
INDEX_FILENAME
The name of the index file within the SortedKeyValueFile directory.- See Also:
-
-
Constructor Details
-
SortedKeyValueFile
public SortedKeyValueFile()
-