public void addDiskUsage(long size) {
    diskUsage += size;
    WALManager.getInstance().addTotalDiskUsage(size);
  }
Notice: only called by syncBufferThread and old log writer will be closed by this function.

@return last wal file
@throws IOException If failing to close or open the log writer
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/buffer/AbstractWALBuffer.java