mcvsubbu commented on a change in pull request #4089: In HelixBrokerStarter, 
allow custom cluster change handlers
URL: https://github.com/apache/incubator-pinot/pull/4089#discussion_r273313401
 
 

 ##########
 File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/ClusterChangeMediator.java
 ##########
 @@ -116,10 +117,20 @@ public void run() {
     };
   }
 
-  private void processClusterChange(ChangeType changeType, 
ClusterChangeHandler changeHandler) {
+  private void processClusterChange(ChangeType changeType, 
List<ClusterChangeHandler> changeHandlers) {
     long startTime = System.currentTimeMillis();
     LOGGER.info("Start processing {} change", changeType);
-    changeHandler.processClusterChange();
+    for (ClusterChangeHandler changeHandler : changeHandlers) {
+      try {
+        long handlerStartTime = System.currentTimeMillis();
+        changeHandler.processClusterChange(changeType);
+        LOGGER.info("Finish handling {} change for handler: {} in {}ms", 
changeType, changeHandler.getClass().getName(),
 
 Review comment:
   I would introduce a method in ClusterChangeHandler to get the name.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to