Class CompressionState

java.lang.Object
org.apache.hadoop.hbase.io.encoding.CompressionState
Direct Known Subclasses:
DiffKeyDeltaEncoder.DiffCompressionState, FastDiffDeltaEncoder.FastDiffCompressionState

@Private class CompressionState extends Object
Stores the state of data block encoder at the beginning of new key.
  • Field Details

  • Constructor Details

  • Method Details

    • isFirst

      boolean isFirst()
    • readKey

      void readKey(ByteBuffer in, int keyLength, int valueLength)
      Analyze the key and fill the state. Uses mark() and reset() in ByteBuffer.
      Parameters:
      in - Buffer at the position where key starts
      keyLength - Length of key in bytes
      valueLength - 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 starts
      keyLength - Length of key in bytes
      valueLength - Length of values in bytes
      commonPrefix - how many first bytes are common with previous KeyValue
      previousState - State from previous KeyValue
    • readTimestamp

      protected void readTimestamp(ByteBuffer in)
    • copyFrom