public synchronized void clear() throws IOException {
    fileOutputStream.close();

    if (logFile != null && logFile.exists()) {
      Files.delete(logFile.toPath());
    }
  }
This class provides the common ability to write a log storing T.

@param <T> the generic type
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/logfile/SchemaLogWriter.java