Enum Class DataBlockEncoding
- All Implemented Interfaces:
Serializable
,Comparable<DataBlockEncoding>
,Constable
Provide access to all data block encoding algorithms. All of the algorithms are required to have
unique id which should NEVER be changed. If you want to add a new algorithm/version,
assign it a new id. Announce the new id in the HBase mailing list to prevent collisions.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate DataBlockEncoder
private final String
private final short
static final int
private static DataBlockEncoding[]
Maps data block encoding ids to enum instances.private final byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static DataBlockEncoder
createEncoder
(String fullyQualifiedClassName) static DataBlockEncoder
getDataBlockEncoderById
(short encoderId) Find and create data block encoder for given id;Return new data block encoder for given algorithm type.static DataBlockEncoding
getEncodingById
(short dataBlockEncodingId) short
getId()
Returns The id of a data block encoder.static String
getNameFromId
(short encoderId) Find and return the name of data block encoder for the given id.byte[]
Returns name converted to bytes.static boolean
isCorrectEncoder
(DataBlockEncoder encoder, short encoderId) Check if given encoder has this id.static DataBlockEncoding
Returns the enum constant of this class with the specified name.static DataBlockEncoding[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.void
writeIdInBytes
(byte[] dest, int offset) Writes id bytes to the given array starting from offset.void
writeIdInBytes
(OutputStream stream) Writes id in bytes.
-
Enum Constant Details
-
NONE
Disable data block encoding. -
PREFIX
-
DIFF
-
FAST_DIFF
-
ROW_INDEX_V1
-
-
Field Details
-
id
-
idInBytes
-
encoder
-
encoderCls
-
ID_SIZE
- See Also:
-
idArray
Maps data block encoding ids to enum instances.
-
-
Constructor Details
-
DataBlockEncoding
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getNameInBytes
Returns name converted to bytes. -
getId
Returns The id of a data block encoder. -
writeIdInBytes
Writes id in bytes.- Parameters:
stream
- where the id should be written.- Throws:
IOException
-
writeIdInBytes
Writes id bytes to the given array starting from offset.- Parameters:
dest
- output arrayoffset
- starting offset of the output array- Throws:
IOException
-
getEncoder
Return new data block encoder for given algorithm type.- Returns:
- data block encoder if algorithm is specified, null if none is selected.
-
getDataBlockEncoderById
Find and create data block encoder for given id;- Parameters:
encoderId
- id of data block encoder.- Returns:
- Newly created data block encoder.
-
getNameFromId
Find and return the name of data block encoder for the given id.- Parameters:
encoderId
- id of data block encoder- Returns:
- name, same as used in options in column family
-
isCorrectEncoder
Check if given encoder has this id.- Parameters:
encoder
- encoder which id will be checkedencoderId
- id which we except- Returns:
- true if id is right for given encoder, false otherwise
- Throws:
IllegalArgumentException
- thrown when there is no matching data block encoder
-
getEncodingById
-
createEncoder
-