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



##########
File path: 
helix-core/src/main/java/org/apache/helix/spectator/RoutingTableProvider.java
##########
@@ -403,16 +403,55 @@ public RoutingTableSnapshot 
getRoutingTableSnapshot(PropertyType propertyType, S
     return snapshots;
   }
 
+
   /**
    * Add RoutingTableChangeListener with user defined context
    * @param routingTableChangeListener
    * @param context user defined context
    */
   public void addRoutingTableChangeListener(
       final RoutingTableChangeListener routingTableChangeListener, Object 
context) {
+    addRoutingTableChangeListener(routingTableChangeListener, context, false);
+  }
+
+  /**
+   * Add RoutingTableChangeListener with user defined context
+   * @param routingTableChangeListener
+   * @param context user defined context
+   * @param doInit whether to trigger the initial callback during adding 
listener
+   */
+  public void addRoutingTableChangeListener(

Review comment:
       This is a high-level question. Have we considered doing init as the 
default behavior? Here are the reasons I can think off the top of my head:
   
   1. It doesn't hurt to init (what are the bad side effects of reading in the 
beginning? If the user wishes to add a listener, that means the user is ready 
to read and be notified). In other words, I can't think of any negative 
consequences of this behavior change or any potential backward-compatibility 
issues that might break things.
   
   2. This greatly reduces verbosity in the code. Simple is better.




----------------------------------------------------------------
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