public void deleteIfExists() throws IOException {
        try {
            Utils.tryAll(asList(
                () -> deleteTypeIfExists(() -> log.deleteIfExists(), "log", log.file(), true),
                () -> deleteTypeIfExists(() -> lazyOffsetIndex.deleteIfExists(), "offset index", offsetIndexFile(), true),
                () -> deleteTypeIfExists(() -> lazyTimeIndex.deleteIfExists(), "time index", timeIndexFile(), true),
                () -> deleteTypeIfExists(() -> txnIndex.deleteIfExists(), "transaction index", txnIndex.file(), false)));
        } catch (Throwable t) {
            if (t instanceof IOException)
                throw (IOException) t;
            if (t instanceof Error)
                throw (Error) t;
            if (t instanceof RuntimeException)
                throw (RuntimeException) t;
            throw new IllegalStateException("Unexpected exception: " + t.getMessage(), t);
        }
    }
Delete this log segment from the filesystem.
storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java