morningman commented on code in PR #26082: URL: https://github.com/apache/doris/pull/26082#discussion_r1377376429
########## fe/fe-core/src/main/java/org/apache/doris/scheduler/executor/JobExecutor.java: ########## @@ -28,18 +28,19 @@ * We use Gson to serialize and deserialize JobExecutor. so the implementation of JobExecutor needs to be serializable. * You can see @org.apache.doris.persist.gson.GsonUtils.java for details.When you implement JobExecutor,pls make sure * you can serialize and deserialize it. - * - * @param <T> The result type of the event job execution. */ @FunctionalInterface -public interface JobExecutor<T> { +public interface JobExecutor<T, C> { Review Comment: Update the comment? ########## fe/fe-core/src/main/java/org/apache/doris/analysis/CreateJobStmt.java: ########## @@ -136,7 +137,7 @@ public void analyze(Analyzer analyzer) throws UserException { job.setTimezone(timezone); job.setComment(comment); //todo support user define - job.setUser("root"); + job.setUser(ConnectContext.get().getQualifiedUser()); Review Comment: ConnectContext.get() maybe null, if this is not from MySQL connection. Have you consider this case? ########## fe/fe-core/src/main/cup/sql_parser.cup: ########## @@ -2551,17 +2551,17 @@ resource_desc ::= create_job_stmt ::= KW_CREATE KW_JOB job_label:jobLabel KW_ON KW_SCHEDULER KW_EVERY INTEGER_LITERAL:time_interval ident:time_unit opt_job_starts:startsTime opt_job_ends:endsTime opt_comment:comment KW_DO stmt:executeSql {: - CreateJobStmt stmt = new CreateJobStmt(jobLabel,null,false,time_interval,time_unit, startsTime, endsTime,comment,executeSql); + CreateJobStmt stmt = new CreateJobStmt(jobLabel,"RECURRING",null,time_interval,time_unit, startsTime, endsTime,comment,executeSql); Review Comment: better to define a enum? ########## fe/fe-core/src/main/java/org/apache/doris/scheduler/executor/AbstractJobExecutor.java: ########## @@ -0,0 +1,54 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.scheduler.executor; + +import org.apache.doris.analysis.UserIdentity; +import org.apache.doris.catalog.Env; +import org.apache.doris.cluster.ClusterNamespace; +import org.apache.doris.qe.ConnectContext; +import org.apache.doris.scheduler.job.Job; +import org.apache.doris.thrift.TUniqueId; + +import lombok.Getter; + +import java.util.UUID; + +@Getter +public abstract class AbstractJobExecutor<T, C> implements JobExecutor<T, C> { Review Comment: Add some comment to explain this class? -- 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