Package org.apache.gravitino.job
Class JobTemplate.BaseBuilder<B extends JobTemplate.BaseBuilder<B,P>,P extends JobTemplate>
java.lang.Object
org.apache.gravitino.job.JobTemplate.BaseBuilder<B,P>
- Direct Known Subclasses:
ShellJobTemplate.Builder
,SparkJobTemplate.Builder
- Enclosing class:
- JobTemplate
public abstract static class JobTemplate.BaseBuilder<B extends JobTemplate.BaseBuilder<B,P>,P extends JobTemplate>
extends Object
Builder class for constructing JobTemplate instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract P
build()
Build the JobTemplate instance.protected abstract B
self()
Returns the current instance of the builder.protected void
validate()
Validates the parameters of the job template.withArguments
(List<String> arguments) Set the arguments for the job template.withComment
(String comment) Set the comment for the job template.withCustomFields
(Map<String, String> customFields) Set the custom fields for the job template.withEnvironments
(Map<String, String> environments) Set the environment variables for the job template.withExecutable
(String executable) Set the executable for the job template.Set the name of the job template.
-
Constructor Details
-
BaseBuilder
protected BaseBuilder()Constructor for the BaseBuilder. This constructor is protected to ensure that only subclasses can instantiate it.
-
-
Method Details
-
self
Returns the current instance of the builder.- Returns:
- the current builder instance
-
build
Build the JobTemplate instance.- Returns:
- the constructed JobTemplate instance
-
withName
Set the name of the job template.- Parameters:
name
- the name of the job template.- Returns:
- this Builder instance
-
withComment
Set the comment for the job template.- Parameters:
comment
- the comment or description of the job template- Returns:
- this Builder instance
-
withExecutable
Set the executable for the job template.- Parameters:
executable
- the path to the executable- Returns:
- this Builder instance
-
withArguments
Set the arguments for the job template.- Parameters:
arguments
- the list of arguments- Returns:
- this Builder instance
-
withEnvironments
Set the environment variables for the job template.- Parameters:
environments
- the map of environment variables- Returns:
- this Builder instance
-
withCustomFields
Set the custom fields for the job template.- Parameters:
customFields
- the map of custom fields- Returns:
- this Builder instance
-
validate
protected void validate()Validates the parameters of the job template.
-