[
https://issues.apache.org/jira/browse/NIFI-3393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15837819#comment-15837819
]
ASF GitHub Bot commented on NIFI-3393:
--------------------------------------
GitHub user pvillard31 opened a pull request:
https://github.com/apache/nifi/pull/1443
NIFI-3393 - replicates cluster/nodes/{id} to cluster coordinator
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-XXXX where XXXX 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?
- [ ] Have you written or updated unit tests to verify your 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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/pvillard31/nifi NIFI-3393
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/1443.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 #1443
----
commit b49a2f925a6055cf16b752d9c73ff20326061fe8
Author: Pierre Villard <[email protected]>
Date: 2017-01-25T14:31:39Z
NIFI-3393 - replicates cluster/nodes/{id} to cluster coordinator
----
> REST API - Inconsistency on /controller/cluster/nodes/{id}
> ----------------------------------------------------------
>
> Key: NIFI-3393
> URL: https://issues.apache.org/jira/browse/NIFI-3393
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Pierre Villard
> Priority: Minor
>
> According to which node is requested through the REST API, the end point
> {noformat}
> /controller/cluster/nodes/{id}
> {noformat}
> will not return the same result. This is due to the fact that in
> {{ControllerResource}}, the request is not replicated to the cluster
> coordinator.
> If this is not the expected behavior, the following code should be added:
> {noformat}
> if (isReplicateRequest()) {
> return replicate(HttpMethod.GET, getClusterCoordinatorNode());
> }
> {noformat}
> At the moment, if requesting the cluster coordinator, I get something like:
> {noformat}
> {u'node': {u'status': u'CONNECTED', u'roles': [], u'nodeId':
> u'd403e2c0-44a7-4c1c-aaa4-fed2ee3d6993', u'apiPort': 8443, u'events':
> [.....], u'nodeStartTime': u'01/25/2017 10:21:38 CET', u'address': u'node-1',
> u'heartbeat': u'01/25/2017 11:24:47 CET', u'queued': u'0 / 0 bytes',
> u'activeThreadCount': 0}}
> {noformat}
> And, on another node:
> {noformat}
> {u'node': {u'status': u'CONNECTED', u'roles': [], u'nodeId':
> u'd403e2c0-44a7-4c1c-aaa4-fed2ee3d6993', u'apiPort': 8443, u'address':
> u'node-1', u'events': []}}
> {noformat}
> In other words, all this part is missing:
> {noformat}
> // only connected nodes have heartbeats
> if (nodeHeartbeat != null) {
> final Date heartbeat = new Date(nodeHeartbeat.getTimestamp());
> nodeDto.setHeartbeat(heartbeat);
> nodeDto.setNodeStartTime(new
> Date(nodeHeartbeat.getSystemStartTime()));
>
> nodeDto.setActiveThreadCount(nodeHeartbeat.getActiveThreadCount());
>
> nodeDto.setQueued(FormatUtils.formatCount(nodeHeartbeat.getFlowFileCount()) +
> " / " + FormatUtils.formatDataSize(nodeHeartbeat.getFlowFileBytes()));
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)