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

    if (isTableModel) {
      final String databaseTableModel =
          databaseRawName.startsWith("root.") ? databaseRawName.substring(5) : databaseRawName;
      final TablePattern tablePattern =
          TablePattern.parsePipePatternFromSourceParameters(parameters);
      return tablePattern.isTableModelDataAllowedToBeCaptured()
          && tablePattern.matchesDatabase(databaseTableModel);
    } else {
      final String databaseTreeModel =
          databaseRawName.startsWith("root.") ? databaseRawName : "root." + databaseRawName;
      final TreePattern treePattern = TreePattern.parsePipePatternFromSourceParameters(parameters);
      return treePattern.isTreeModelDataAllowedToBeCaptured()
          && treePattern.mayOverlapWithDb(databaseTreeModel);
    }
  }
{@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