@Override
  public boolean createSnapshot(File snapshotDir) {
    File schemaFileSnapshot =
        SystemFileFactory.INSTANCE.getFile(snapshotDir, SchemaConstant.PBTREE_SNAPSHOT);
    try {
      sync();
      if (schemaFileSnapshot.exists() && !schemaFileSnapshot.delete()) {
        logger.error(
            "Failed to delete old snapshot {} while creating pbtree file snapshot.",
            schemaFileSnapshot.getName());
        return false;
      }
      Files.copy(Paths.get(filePath), schemaFileSnapshot.toPath());
      return true;
    } catch (IOException e) {
      logger.error("Failed to create SchemaFile snapshot due to {}", e.getMessage(), e);
      schemaFileSnapshot.delete();
      return false;
    }
  }
TODO: shall merge with PageManager#reEstimateSegSize
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/schemafile/SchemaFile.java