public StoreMetrics getMetrics() {
    return metrics;
  }
Writes a header describing the segment.
@param capacityInBytes the intended capacity of the segment.
@throws StoreException if there is any store exception while writing to the file.
ambry-store/src/main/java/com/github/ambry/store/LogSegment.java