@TestOnly
  public void save(Procedure procedure) throws IOException {
    File walTmp = new File(walFilePath + ".tmp");
    Path walTmpPath = walTmp.toPath();
    Files.deleteIfExists(walTmpPath);
    Files.createFile(walTmpPath);
    try (FileOutputStream fos = new FileOutputStream(walTmp);
        FileChannel channel = fos.getChannel();
        PublicBAOS publicBAOS = new PublicBAOS();
        DataOutputStream dataOutputStream = new DataOutputStream(publicBAOS)) {
      procedure.serialize(dataOutputStream);
      channel.write(ByteBuffer.wrap(publicBAOS.getBuf(), 0, publicBAOS.size()));

      channel.force(true);
      fos.getFD().sync();
    }
    Files.deleteIfExists(walFilePath);
    Files.move(walTmpPath, walFilePath);
  }
Create a wal file

@throws IOException ioe
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/procedure/store/ProcedureWAL.java