docs: private int cleanupSegmentsToMaintainSize(final Log log) throws IOException {
          if (logRetentionSize < 0 || log.size() < logRetentionSize) return 0;
  
          List<LogSegment> toBeDeleted = log.markDeletedWhile(new LogSegmentFilter() {
  
              long diff = log.size() - logRetentionSize;
  
              public boolean filter(LogSegment segment) {
                  diff -= segment.size();
                  return diff >= 0;
              }
          });
          return deleteSegments(log, toBeDeleted);
      }