Class SparkJobTemplate
Take Spark word count job as an example:
className: "org.apache.spark.examples.JavaWordCount" executable "https://example.com/spark-examples.jar" arguments: ["{{input_path}}", "{{output_path}}"] configs: {"spark.master": "local[*]", "spark.app.name": "WordCount"}
configs is a map of configuration parameters that will be used by the Spark application. It can be templated by using placeholders like "{{foo_value}}" and "{{bar_value}}". These placeholders will be replaced with actual values when the job is executed.
jars, files, and archives are lists of resources that will be used by the Spark application . These resources must be accessible to the Gravitino server, and can be located in the local file system, on a web server (e.g., HTTP, HTTPS, FTP). Distributed file systems like HDFS or S3 will be supported in the future.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder for creating instances ofSparkJobTemplate
.Nested classes/interfaces inherited from class org.apache.gravitino.job.JobTemplate
JobTemplate.BaseBuilder<B extends JobTemplate.BaseBuilder<B,
P>, P extends JobTemplate>, JobTemplate.JobType -
Field Summary
Fields inherited from class org.apache.gravitino.job.JobTemplate
arguments, comment, customFields, environments, executable, name
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SparkJobTemplate
(SparkJobTemplate.Builder builder) Constructs a SparkJobTemplate with the specified builder. -
Method Summary
Modifier and TypeMethodDescriptionarchives()
Returns the list of archives required for the Spark job.static SparkJobTemplate.Builder
builder()
Creates a new builder for constructing instances ofSparkJobTemplate
.Returns the class name of the Spark application to be executed.configs()
Returns the configuration map for the Spark job.boolean
files()
Returns the list of files required for the Spark job.int
hashCode()
jars()
Returns the list of JAR files required for the Spark job.jobType()
Get the job type.toString()
Methods inherited from class org.apache.gravitino.job.JobTemplate
arguments, comment, customFields, environments, executable, name
-
Constructor Details
-
SparkJobTemplate
Constructs a SparkJobTemplate with the specified builder.- Parameters:
builder
- the builder containing the configuration for the Spark job template
-
-
Method Details
-
className
Returns the class name of the Spark application to be executed.- Returns:
- the class name
-
jars
Returns the list of JAR files required for the Spark job.- Returns:
- the list of JAR files
-
files
Returns the list of files required for the Spark job.- Returns:
- the list of files
-
archives
Returns the list of archives required for the Spark job.- Returns:
- the list of archives
-
configs
Returns the configuration map for the Spark job.- Returns:
- the configuration map
-
jobType
Description copied from class:JobTemplate
Get the job type.- Specified by:
jobType
in classJobTemplate
- Returns:
- the type of the job template
-
equals
- Overrides:
equals
in classJobTemplate
-
hashCode
public int hashCode()- Overrides:
hashCode
in classJobTemplate
-
toString
- Overrides:
toString
in classJobTemplate
-
builder
Creates a new builder for constructing instances ofSparkJobTemplate
.- Returns:
- a new instance of
SparkJobTemplate.Builder
-