Jackie-Jiang commented on a change in pull request #3819: Refactor periodic task
URL: https://github.com/apache/incubator-pinot/pull/3819#discussion_r256195484
 
 

 ##########
 File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
 ##########
 @@ -69,58 +65,50 @@ public SegmentStatusChecker(PinotHelixResourceManager 
pinotHelixResourceManager,
   }
 
   @Override
-  public void initTask() {
+  protected void setUpTask() {
     LOGGER.info("Initializing table metrics for all the tables.");
     setStatusToDefault();
   }
 
   @Override
-  protected void preprocess() {
-    _realTimeTableCount = 0;
-    _offlineTableCount = 0;
-    _disabledTableCount = 0;
-
+  protected Context preprocess() {
+    Context context = new Context();
     // check if we need to log disabled tables log messages
     long now = System.currentTimeMillis();
     if (now - _lastDisabledTableLogTimestamp >= 
DISABLED_TABLE_LOG_INTERVAL_MS) {
-      _logDisabledTables = true;
+      context._logDisabledTables = true;
       _lastDisabledTableLogTimestamp = now;
-    } else {
-      _logDisabledTables = false;
     }
+    return context;
   }
 
   @Override
-  protected void processTable(String tableNameWithType) {
-    updateSegmentMetrics(tableNameWithType);
-  }
-
-  @Override
-  protected void exceptionHandler(String tableNameWithType, Exception e) {
 
 Review comment:
   After consideration, I still think this exception handling logic should be 
wrapped inside the processTable(). It might need some variables from the 
processTable(), which are not accessible with this callback handler.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: dev-unsubscr...@pinot.apache.org
For additional commands, e-mail: dev-h...@pinot.apache.org

Reply via email to