Class CompressionState
java.lang.Object
org.apache.hadoop.hbase.io.encoding.CompressionState
- Direct Known Subclasses:
DiffKeyDeltaEncoder.DiffCompressionState
,FastDiffDeltaEncoder.FastDiffCompressionState
Stores the state of data block encoder at the beginning of new key.
-
Field Summary
Modifier and TypeFieldDescription(package private) byte
private static final int
(package private) int
(package private) int
(package private) int
(package private) short
(package private) byte
(package private) int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) void
copyFrom
(CompressionState state) (package private) boolean
isFirst()
(package private) void
readKey
(ByteBuffer in, int keyLength, int valueLength) Analyze the key and fill the state.(package private) void
readKey
(ByteBuffer in, int keyLength, int valueLength, int commonPrefix, CompressionState previousState) Analyze the key and fill the state assuming we know previous state.protected void
-
Field Details
-
keyLength
int keyLength -
valueLength
int valueLength -
rowLength
short rowLength -
prevOffset
int prevOffset -
familyLength
byte familyLength -
qualifierLength
int qualifierLength -
type
byte type -
FIRST_KEY
- See Also:
-
-
Constructor Details
-
CompressionState
-
-
Method Details
-
isFirst
boolean isFirst() -
readKey
Analyze the key and fill the state. Uses mark() and reset() in ByteBuffer.- Parameters:
in
- Buffer at the position where key startskeyLength
- Length of key in bytesvalueLength
- Length of values in bytes
-
readKey
void readKey(ByteBuffer in, int keyLength, int valueLength, int commonPrefix, CompressionState previousState) Analyze the key and fill the state assuming we know previous state. Uses mark() and reset() in ByteBuffer to avoid moving the position.This method overrides all the fields of this instance, except
prevOffset
, which is usually manipulated directly by encoders and decoders.- Parameters:
in
- Buffer at the position where key startskeyLength
- Length of key in bytesvalueLength
- Length of values in bytescommonPrefix
- how many first bytes are common with previous KeyValuepreviousState
- State from previous KeyValue
-
readTimestamp
-
copyFrom
-