You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/07/27 04:27:10 UTC

[GitHub] [nifi] thenatog commented on pull request #6154: NIFI-10070 - Updated merging of status DTO for ControllerService and …

thenatog commented on PR #6154:
URL: https://github.com/apache/nifi/pull/6154#issuecomment-1196252370

   I have been looking into this again and at the moment I believe I've found a bug in at least the ReportingTasksEndpointMerger and possibly other mergers. It might be worth getting Mark P's input on this.
   
   The issue I'm seeing is in this section of code:
   
   `        final Map<String, Map<NodeIdentifier, ReportingTaskEntity>> entityMap = new HashMap<>();
   
           for (final NodeResponse nodeResponse : successfulResponses) {
               final ReportingTasksEntity nodeResponseEntity = nodeResponse == clientResponse ? responseEntity : nodeResponse.getClientResponse().readEntity(ReportingTasksEntity.class);
               final Set<ReportingTaskEntity> nodeReportingTaskEntities = nodeResponseEntity.getReportingTasks();
   
               for (final ReportingTaskEntity nodeReportingTaskEntity : nodeReportingTaskEntities) {
                   final NodeIdentifier nodeId = nodeResponse.getNodeId();
                   Map<NodeIdentifier, ReportingTaskEntity> innerMap = entityMap.get(nodeId);
                   if (innerMap == null) {
                       innerMap = new HashMap<>();
                       entityMap.put(nodeReportingTaskEntity.getId(), innerMap); // this getId() is the same for all nodeReportingTaskEntity (it's the service's ID), so the map is overwritten each time
                   }
   
                   innerMap.put(nodeResponse.getNodeId(), nodeReportingTaskEntity);
               }
           }
   
           ReportingTasksEntityMerger.mergeReportingTasks(reportingTasksEntities, entityMap);
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org