public static void addReadLock(List<TsFileResource> resources)
      throws CompactionSourceFileDeletedException {
    for (int i = 0; i < resources.size(); i++) {
      TsFileResource resource = resources.get(i);
      resource.readLock();
      if (resource.isDeleted()) {
        // release read lock
        for (int j = 0; j <= i; j++) {
          resources.get(j).readUnlock();
        }
        throw new CompactionSourceFileDeletedException(
            "source file " + resource.getTsFilePath() + " is deleted");
      }
    }
  }
Get the details of the tsfile, the returned array contains the following elements in sequence:

<p>total chunk num in this tsfile

<p>max chunk num of one timeseries in this tsfile

<p>max aligned series num in one device. If there is no aligned series in this file, then it
turns to be -1.

<p>max chunk num of one device in this tsfile

@throws IOException if io errors occurred
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/estimator/CompactionEstimateUtils.java