public WALProtos.WALKey.Builder getBuilder(WALCellCodec.ByteStringCompressor compressor)
    throws IOException {
    WALProtos.WALKey.Builder builder = WALProtos.WALKey.newBuilder();
    builder.setEncodedRegionName(
      compressor.compress(this.encodedRegionName, CompressionContext.DictionaryIndex.REGION));
    builder.setTableName(
      compressor.compress(this.tablename.getName(), CompressionContext.DictionaryIndex.TABLE));
    builder.setLogSequenceNumber(getSequenceId());
    builder.setWriteTime(writeTime);
    if (this.origLogSeqNum > 0) {
      builder.setOrigSequenceNumber(this.origLogSeqNum);
    }
    if (this.nonce != HConstants.NO_NONCE) {
      builder.setNonce(nonce);
    }
    if (this.nonceGroup != HConstants.NO_NONCE) {
      builder.setNonceGroup(nonceGroup);
    }
    HBaseProtos.UUID.Builder uuidBuilder = HBaseProtos.UUID.newBuilder();
    for (UUID clusterId : clusterIds) {
      uuidBuilder.setLeastSigBits(clusterId.getLeastSignificantBits());
      uuidBuilder.setMostSigBits(clusterId.getMostSignificantBits());
      builder.addClusterIds(uuidBuilder.build());
    }
    if (replicationScope != null) {
      for (Map.Entry<byte[], Integer> e : replicationScope.entrySet()) {
        ByteString family =
          compressor.compress(e.getKey(), CompressionContext.DictionaryIndex.FAMILY);
        builder.addScopes(FamilyScope.newBuilder().setFamily(family)
          .setScopeType(ScopeType.forNumber(e.getValue())));
      }
    }
    if (extendedAttributes != null) {
      for (Map.Entry<String, byte[]> e : extendedAttributes.entrySet()) {
        WALProtos.Attribute attr = WALProtos.Attribute.newBuilder().setKey(e.getKey())
          .setValue(compressor.compress(e.getValue(), CompressionContext.DictionaryIndex.TABLE))
          .build();
        builder.addExtendedAttributes(attr);
      }
    }
    return builder;
  }
Drop this instance's region name byte array and instead hold a reference to the provided region
name. This is not meant to be a general purpose setter - it's only used to collapse references
to conserve memory.
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALKeyImpl.java