code: private void discardSegment(final CommitLogSegment segment, final boolean deleteFile)
      {
          logger.debug("Segment {} is no longer active and will be deleted {}", segment, deleteFile ? "now" : "by the archive script");
          size.addAndGet(-DatabaseDescriptor.getCommitLogSegmentSize());
  
          segmentManagementTasks.add(new Callable<CommitLogSegment>()
          {
              public CommitLogSegment call()
              {
                  segment.close();
                  if (deleteFile)
                      segment.delete();
                  return null;
              }
          });
      }
docs: Indicates that a segment file should be deleted.
  
  @param segment segment to be discarded