Package org.apache.gravitino.job
Class SparkJobTemplate.Builder
java.lang.Object
org.apache.gravitino.job.JobTemplate.BaseBuilder<SparkJobTemplate.Builder,SparkJobTemplate>
org.apache.gravitino.job.SparkJobTemplate.Builder
- Enclosing class:
- SparkJobTemplate
public static class SparkJobTemplate.Builder
extends JobTemplate.BaseBuilder<SparkJobTemplate.Builder,SparkJobTemplate>
Builder for creating instances of
SparkJobTemplate
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the SparkJobTemplate instance with the specified parameters.protected SparkJobTemplate.Builder
self()
Returns the current instance of the builder.protected void
validate()
Validates the parameters of the job template.withArchives
(List<String> archives) Sets the list of archives required for the Spark job.withClassName
(String className) Sets the class name of the Spark application to be executed.withConfigs
(Map<String, String> configs) Sets the configuration map for the Spark job.Sets the list of files required for the Spark job.Sets the list of JAR files required for the Spark job.Methods inherited from class org.apache.gravitino.job.JobTemplate.BaseBuilder
withArguments, withComment, withCustomFields, withEnvironments, withExecutable, withName
-
Method Details
-
withClassName
Sets the class name of the Spark application to be executed.- Parameters:
className
- the class name- Returns:
- the builder instance for method chaining
-
withJars
Sets the list of JAR files required for the Spark job.- Parameters:
jars
- the list of JAR files- Returns:
- the builder instance for method chaining
-
withFiles
Sets the list of files required for the Spark job.- Parameters:
files
- the list of files- Returns:
- the builder instance for method chaining
-
withArchives
Sets the list of archives required for the Spark job.- Parameters:
archives
- the list of archives- Returns:
- the builder instance for method chaining
-
withConfigs
Sets the configuration map for the Spark job.- Parameters:
configs
- the configuration map- Returns:
- the builder instance for method chaining
-
build
Builds the SparkJobTemplate instance with the specified parameters.- Specified by:
build
in classJobTemplate.BaseBuilder<SparkJobTemplate.Builder,
SparkJobTemplate> - Returns:
- a new instance of SparkJobTemplate
-
self
Description copied from class:JobTemplate.BaseBuilder
Returns the current instance of the builder.- Specified by:
self
in classJobTemplate.BaseBuilder<SparkJobTemplate.Builder,
SparkJobTemplate> - Returns:
- the current builder instance
-
validate
protected void validate()Description copied from class:JobTemplate.BaseBuilder
Validates the parameters of the job template.- Overrides:
validate
in classJobTemplate.BaseBuilder<SparkJobTemplate.Builder,
SparkJobTemplate>
-