jerryshao commented on code in PR #7531:
URL: https://github.com/apache/gravitino/pull/7531#discussion_r2194265450


##########
api/src/main/java/org/apache/gravitino/job/JobTemplate.java:
##########
@@ -0,0 +1,335 @@
+/*
+ * 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.List;
+import java.util.Map;
+import java.util.Objects;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * JobTemplate is a class to define all the configuration parameters for a job.
+ *
+ * <p>JobType is enum to define the type of the job, because Gravitino needs 
different runtime
+ * environments to execute different types of jobs, so the job type is 
required.
+ *
+ * <p>Some parameters can be templated, which means that they can be replaced 
with actual values
+ * when running the job, for example, arguments can be { "{input_path}}", 
"{{output_path}" },
+ * environment variables can be { "foo": "{{foo_value}}", "bar": 
"{{bar_value}}" }. the parameters
+ * support templating are:
+ *
+ * <ul>
+ *   <li>arguments
+ *   <li>environments
+ * </ul>
+ */
+public abstract class JobTemplate {
+
+  /**
+   * JobType is an enum to define the type of the job.
+   *
+   * <p>Gravitino supports different types of jobs, such as Spark and Shell. 
The job type is
+   * required to determine the runtime environment for executing the job.
+   */
+  public enum JobType {
+
+    /** Job type for executing a Spark application. */
+    SPARK,
+
+    /** Job type for executing a shell command. */
+    SHELL,
+  }
+
+  /** The name of the job template. */
+  protected final String name;
+
+  /** The comment or description of the job template. */
+  protected final String comment;
+
+  /** The executable path for the job template. */
+  protected final String executable;
+
+  /** The list of arguments for the job template. */
+  protected final List<String> arguments;
+
+  /** The map of environment variables for the job template. */
+  protected final Map<String, String> environments;

Review Comment:
   My intention is that job template can provide the env variable placeholders, 
then user can replace the placeholders when running the job.



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

Reply via email to