FANNG1 commented on code in PR #8644:
URL: https://github.com/apache/gravitino/pull/8644#discussion_r2377414956
##########
core/src/main/java/org/apache/gravitino/job/JobManager.java:
##########
@@ -503,7 +503,32 @@ void pullAndUpdateJobStatus() {
activeJobs.forEach(
job -> {
- JobHandle.Status newStatus =
jobExecutor.getJobStatus(job.jobExecutionId());
+ JobHandle.Status newStatus = job.status();
+ try {
+ newStatus = jobExecutor.getJobStatus(job.jobExecutionId());
+ } catch (NoSuchJobException e) {
+ // If the job is not found in the external job executor, we
assume the job is
Review Comment:
Which conditions will throw `NoSuchJobException`? why not using a new
stats like `UNKNOWN`?
##########
api/src/main/java/org/apache/gravitino/job/JobTemplateChange.java:
##########
@@ -0,0 +1,701 @@
+/*
+ * 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.gravitino.job;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * The interface for job template changes. A job template change is an
operation that modifies a job
+ * template. It can be one of the following:
+ *
+ * <ul>
+ * <li>Rename the job template.
+ * <li>Update the comment of the job template.
+ * <li>Update the job template details, such as executable, arguments,
environments, custom
+ * fields, etc.
+ * </ul>
+ */
+public interface JobTemplateChange {
+
+ /**
+ * Creates a new job template change to update the name of the job template.
+ *
+ * @param newName The new name of the job template.
+ * @return The job template change.
+ */
+ static JobTemplateChange rename(String newName) {
Review Comment:
For `newName`, `newComment`, could user pass a `null` value? Should we add
a validation?
--
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]