NIFI-5561 - Add component name filtering to S2S Provenance Reporting …#2973
NIFI-5561 - Add component name filtering to S2S Provenance Reporting …#2973pvillard31 wants to merge 4 commits intoapache:masterfrom
Conversation
|
I created a flow which uses 3 The template is available here. |
| return componentTypeRegex != null || !eventTypes.isEmpty() || !componentIds.isEmpty() | ||
| || componentTypeRegexExclude != null || !eventTypesExclude.isEmpty() || !componentIdsExclude.isEmpty(); | ||
| || componentTypeRegexExclude != null || !eventTypesExclude.isEmpty() || !componentIdsExclude.isEmpty() | ||
| || componentNameRegex != null || componentNameRegexExclude != null; |
There was a problem hiding this comment.
In general, I don't push changing "traditional" code blocks to "new" style just for the sake of it, but in this case, I think a Java 8-style .stream() construction will make this clearer (some of these fields are List and some are Pattern, and the Pattern can be empty/blank (which is not checked here), which would not (logically) enable filtering.
I made two commits (a regression test on the current logic and a new implementation) and it still works. Personally, I think this form is clearer and will scale more gracefully if new properties are added. Let me know your thoughts.
There was a problem hiding this comment.
Yeah agree, I added your two commits on this pull request. Thanks!
| .description("Regular expression to filter the provenance events based on the component name. Only the events matching the regular " | ||
| + "expression will be sent. If no filter is set, all the events are sent. If multiple filters are set, the filters are cumulative.") | ||
| .required(false) | ||
| .addValidator(StandardValidators.REGULAR_EXPRESSION_VALIDATOR) |
There was a problem hiding this comment.
Should these properties support Expression Language (Variables Only)? I can imagine a variable being set with a "component name filter" specific to a process group. Thoughts?
There was a problem hiding this comment.
Since it's a reporting task, it won't access the variable registries defined at UI-level. I believe this will only access the global file-based variable registry (defined in nifi.properties) and the environment/jvm variables. Not sure this provides much value but on the other hand it's easy to add. Thoughts?
There was a problem hiding this comment.
Our CM story is still really developing at this point, so I would say whatever could be done to help facilitate making it easier for admins to configure NiFi in a standardized way is going to make the a little happier even if it's just "copy and paste this EL string."
There was a problem hiding this comment.
Fair enough, I'll add it on the properties. On a related note, I hope to find time to start exploring NIFI-5367 to enable VR scope by default in NiFi.
There was a problem hiding this comment.
That's an excellent point about the VR scoping that I forgot. I think this is nominally more "consistent" across the app, but you're right that it's not as valuable as I expected. Thanks.
…as other attributes are added using Streams.
|
Added VR scope on properties and fixed indentation to have the same everywhere. To see the changes and masking the indentation changes: https://github.com/apache/nifi/pull/2973/files?w=1 |
|
Thanks Pierre. Running a final check and will merge. |

…Task
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
Has your PR been rebased against the latest commit within the target branch (typically master)?
Is your initial contribution a single, squashed commit?
For code changes:
For documentation related changes:
Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.