Skip to content

Commit b93692a

Browse files
author
Marcelo Vanzin
committed
Merge branch 'master' into SPARK-4924
Conflicts: bin/compute-classpath.sh bin/utils.sh bin/windows-utils.cmd core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala
2 parents ad03c48 + b0c0021 commit b93692a

File tree

490 files changed

+29567
-5445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

490 files changed

+29567
-5445
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To build Spark and its example programs, run:
2626

2727
(You do not need to do this if you downloaded a pre-built package.)
2828
More detailed documentation is available from the project site, at
29-
["Building Spark with Maven"](http://spark.apache.org/docs/latest/building-spark.html).
29+
["Building Spark"](http://spark.apache.org/docs/latest/building-spark.html).
3030

3131
## Interactive Scala Shell
3232

assembly/pom.xml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@
4343
</properties>
4444

4545
<dependencies>
46-
<!-- Promote Guava to compile scope in this module so it's included while shading. -->
47-
<dependency>
48-
<groupId>com.google.guava</groupId>
49-
<artifactId>guava</artifactId>
50-
<scope>compile</scope>
51-
</dependency>
5246
<dependency>
5347
<groupId>org.apache.spark</groupId>
5448
<artifactId>spark-core_${scala.binary.version}</artifactId>
@@ -133,20 +127,6 @@
133127
<goal>shade</goal>
134128
</goals>
135129
<configuration>
136-
<relocations>
137-
<relocation>
138-
<pattern>com.google</pattern>
139-
<shadedPattern>org.spark-project.guava</shadedPattern>
140-
<includes>
141-
<include>com.google.common.**</include>
142-
</includes>
143-
<excludes>
144-
<exclude>com/google/common/base/Absent*</exclude>
145-
<exclude>com/google/common/base/Optional*</exclude>
146-
<exclude>com/google/common/base/Present*</exclude>
147-
</excludes>
148-
</relocation>
149-
</relocations>
150130
<transformers>
151131
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
152132
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">

build/mvn

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ install_app() {
4848
# check if we already have the tarball
4949
# check if we have curl installed
5050
# download application
51-
[ ! -f "${local_tarball}" ] && [ -n "`which curl 2>/dev/null`" ] && \
51+
[ ! -f "${local_tarball}" ] && [ $(command -v curl) ] && \
5252
echo "exec: curl ${curl_opts} ${remote_tarball}" && \
5353
curl ${curl_opts} "${remote_tarball}" > "${local_tarball}"
5454
# if the file still doesn't exist, lets try `wget` and cross our fingers
55-
[ ! -f "${local_tarball}" ] && [ -n "`which wget 2>/dev/null`" ] && \
55+
[ ! -f "${local_tarball}" ] && [ $(command -v wget) ] && \
5656
echo "exec: wget ${wget_opts} ${remote_tarball}" && \
5757
wget ${wget_opts} -O "${local_tarball}" "${remote_tarball}"
5858
# if both were unsuccessful, exit
@@ -68,10 +68,10 @@ install_app() {
6868
# Install maven under the build/ folder
6969
install_mvn() {
7070
install_app \
71-
"http://apache.claz.org/maven/maven-3/3.2.3/binaries" \
72-
"apache-maven-3.2.3-bin.tar.gz" \
73-
"apache-maven-3.2.3/bin/mvn"
74-
MVN_BIN="${_DIR}/apache-maven-3.2.3/bin/mvn"
71+
"http://archive.apache.org/dist/maven/maven-3/3.2.5/binaries" \
72+
"apache-maven-3.2.5-bin.tar.gz" \
73+
"apache-maven-3.2.5/bin/mvn"
74+
MVN_BIN="${_DIR}/apache-maven-3.2.5/bin/mvn"
7575
}
7676

7777
# Install zinc under the build/ folder

build/sbt-launch-lib.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ acquire_sbt_jar () {
5050
# Download
5151
printf "Attempting to fetch sbt\n"
5252
JAR_DL="${JAR}.part"
53-
if hash curl 2>/dev/null; then
53+
if [ $(command -v curl) ]; then
5454
(curl --silent ${URL1} > "${JAR_DL}" || curl --silent ${URL2} > "${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
55-
elif hash wget 2>/dev/null; then
55+
elif [ $(command -v wget) ]; then
5656
(wget --quiet ${URL1} -O "${JAR_DL}" || wget --quiet ${URL2} -O "${JAR_DL}") && mv "${JAR_DL}" "${JAR}"
5757
else
5858
printf "You do not have curl or wget installed, please install sbt manually from http://www.scala-sbt.org/\n"

conf/metrics.properties.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
# period 10 Poll period
8888
# unit seconds Units of poll period
8989
# prefix EMPTY STRING Prefix to prepend to metric name
90+
# protocol tcp Protocol ("tcp" or "udp") to use
9091

9192
## Examples
9293
# Enable JmxSink for all instances by class name

core/pom.xml

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
<name>Spark Project Core</name>
3535
<url>http://spark.apache.org/</url>
3636
<dependencies>
37+
<dependency>
38+
<groupId>com.google.guava</groupId>
39+
<artifactId>guava</artifactId>
40+
</dependency>
3741
<dependency>
3842
<groupId>com.twitter</groupId>
3943
<artifactId>chill_${scala.binary.version}</artifactId>
@@ -95,32 +99,45 @@
9599
<groupId>org.apache.curator</groupId>
96100
<artifactId>curator-recipes</artifactId>
97101
</dependency>
102+
103+
<!-- Jetty dependencies promoted to compile here so they are shaded
104+
and inlined into spark-core jar -->
98105
<dependency>
99106
<groupId>org.eclipse.jetty</groupId>
100107
<artifactId>jetty-plus</artifactId>
108+
<scope>compile</scope>
101109
</dependency>
102110
<dependency>
103111
<groupId>org.eclipse.jetty</groupId>
104112
<artifactId>jetty-security</artifactId>
113+
<scope>compile</scope>
105114
</dependency>
106115
<dependency>
107116
<groupId>org.eclipse.jetty</groupId>
108117
<artifactId>jetty-util</artifactId>
118+
<scope>compile</scope>
109119
</dependency>
110120
<dependency>
111121
<groupId>org.eclipse.jetty</groupId>
112122
<artifactId>jetty-server</artifactId>
123+
<scope>compile</scope>
113124
</dependency>
114-
<!--
115-
Promote Guava to "compile" so that maven-shade-plugin picks it up (for packaging the Optional
116-
class exposed in the Java API). The plugin will then remove this dependency from the published
117-
pom, so that Guava does not pollute the client's compilation classpath.
118-
-->
119125
<dependency>
120-
<groupId>com.google.guava</groupId>
121-
<artifactId>guava</artifactId>
126+
<groupId>org.eclipse.jetty</groupId>
127+
<artifactId>jetty-http</artifactId>
128+
<scope>compile</scope>
129+
</dependency>
130+
<dependency>
131+
<groupId>org.eclipse.jetty</groupId>
132+
<artifactId>jetty-continuation</artifactId>
133+
<scope>compile</scope>
134+
</dependency>
135+
<dependency>
136+
<groupId>org.eclipse.jetty</groupId>
137+
<artifactId>jetty-servlet</artifactId>
122138
<scope>compile</scope>
123139
</dependency>
140+
124141
<dependency>
125142
<groupId>org.apache.commons</groupId>
126143
<artifactId>commons-lang3</artifactId>
@@ -209,26 +226,37 @@
209226
<artifactId>stream</artifactId>
210227
</dependency>
211228
<dependency>
212-
<groupId>com.codahale.metrics</groupId>
229+
<groupId>io.dropwizard.metrics</groupId>
213230
<artifactId>metrics-core</artifactId>
214231
</dependency>
215232
<dependency>
216-
<groupId>com.codahale.metrics</groupId>
233+
<groupId>io.dropwizard.metrics</groupId>
217234
<artifactId>metrics-jvm</artifactId>
218235
</dependency>
219236
<dependency>
220-
<groupId>com.codahale.metrics</groupId>
237+
<groupId>io.dropwizard.metrics</groupId>
221238
<artifactId>metrics-json</artifactId>
222239
</dependency>
223240
<dependency>
224-
<groupId>com.codahale.metrics</groupId>
241+
<groupId>io.dropwizard.metrics</groupId>
225242
<artifactId>metrics-graphite</artifactId>
226243
</dependency>
227244
<dependency>
228245
<groupId>org.apache.derby</groupId>
229246
<artifactId>derby</artifactId>
230247
<scope>test</scope>
231248
</dependency>
249+
<dependency>
250+
<groupId>org.apache.ivy</groupId>
251+
<artifactId>ivy</artifactId>
252+
<version>${ivy.version}</version>
253+
</dependency>
254+
<dependency>
255+
<groupId>oro</groupId>
256+
<!-- oro is needed by ivy, but only listed as an optional dependency, so we include it. -->
257+
<artifactId>oro</artifactId>
258+
<version>${oro.version}</version>
259+
</dependency>
232260
<dependency>
233261
<groupId>org.tachyonproject</groupId>
234262
<artifactId>tachyon-client</artifactId>
@@ -355,59 +383,28 @@
355383
<verbose>true</verbose>
356384
</configuration>
357385
</plugin>
358-
<plugin>
359-
<groupId>org.apache.maven.plugins</groupId>
360-
<artifactId>maven-shade-plugin</artifactId>
361-
<executions>
362-
<execution>
363-
<phase>package</phase>
364-
<goals>
365-
<goal>shade</goal>
366-
</goals>
367-
<configuration>
368-
<shadedArtifactAttached>false</shadedArtifactAttached>
369-
<artifactSet>
370-
<includes>
371-
<include>com.google.guava:guava</include>
372-
</includes>
373-
</artifactSet>
374-
<filters>
375-
<!-- See comment in the guava dependency declaration above. -->
376-
<filter>
377-
<artifact>com.google.guava:guava</artifact>
378-
<includes>
379-
<include>com/google/common/base/Absent*</include>
380-
<include>com/google/common/base/Optional*</include>
381-
<include>com/google/common/base/Present*</include>
382-
</includes>
383-
</filter>
384-
</filters>
385-
</configuration>
386-
</execution>
387-
</executions>
388-
</plugin>
389-
<!--
390-
Copy guava to the build directory. This is needed to make the SPARK_PREPEND_CLASSES
391-
option work in compute-classpath.sh, since it would put the non-shaded Spark classes in
392-
the runtime classpath.
393-
-->
394386
<plugin>
395387
<groupId>org.apache.maven.plugins</groupId>
396388
<artifactId>maven-dependency-plugin</artifactId>
397389
<executions>
390+
<!-- When using SPARK_PREPEND_CLASSES Spark classes compiled locally don't use
391+
shaded deps. So here we store jars in their original form which are added
392+
when the classpath is computed. -->
398393
<execution>
399394
<id>copy-dependencies</id>
400395
<phase>package</phase>
401396
<goals>
402397
<goal>copy-dependencies</goal>
403398
</goals>
404-
<configuration>
399+
<configuration>
405400
<outputDirectory>${project.build.directory}</outputDirectory>
406401
<overWriteReleases>false</overWriteReleases>
407402
<overWriteSnapshots>false</overWriteSnapshots>
408403
<overWriteIfNewer>true</overWriteIfNewer>
409404
<useSubDirectoryPerType>true</useSubDirectoryPerType>
410-
<includeArtifactIds>guava</includeArtifactIds>
405+
<includeArtifactIds>
406+
guava,jetty-io,jetty-servlet,jetty-continuation,jetty-http,jetty-plus,jetty-util,jetty-server
407+
</includeArtifactIds>
411408
<silent>true</silent>
412409
</configuration>
413410
</execution>
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.spark;
19+
20+
import org.apache.spark.scheduler.*;
21+
22+
/**
23+
* Class that allows users to receive all SparkListener events.
24+
* Users should override the onEvent method.
25+
*
26+
* This is a concrete Java class in order to ensure that we don't forget to update it when adding
27+
* new methods to SparkListener: forgetting to add a method will result in a compilation error (if
28+
* this was a concrete Scala class, default implementations of new event handlers would be inherited
29+
* from the SparkListener trait).
30+
*/
31+
public class SparkFirehoseListener implements SparkListener {
32+
33+
public void onEvent(SparkListenerEvent event) { }
34+
35+
@Override
36+
public final void onStageCompleted(SparkListenerStageCompleted stageCompleted) {
37+
onEvent(stageCompleted);
38+
}
39+
40+
@Override
41+
public final void onStageSubmitted(SparkListenerStageSubmitted stageSubmitted) {
42+
onEvent(stageSubmitted);
43+
}
44+
45+
@Override
46+
public final void onTaskStart(SparkListenerTaskStart taskStart) {
47+
onEvent(taskStart);
48+
}
49+
50+
@Override
51+
public final void onTaskGettingResult(SparkListenerTaskGettingResult taskGettingResult) {
52+
onEvent(taskGettingResult);
53+
}
54+
55+
@Override
56+
public final void onTaskEnd(SparkListenerTaskEnd taskEnd) {
57+
onEvent(taskEnd);
58+
}
59+
60+
@Override
61+
public final void onJobStart(SparkListenerJobStart jobStart) {
62+
onEvent(jobStart);
63+
}
64+
65+
@Override
66+
public final void onJobEnd(SparkListenerJobEnd jobEnd) {
67+
onEvent(jobEnd);
68+
}
69+
70+
@Override
71+
public final void onEnvironmentUpdate(SparkListenerEnvironmentUpdate environmentUpdate) {
72+
onEvent(environmentUpdate);
73+
}
74+
75+
@Override
76+
public final void onBlockManagerAdded(SparkListenerBlockManagerAdded blockManagerAdded) {
77+
onEvent(blockManagerAdded);
78+
}
79+
80+
@Override
81+
public final void onBlockManagerRemoved(SparkListenerBlockManagerRemoved blockManagerRemoved) {
82+
onEvent(blockManagerRemoved);
83+
}
84+
85+
@Override
86+
public final void onUnpersistRDD(SparkListenerUnpersistRDD unpersistRDD) {
87+
onEvent(unpersistRDD);
88+
}
89+
90+
@Override
91+
public final void onApplicationStart(SparkListenerApplicationStart applicationStart) {
92+
onEvent(applicationStart);
93+
}
94+
95+
@Override
96+
public final void onApplicationEnd(SparkListenerApplicationEnd applicationEnd) {
97+
onEvent(applicationEnd);
98+
}
99+
100+
@Override
101+
public final void onExecutorMetricsUpdate(
102+
SparkListenerExecutorMetricsUpdate executorMetricsUpdate) {
103+
onEvent(executorMetricsUpdate);
104+
}
105+
106+
@Override
107+
public final void onExecutorAdded(SparkListenerExecutorAdded executorAdded) {
108+
onEvent(executorAdded);
109+
}
110+
111+
@Override
112+
public final void onExecutorRemoved(SparkListenerExecutorRemoved executorRemoved) {
113+
onEvent(executorRemoved);
114+
}
115+
}

0 commit comments

Comments
 (0)