[GitHub] nifi pull request #2276: NIFI-4615 processor status is set to the ProcessorS...
Github user mcgilman commented on a diff in the pull request: https://github.com/apache/nifi/pull/2276#discussion_r151711473 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java --- @@ -1083,13 +1083,15 @@ public ProcessorStatusDTO createProcessorStatusDto(final ProcessorStatus procSta dto.setGroupId(procStatus.getGroupId()); dto.setName(procStatus.getName()); dto.setStatsLastRefreshed(new Date()); +dto.setRunStatus(procStatus.getRunStatus().toString()); --- End diff -- I'm not sure I follow what "else" you're referring to. No change is needed when merging snapshots (line 384), that part is already correct. What we need to account for is the runStatus when merging status (line 354). We can account for the runStatus there using one of the two options I proposed above after merging the aggregate snapshot on line 363. ---
[GitHub] nifi pull request #2276: NIFI-4615 processor status is set to the ProcessorS...
Github user mcgilman commented on a diff in the pull request: https://github.com/apache/nifi/pull/2276#discussion_r151706697 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java --- @@ -1083,13 +1083,15 @@ public ProcessorStatusDTO createProcessorStatusDto(final ProcessorStatus procSta dto.setGroupId(procStatus.getGroupId()); dto.setName(procStatus.getName()); dto.setStatsLastRefreshed(new Date()); +dto.setRunStatus(procStatus.getRunStatus().toString()); --- End diff -- You cannot just set target.setRunStatus(toMerge.getRunStatus) in case target is invalid. I believe you have two options... 1) Duplicate the isValid check if (RunStatus.Invalid.name().equals(toMerge.getRunStatus())) { target.setRunStatus(RunStatus.Invalid.name()); } 2) Copy the calculated runStatus from the aggregate snapshot target.setRunStatus(target.getAggregateSnapshot().getRunStatus()); ---
[GitHub] nifi pull request #2276: NIFI-4615 processor status is set to the ProcessorS...
Github user sbouchex commented on a diff in the pull request: https://github.com/apache/nifi/pull/2276#discussion_r151703532 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java --- @@ -1083,13 +1083,15 @@ public ProcessorStatusDTO createProcessorStatusDto(final ProcessorStatus procSta dto.setGroupId(procStatus.getGroupId()); dto.setName(procStatus.getName()); dto.setStatsLastRefreshed(new Date()); +dto.setRunStatus(procStatus.getRunStatus().toString()); --- End diff -- So, something like target.setRunStatus(toMerge.getRunStatus()); ? ---
[GitHub] nifi pull request #2276: NIFI-4615 processor status is set to the ProcessorS...
Github user mcgilman commented on a diff in the pull request: https://github.com/apache/nifi/pull/2276#discussion_r151695374 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java --- @@ -1083,13 +1083,15 @@ public ProcessorStatusDTO createProcessorStatusDto(final ProcessorStatus procSta dto.setGroupId(procStatus.getGroupId()); dto.setName(procStatus.getName()); dto.setStatsLastRefreshed(new Date()); +dto.setRunStatus(procStatus.getRunStatus().toString()); --- End diff -- In addition to setting this here, we need to update it when merging responses in a clustered scenario. This merging happens to account for cases when a processor is invalid based on an environmental condition. A good example of this is a processor configured with a directory where that directory does not exist on one node of a cluster. On that node, the processor is invalid, but on the others that processor would be considered stopped. In this case, we need to ensure the invalid run status takes precedence. You can see an example of this here [1]. I think the easiest way to handle this would be to update the runStatus in the ProcessorStatusDTO when the method referenced in [1] returns when appropriate. Let me know if you have any questions about this. [1] https://github.com/apache/nifi/blob/2da72f15243ef62d47369e8a87cc202a82dbe004/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/manager/StatusMerger.java#L403 ---
[GitHub] nifi pull request #2276: NIFI-4615 processor status is set to the ProcessorS...
Github user mcgilman commented on a diff in the pull request: https://github.com/apache/nifi/pull/2276#discussion_r151693413 --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java --- @@ -1083,13 +1083,15 @@ public ProcessorStatusDTO createProcessorStatusDto(final ProcessorStatus procSta dto.setGroupId(procStatus.getGroupId()); dto.setName(procStatus.getName()); dto.setStatsLastRefreshed(new Date()); +dto.setRunStatus(procStatus.getRunStatus().toString()); final ProcessorStatusSnapshotDTO snapshot = new ProcessorStatusSnapshotDTO(); dto.setAggregateSnapshot(snapshot); snapshot.setId(procStatus.getId()); snapshot.setGroupId(procStatus.getGroupId()); snapshot.setName(procStatus.getName()); +snapshot.setRunStatus(procStatus.getRunStatus().toString()); --- End diff -- This is already being set a few lines below. ---
[GitHub] nifi pull request #2276: NIFI-4615 processor status is set to the ProcessorS...
GitHub user sbouchex opened a pull request: https://github.com/apache/nifi/pull/2276 NIFI-4615 processor status is set to the ProcessorStatusDTO object 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: - [x ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [x] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [ x] Has your PR been rebased against the latest commit within the target branch (typically master)? - [x ] Is your initial contribution a single, squashed commit? ### For code changes: - [x ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [x ] Have you written or updated unit tests to verify your changes? - [ x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ x] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [ x] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [x ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [x ] Have you ensured that format looks appropriate for the output in which it is rendered? ### 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. You can merge this pull request into a Git repository by running: $ git pull https://github.com/infovista/nifi NIFI-4615 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/2276.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2276 commit 329046a294118196c01c5d3c93d62f5479b23d55 Author: sbouchexDate: 2017-11-17T13:25:16Z processor status is set to the ProcessorStatusDTO object ---