void flush() throws IOException {
    // TODO: try to flush only segments that require flushing.
    logger.trace("Flushing log");
    for (LogSegment segment : segmentsByName.values()) {
      segment.flush();
    }
  }
Flushes the Log and all its segments.
@throws IOException if the flush encountered an I/O error.
ambry-store/src/main/java/com/github/ambry/store/Log.java