private void loadAll(
        boolean isGeneratedByPipe,
        Map<TTimePartitionSlot, ProgressIndex> timePartitionProgressIndexMap)
        throws IOException, LoadFileException {
      if (isClosed) {
        throw new IOException(String.format(MESSAGE_WRITER_MANAGER_HAS_BEEN_CLOSED, taskDir));
      }
      for (final Map.Entry<DataPartitionInfo, ModificationFile> entry :
          dataPartition2ModificationFile.entrySet()) {
        entry.getValue().close();
      }
      for (final Map.Entry<DataPartitionInfo, TsFileIOWriter> entry :
          dataPartition2Writer.entrySet()) {
        final TsFileIOWriter writer = entry.getValue();
        if (writer.isWritingChunkGroup()) {
          writer.endChunkGroup();
        }
        writer.endFile();

        final DataRegion dataRegion = entry.getKey().getDataRegion();
        final TsFileResource tsFileResource = dataPartition2Resource.get(entry.getKey());
        endTsFileResource(
            writer,
            tsFileResource,
            timePartitionProgressIndexMap.getOrDefault(
                entry.getKey().getTimePartitionSlot(), MinimumProgressIndex.INSTANCE));
        dataRegion.loadNewTsFile(tsFileResource, true, isGeneratedByPipe, false);

        // Metrics
        dataRegion
            .getNonSystemDatabaseName()
            .ifPresent(
                databaseName ->
                    updateWritePointCountMetrics(
                        dataRegion, databaseName, getTsFileWritePointCount(writer), false));
      }
    }
It should be noted that all AlignedChunkData of the same partition split from a source file
should be guaranteed to be written to the same new file. Otherwise, for detached
BatchedAlignedChunkData, it may result in no data for the time column in the new file.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/LoadTsFileManager.java