q763562998 commented on code in PR #17884:
URL: https://github.com/apache/doris/pull/17884#discussion_r1160395074


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/RefreshManager.java:
##########
@@ -146,4 +159,45 @@ private void 
refreshInternalCtlIcebergTable(RefreshTableStmt stmt, Env env) thro
                 stmt.getTableName(), "ICEBERG", icebergProperties, "");
         env.createTable(createTableStmt);
     }
+
+    public void addToRefreshMap(long catalogId, Integer[] sec) {
+        refreshMap.put(catalogId, sec);
+    }
+
+    public void removeFromRefreshMap(long catalogId) {
+        refreshMap.remove(catalogId);
+    }
+
+    public void start() {
+        TaskRefresh taskRefresh = new TaskRefresh();
+        this.refreshScheduler.scheduleAtFixedRate(taskRefresh, 0, REFRESH_TIME,
+                TimeUnit.SECONDS);
+    }
+
+    private class TaskRefresh implements Runnable {
+        @Override
+        public void run() {
+            for (Map.Entry<Long, Integer[]> entry : refreshMap.entrySet()) {
+                Long catalogId = entry.getKey();
+                Integer[] timeGroup = entry.getValue();
+                Integer original = timeGroup[0];
+                Integer current = timeGroup[1];
+                if (current - REFRESH_TIME > 0) {
+                    timeGroup[1] = current - REFRESH_TIME;
+                    refreshMap.put(catalogId, timeGroup);
+                } else {
+                    String catalogName = 
Env.getCurrentEnv().getCatalogMgr().getCatalog(catalogId).getName();

Review Comment:
   Ok,I will check if the return value of `getCatalog` is null



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