private void createHardLink(File target, File source) throws IOException {
    if (!target.getParentFile().exists()) {
      LOGGER.error("Hard link target dir {} doesn't exist", target.getParentFile());
    }
    if (!checkHardLinkSourceFile(source)) {
      return;
    }
    Files.deleteIfExists(target.toPath());
    Files.createLink(target.toPath(), source.toPath());
    snapshotLogger.logFile(source);
  }
SnapshotTaker takes data snapshot for a DataRegion in one time. It does so by creating hard link
for files or copying them. SnapshotTaker supports two different ways of snapshot: Full Snapshot
and Incremental Snapshot. The former takes a snapshot for all files in an empty directory, and
the latter takes a snapshot based on the snapshot that took before.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/snapshot/SnapshotTaker.java