lmccay commented on a change in pull request #307: KNOX-2304 - CM discovery 
cluster config monitor needs to be aware of …
URL: https://github.com/apache/knox/pull/307#discussion_r405601417
 
 

 ##########
 File path: 
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/monitor/PollingConfigurationAnalyzer.java
 ##########
 @@ -365,12 +375,32 @@ private DiscoveryApiClient getApiClient(final 
ServiceDiscoveryConfig discoveryCo
                                                clusterName,
                                                lastTimestamp);
     for (ApiEvent event : events) {
-      restartEvents.add(new RestartEvent(event));
+      List<ApiEventAttribute> attributes = event.getAttributes();
+      Map<String,Object> map = getAttributeMap(attributes);
+      addIfRelevantEvent(restartEvents, event, map);
     }
 
     return restartEvents;
   }
 
+  @SuppressWarnings("unchecked")
+  private void addIfRelevantEvent(List<RestartEvent> restartEvents, ApiEvent 
event, Map<String, Object> map) {
 
 Review comment:
   I didn't see any point in changing it to reflect Start and Restart the are 
both "start" events. We can change to Start which is even a semantically 
meaningless change. I wanted to keep the map external rather than create it 
inside that method in case we need to add an additional use of the map later. 
We can move it in and refactor later if needed.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to