@Override
    public void write(ExtendedCell cell) throws IOException {
      // We first write the KeyValue infrastructure as VInts.
      StreamUtils.writeRawVInt32(out, KeyValueUtil.keyLength(cell));
      StreamUtils.writeRawVInt32(out, cell.getValueLength());
      // To support tags
      int tagsLength = cell.getTagsLength();
      StreamUtils.writeRawVInt32(out, tagsLength);
      PrivateCellUtil.compressRow(out, cell,
        compression.getDictionary(CompressionContext.DictionaryIndex.ROW));
      PrivateCellUtil.compressFamily(out, cell,
        compression.getDictionary(CompressionContext.DictionaryIndex.FAMILY));
      PrivateCellUtil.compressQualifier(out, cell,
        compression.getDictionary(CompressionContext.DictionaryIndex.QUALIFIER));
      // Write timestamp, type and value.
      StreamUtils.writeLong(out, cell.getTimestamp());
      out.write(cell.getTypeByte());
      if (hasValueCompression) {
        writeCompressedValue(out, cell);
      } else {
        PrivateCellUtil.writeValue(out, cell, cell.getValueLength());
      }
      if (tagsLength > 0) {
        if (hasTagCompression) {
          // Write tags using Dictionary compression
          PrivateCellUtil.compressTags(out, cell, compression.tagCompressionContext);
        } else {
          // Tag compression is disabled within the WAL compression. Just write the tags bytes as
          // it is.
          PrivateCellUtil.writeTags(out, cell, tagsLength);
        }
      }
    }
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