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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to