private void cleanUpWhenFail(String snapshotId) {
    LOGGER.info("Cleaning up snapshot dir for {}", snapshotId);
    for (String dataDir : IoTDBDescriptor.getInstance().getConfig().getLocalDataDirs()) {
      File dataDirForThisSnapshot =
          new File(
              dataDir
                  + File.separator
                  + IoTDBConstant.SNAPSHOT_FOLDER_NAME
                  + File.separator
                  + snapshotId);
      if (dataDirForThisSnapshot.exists()) {
        try {
          FileUtils.recursivelyDeleteFolder(dataDirForThisSnapshot.getAbsolutePath());
        } catch (IOException e) {
          LOGGER.error(
              "Failed to delete folder {} when cleaning up",
              dataDirForThisSnapshot.getAbsolutePath());
        }
      }
    }
  }
Construct the snapshot file path for a given tsfile, and will create the dir. Eg, given a
tsfile in /data/iotdb/data/sequence/root.testsg/1/0/1-1-0-0.tsfile, with snapshotId "sm123",
the snapshot location will be /data/iotdb/data/snapshot/sm123/root.testsg/1/0/1-1-0-0.tsfile

@param tsFile tsfile to be taken a snapshot
@param snapshotId the id for current snapshot
@return the File object of the snapshot file, and its parent directory will be created
@throws IOException
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/SnapshotTaker.java