SaintBacchus commented on code in PR #20108:
URL: https://github.com/apache/doris/pull/20108#discussion_r1210249236


##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVJobManager.java:
##########
@@ -324,14 +328,13 @@ public boolean killJobTask(String jobName, boolean 
clearPending) {
         return taskManager.killTask(job.getId(), clearPending);
     }
 
-    public MTMVUtils.TaskSubmitStatus refreshMTMVTask(String dbName, String 
mvName) throws DdlException {
-        for (String jobName : nameToJobMap.keySet()) {
-            MTMVJob job = nameToJobMap.get(jobName);
-            if (job.getMVName().equals(mvName) && 
job.getDBName().equals(dbName)) {
-                return submitJobTask(jobName);
-            }
-        }
-        throw new DdlException("No job find for the MaterializedView " + 
dbName + "." + mvName + " .");
+    public MTMVUtils.TaskSubmitStatus refreshMTMVTask(String dbName, String 
mvName)
+            throws DdlException, MetaNotFoundException {
+        Database db = 
Env.getCurrentInternalCatalog().getDbOrDdlException(dbName);
+        MaterializedView mv = (MaterializedView) 
db.getTableOrMetaException(mvName, TableType.MATERIALIZED_VIEW);
+        MTMVJob mtmvJob = MTMVJobFactory.genOnceJob(mv, dbName);
+        Env.getCurrentEnv().getMTMVJobManager().createJob(mtmvJob, false);

Review Comment:
   why use `Env.getCurrentEnv().getMTMVJobManager()`?  It's OK to use 
`createJob()`



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to