public List<ModEntry> getPathModifications(
      TsFileResource tsFileResource, IDeviceID deviceID, String measurement) {
    // if the mods file does not exist, do not add it to the cache
    if (!checkIfModificationExists(tsFileResource)) {
      return Collections.emptyList();
    }

    List<ModEntry> modEntries =
        getAllModifications(tsFileResource).getOverlapped(deviceID, measurement);
    if (deviceID.isTableModel()) {
      // the pattern tree has false-positive for table model deletion, so we do a further
      //     filtering
      modEntries =
          modEntries.stream()
              .filter(mod -> mod.affects(deviceID) && mod.affects(measurement))
              .collect(Collectors.toList());
    }
    modEntries = ModificationUtils.sortAndMerge(modEntries);

    return modEntries;
  }
Every time we generate the queryContext, register it to queryTimeManager.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/QueryContext.java