public void initRegionScanQueryDataSource(Map<IDeviceID, DeviceContext> devicePathsToContext)
      throws QueryProcessException {
    long startTime = System.nanoTime();
    if (devicePathsToContext == null) {
      return;
    }
    dataRegion.readLock();
    try {
      this.sharedQueryDataSource =
          dataRegion.queryForDeviceRegionScan(
              devicePathsToContext,
              this,
              globalTimeFilter != null ? globalTimeFilter.copy() : null,
              timePartitions);

      if (sharedQueryDataSource != null) {
        closedFilePaths = new HashSet<>();
        unClosedFilePaths = new HashSet<>();
        addUsedFilesForRegionQuery((QueryDataSourceForRegionScan) sharedQueryDataSource);
      }
    } finally {
      setInitQueryDataSourceCost(System.nanoTime() - startTime);
      dataRegion.readUnlock();
    }
  }
return List of specific throwable and stack trace
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java