void onFillComplete(boolean updateMetric) {
      chunkBlobSize = buf.readableBytes();
      chunkFillCompleteAtMs = time.milliseconds();
      if (updateMetric) {
        routerMetrics.chunkFillTimeMs.update(time.milliseconds() - chunkFreeAtMs);
      }

      // Attempt to apply compression on data chunk.
      // If encryption is next, use Heap to store compression output since encryption takes heap buffer.
      // If no encryption, use direct memory to store compression output since it sends to Netty.
      compressChunk(!passedInBlobProperties.isEncrypted());

      if (!passedInBlobProperties.isEncrypted()) {
        prepareForSending();
        chunkReadyAtMs = time.milliseconds();
      } else {
        encryptChunk();
      }
    }
Do the actions required when the chunk has been completely built.
@param updateMetric whether chunk fill completion metrics should be updated.
ambry-router/src/main/java/com/github/ambry/router/PutOperation.java