public enum EncodingType extends java.lang.Enum<EncodingType>
The value will determine how to encode keys when writing to a new SST file.
This value will be stored inside the SST file which will be used when reading from the file, which makes it possible for users to choose different encoding type when reopening a DB. Files with different encoding types can co-exist in the same DB and can be read.
| 枚举常量和说明 |
|---|
kPlain
Always write full keys without any special encoding.
|
kPrefix
Find opportunity to write the same prefix once for multiple rows.
|
| 限定符和类型 | 方法和说明 |
|---|---|
byte |
getValue()
Returns the byte value of the enumerations value
|
static EncodingType |
valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。
|
static EncodingType[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final EncodingType kPlain
public static final EncodingType kPrefix
Find opportunity to write the same prefix once for multiple rows. In some cases, when a key follows a previous key with the same prefix, instead of writing out the full key, it just writes out the size of the shared prefix, as well as other bytes, to save some bytes.
When using this option, the user is required to use the same prefix extractor to make sure the same prefix will be extracted from the same key. The Name() value of the prefix extractor will be stored in the file. When reopening the file, the name of the options.prefix_extractor given will be bitwise compared to the prefix extractors stored in the file. An error will be returned if the two don't match.
public static EncodingType[] values()
for (EncodingType c : EncodingType.values()) System.out.println(c);
public static EncodingType valueOf(java.lang.String name)
name - 要返回的枚举常量的名称。java.lang.IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException - 如果参数为空值public byte getValue()