kangkaisen commented on a change in pull request #2781: Batch Operate Rollup 
table in Doris #2671
URL: https://github.com/apache/incubator-doris/pull/2781#discussion_r367953931
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/alter/MaterializedViewHandler.java
 ##########
 @@ -590,15 +767,130 @@ protected void runAfterCatalogReady() {
         runAlterJobV2();
     }
 
+    private synchronized Map<Long, AlterJobV2> getAlterJobsCopy () {
+        return new HashMap<>(alterJobsV2);
+    }
+
+    private void removeJobFromRunningQueue(RollupJobV2 rollupJobV2) {
+        Set<Long> runningJobIdSet = 
tableRunningJobMap.get(rollupJobV2.getTableId());
+        if (runningJobIdSet != null) {
+            runningJobIdSet.remove(rollupJobV2.getJobId());
+            if (runningJobIdSet.size() == 0) {
+                tableRunningJobMap.remove(rollupJobV2.getTableId());
+            }
+        }
+    }
+
+    private void changeTableStatus(long dbId, long tableId, OlapTableState 
olapTableState) {
+        Database db = Catalog.getCurrentCatalog().getDb(dbId);
+        db.readLock();
 
 Review comment:
   only use one write lock is enough.

----------------------------------------------------------------
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...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to