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.Builderself()Returns the current instance of the builder.protected voidvalidate()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:
buildin classJobTemplate.BaseBuilder<SparkJobTemplate.Builder,SparkJobTemplate> - Returns:
- a new instance of SparkJobTemplate
-
self
Description copied from class:JobTemplate.BaseBuilderReturns the current instance of the builder.- Specified by:
selfin classJobTemplate.BaseBuilder<SparkJobTemplate.Builder,SparkJobTemplate> - Returns:
- the current builder instance
-
validate
protected void validate()Description copied from class:JobTemplate.BaseBuilderValidates the parameters of the job template.- Overrides:
validatein classJobTemplate.BaseBuilder<SparkJobTemplate.Builder,SparkJobTemplate>
-