public static boolean shouldDataRegionBeListened(
      PipeParameters parameters, DataRegionId dataRegionId) throws IllegalPathException {
    final Pair<Boolean, Boolean> insertionDeletionListeningOptionPair =
        parseInsertionDeletionListeningOptionPair(parameters);
    final boolean hasSpecificListeningOption =
        insertionDeletionListeningOptionPair.getLeft()
            || insertionDeletionListeningOptionPair.getRight();
    if (!hasSpecificListeningOption) {
      return false;
    }

    final DataRegion dataRegion = StorageEngine.getInstance().getDataRegion(dataRegionId);
    if (dataRegion == null) {
      return true;
    }

    final String databaseRawName = dataRegion.getDatabaseName();
    final String databaseTreeModel =
        databaseRawName.startsWith("root.") ? databaseRawName : "root." + databaseRawName;
    final String databaseTableModel =
        databaseRawName.startsWith("root.") ? databaseRawName.substring(5) : databaseRawName;

    final TreePattern treePattern = TreePattern.parsePipePatternFromSourceParameters(parameters);
    final TablePattern tablePattern = TablePattern.parsePipePatternFromSourceParameters(parameters);

    return treePattern.isTreeModelDataAllowedToBeCaptured()
            && treePattern.mayOverlapWithDb(databaseTreeModel)
        || tablePattern.isTableModelDataAllowedToBeCaptured()
            && tablePattern.matchesDatabase(databaseTableModel);
  }
{@link DataRegionListeningFilter} is to tell the insertion and deletion for {@link PipeTask} on
{@link DataRegion} to collect.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/dataregion/DataRegionListeningFilter.java