Skip to content

Commit 6f70eea

Browse files
author
Marcelo Vanzin
committed
[SPARK-4924] Add a library for launching Spark jobs programatically.
This change encapsulates all the logic involved in launching a Spark job into a small Java library that can be easily embedded into other applications. Only the `SparkLauncher` class is supposed to be public in the new launcher lib, but to be able to use those classes elsewhere in Spark some of the visibility modifiers were relaxed. This allows us to automate some checks in unit tests, when before you just had a comment that was easily missed. A subsequent commit will change Spark core and all the shell scripts to use this library instead of custom code that needs to be replicated for different OSes and, sometimes, also in Spark code.
1 parent a6394bc commit 6f70eea

File tree

14 files changed

+2131
-0
lines changed

14 files changed

+2131
-0
lines changed

launcher/pom.xml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Licensed to the Apache Software Foundation (ASF) under one or more
4+
~ contributor license agreements. See the NOTICE file distributed with
5+
~ this work for additional information regarding copyright ownership.
6+
~ The ASF licenses this file to You under the Apache License, Version 2.0
7+
~ (the "License"); you may not use this file except in compliance with
8+
~ the License. You may obtain a copy of the License at
9+
~
10+
~ http://www.apache.org/licenses/LICENSE-2.0
11+
~
12+
~ Unless required by applicable law or agreed to in writing, software
13+
~ distributed under the License is distributed on an "AS IS" BASIS,
14+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
~ See the License for the specific language governing permissions and
16+
~ limitations under the License.
17+
-->
18+
19+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21+
<modelVersion>4.0.0</modelVersion>
22+
<parent>
23+
<groupId>org.apache.spark</groupId>
24+
<artifactId>spark-parent</artifactId>
25+
<version>1.3.0-SNAPSHOT</version>
26+
<relativePath>../pom.xml</relativePath>
27+
</parent>
28+
29+
<groupId>org.apache.spark</groupId>
30+
<artifactId>spark-launcher_2.10</artifactId>
31+
<packaging>jar</packaging>
32+
<name>Spark Launcher Project</name>
33+
<url>http://spark.apache.org/</url>
34+
<properties>
35+
<sbt.project.name>launcher</sbt.project.name>
36+
</properties>
37+
38+
<dependencies>
39+
<!-- NOTE: only test-scope dependencies are allowed in this module. -->
40+
<dependency>
41+
<groupId>log4j</groupId>
42+
<artifactId>log4j</artifactId>
43+
<scope>test</scope>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.scalatest</groupId>
47+
<artifactId>scalatest_${scala.binary.version}</artifactId>
48+
<scope>test</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.slf4j</groupId>
52+
<artifactId>slf4j-api</artifactId>
53+
<scope>test</scope>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.slf4j</groupId>
57+
<artifactId>slf4j-log4j12</artifactId>
58+
<scope>test</scope>
59+
</dependency>
60+
</dependencies>
61+
62+
<build>
63+
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
64+
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
65+
<plugins>
66+
<plugin>
67+
<groupId>org.scalatest</groupId>
68+
<artifactId>scalatest-maven-plugin</artifactId>
69+
<configuration>
70+
<systemProperties>
71+
<spark.test.home>${project.basedir}/..</spark.test.home>
72+
</systemProperties>
73+
</configuration>
74+
</plugin>
75+
</plugins>
76+
</build>
77+
</project>

0 commit comments

Comments
 (0)