[
https://issues.apache.org/jira/browse/NIFI-4768?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16323488#comment-16323488
]
ASF GitHub Bot commented on NIFI-4768:
--------------------------------------
Github user ijokarumawak commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2397#discussion_r161131729
--- Diff:
nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/main/java/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumer.java
---
@@ -235,6 +251,32 @@ private boolean isFilteringEnabled() {
for (ProvenanceEventRecord provenanceEventRecord :
provenanceEvents) {
final String componentId =
provenanceEventRecord.getComponentId();
+ if (!componentIdsExclude.isEmpty()) {
+ if (componentIdsExclude.contains(componentId)) {
+ continue;
+ }
+ // If we aren't excluding it based on component ID,
let's see if this component has a parent process group IDs
+ // that is being excluded
+ if (componentMapHolder == null) {
+ continue;
+ }
+ final String processGroupId =
componentMapHolder.getProcessGroupId(componentId,
provenanceEventRecord.getComponentType());
+ if (StringUtils.isEmpty(processGroupId)) {
+ continue;
--- End diff --
Do we want to skip events if processGroupId is not found for one? We
probably better to apply the exclude rule if a processGroupId is known,
different from inclusion rules. Unknown should NOT be filtered out by exclusion
rules IMO.
> Add exclusion filters to SiteToSiteProvenanceReportingTask
> ----------------------------------------------------------
>
> Key: NIFI-4768
> URL: https://issues.apache.org/jira/browse/NIFI-4768
> Project: Apache NiFi
> Issue Type: Improvement
> Reporter: Matt Burgess
> Assignee: Matt Burgess
>
> Although the SiteToSiteProvenanceReportingTask has filters for which events,
> components, etc. to capture, it is an inclusive filter, meaning if a filter
> is set, only those entities' events will be sent. However it would be useful
> to also have an exclusionary filter, in order to capture all events except a
> few.
> One particular use case is a sub-flow that processes provenance events, where
> the user would not want to process provenance events generated by components
> involved in the provenance-handling flow itself. In this fashion, for
> example, if the sub-flow is in a process group (PG), then the user could
> exclude the PG and the Input Port sending events to it, thereby allowing the
> sub-flow to process all other events except those involved with the
> provenance-handling flow itself.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)