@Override
  public synchronized void close() {
    if (deviceMeasurementsMap != null) {
      deviceMeasurementsMap = null;
    }

    if (deviceIsAlignedMap != null) {
      deviceIsAlignedMap = null;
    }

    if (measurementDataTypeMap != null) {
      measurementDataTypeMap = null;
    }

    if (allocatedMemoryBlock != null) {
      allocatedMemoryBlock.close();
      allocatedMemoryBlock = null;
    }

    try {
      Files.deleteIfExists(hardlinkOrCopiedFile.toPath());
    } catch (final Exception e) {
      LOGGER.error(
          "PipeTsFileResource: Failed to delete tsfile {} when closing, because {}. Please MANUALLY delete it.",
          hardlinkOrCopiedFile,
          e.getMessage(),
          e);
    }

    LOGGER.info("PipeTsFileResource: Closed tsfile {} and cleaned up.", hardlinkOrCopiedFile);
  }
this TsFileResource is used to track the {@link TsFileResourceStatus} of original TsFile. *
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/tsfile/PipeTsFileResource.java