amrishlal commented on a change in pull request #7174:
URL: https://github.com/apache/pinot/pull/7174#discussion_r687923747



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/periodictask/ControllerPeriodicTask.java
##########
@@ -54,14 +54,22 @@ public ControllerPeriodicTask(String taskName, long 
runFrequencyInSeconds, long
     _controllerMetrics = controllerMetrics;
   }
 
+  // Determine if this task can run on the specified table. Task can run on 
all tables for which the controller is lead
+  // if "tablename" property is not set. However, if "tablename" property is 
set (by calling the /periodictask/run
+  // controller API), then the task will only run on the specified by the 
"tablename" property key.
+  private boolean runTaskForTable(String tableNameWithType) {
+    return _leadControllerManager.isLeaderForTable(tableNameWithType) && 
(_activePeriodicTaskProperties == null
+        || ((String) 
_activePeriodicTaskProperties.get("tablename")).equalsIgnoreCase(tableNameWithType));

Review comment:
       Done




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

To unsubscribe, e-mail: [email protected]

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