@Override
  public void close() throws IOException {
    endFile();
    super.close();
  }
Writes buffer and update its' metadata.

@throws IOException when failing to write
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/io/WALWriter.java