mcvsubbu commented on a change in pull request #5066: Refactor existing Message 
Handler to update query quota on broker (Part 1)
URL: https://github.com/apache/incubator-pinot/pull/5066#discussion_r379597337
 
 

 ##########
 File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/BrokerMessageHandlerFactory.java
 ##########
 @@ -80,26 +92,54 @@ public void reset() {
   }
 
   public void shutdown() {
-    shuttingDown = true;
+    _shuttingDown = true;
   }
 
-  private class TimeboundaryRefreshMessageHandler extends MessageHandler {
-    private final String _tableNameWithType;
-    private final Logger _logger;
-
-    public TimeboundaryRefreshMessageHandler(TimeboundaryRefreshMessage 
message, NotificationContext context) {
+  private class TimeboundaryRefreshMessageHandler extends 
DefaultMessageHandler {
+    TimeboundaryRefreshMessageHandler(Message message, NotificationContext 
context) {
       super(message, context);
-      // The partition name field stores the table name.
-      _tableNameWithType = message.getPartitionName();
-      _logger = LoggerFactory.getLogger(_tableNameWithType + "-" + 
TimeboundaryRefreshMessageHandler.class);
     }
 
     @Override
     public HelixTaskResult handleMessage() {
       HelixTaskResult result = new HelixTaskResult();
       // Put the segment refresh request to a request queue instead of 
executing immediately. This will reduce the
       // burst of requests when a large number of segments are updated in a 
short time span.
-      _tablesToRefreshmap.put(_tableNameWithType, Boolean.TRUE);
+      _tablesToRefreshSet.add(_tableNameWithType);
+      result.setSuccess(true);
+      return result;
+    }
+  }
+
+  private class TableQueryQuotaUpdateMessageHandler extends 
DefaultMessageHandler {
+    TableQueryQuotaUpdateMessageHandler(Message message, NotificationContext 
context) {
+      super(message, context);
+    }
+
+    @Override
+    public HelixTaskResult handleMessage() {
+      HelixTaskResult result = new HelixTaskResult();
+      
_helixExternalViewBasedQueryQuotaManager.initOrUpdateTableQueryQuota(_tableNameWithType);
 
 Review comment:
   you can check if we are shutting down, then dont handle this

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