jiajunwang commented on a change in pull request #1154:
URL: https://github.com/apache/helix/pull/1154#discussion_r456041505



##########
File path: 
helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java
##########
@@ -413,6 +413,31 @@ public void addRoutingTableChangeListener(
     _routingTableChangeListenerMap.put(routingTableChangeListener, new 
ListenerContext(context));
     logger.info("Attach RoutingTableProviderChangeListener {}",
         routingTableChangeListener.getClass().getName());
+    if (_sourceDataTypeMap.isEmpty()) {
+      
routingTableChangeListener.onRoutingTableChange(getRoutingTableSnapshot(), 
context);
+    } else {
+      for (PropertyType propertyType : _sourceDataTypeMap.keySet()) {

Review comment:
       For example, this constructor allows the user to create a map of types.
   ```
     public RoutingTableProvider(HelixManager helixManager, Map<PropertyType, 
List<String>> sourceDataTypeMap) {
       this(helixManager, sourceDataTypeMap, true, 
DEFAULT_PERIODIC_REFRESH_INTERVAL);
     }
   ```
   But we don't have a way for the user to specify the listener for different 
types. So one listener will be triggered multiple times if multiple types are 
specified.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to