byte[] toBytes() {
      /*
        Description of serialized format

        compactionDetails (see CompactionDetails#toBytes())
        copyStartTime
        commitStartTime
        cleanupStartTime
        cycleEndTime
        storeTokenPresent flag
        safeToken if not null (see StoreFindToken#toBytes())
       */
      byte[] compactionDetailsBytes = compactionDetails.toBytes();
      byte[] safeTokenBytes = safeToken != null ? safeToken.toBytes() : ZERO_LENGTH_ARRAY;
      int size =
          compactionDetailsBytes.length + 4 * TIMESTAMP_SIZE + STORE_TOKEN_PRESENT_FLAG_SIZE + safeTokenBytes.length;
      byte[] buf = new byte[size];
      ByteBuffer bufWrap = ByteBuffer.wrap(buf);
      bufWrap.put(compactionDetailsBytes);
      bufWrap.putLong(copyStartTime);
      bufWrap.putLong(commitStartTime);
      bufWrap.putLong(cleanupStartTime);
      bufWrap.putLong(cycleEndTime);
      bufWrap.put(safeToken != null ? STORE_TOKEN_PRESENT : STORE_TOKEN_ABSENT);
      bufWrap.put(safeTokenBytes);
      return buf;
    }
@return serialized version of the {@link CycleLog}.
ambry-store/src/main/java/com/github/ambry/store/CompactionLog.java