private void writeCompressed(byte[] data, Enum dictIndex) throws IOException {
      Dictionary dict = compressionContext.getDictionary(dictIndex);
      assert dict != null;
      short dictIdx = dict.findEntry(data, 0, data.length);
      if (dictIdx == Dictionary.NOT_IN_DICTIONARY) {
        write(Dictionary.NOT_IN_DICTIONARY);
        StreamUtils.writeRawVInt32(this, data.length);
        write(data, 0, data.length);
      } else {
        StreamUtils.writeShort(this, dictIdx);
      }
    }
Create and setup a {@link WALCellCodec} from the CompressionContext. Cell Codec classname is
read from {@link Configuration}. Fully prepares the codec for use.
@param conf        {@link Configuration} to read for the user-specified codec. If none is
                   specified, uses a {@link WALCellCodec}.
@param compression compression the codec should use
@return a {@link WALCellCodec} ready for use.
@throws UnsupportedOperationException if the codec cannot be instantiated
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCellCodec.java