Skip to content

Commit cb39676

Browse files
committed
fix mcs
2 parents e8b5942 + 2c775f4 commit cb39676

File tree

280 files changed

+7931
-3142
lines changed

Some content is hidden

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

280 files changed

+7931
-3142
lines changed

.github/workflows/master.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- master
7+
pull_request:
8+
branches:
9+
- master
710

811
jobs:
912
build:
@@ -12,7 +15,11 @@ jobs:
1215
strategy:
1316
matrix:
1417
java: [ '1.8', '11' ]
15-
name: Build Spark with JDK ${{ matrix.java }}
18+
hadoop: [ 'hadoop-2.7', 'hadoop-3.2' ]
19+
exclude:
20+
- java: '11'
21+
hadoop: 'hadoop-2.7'
22+
name: Build Spark with JDK ${{ matrix.java }} and ${{ matrix.hadoop }}
1623

1724
steps:
1825
- uses: actions/checkout@master
@@ -22,6 +29,6 @@ jobs:
2229
version: ${{ matrix.java }}
2330
- name: Build with Maven
2431
run: |
25-
export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
32+
export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN"
2633
export MAVEN_CLI_OPTS="--no-transfer-progress"
27-
./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Phadoop-3.2 -Phadoop-cloud -Djava.version=${{ matrix.java }} package
34+
./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -P${{ matrix.hadoop }} -Phadoop-cloud -Djava.version=${{ matrix.java }} package

R/pkg/R/mllib_recommendation.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ setClass("ALSModel", representation(jobj = "jobj"))
8282
#' statsS <- summary(modelS)
8383
#' }
8484
#' @note spark.als since 2.1.0
85+
#' @note the input rating dataframe to the ALS implementation should be deterministic.
86+
#' Nondeterministic data can cause failure during fitting ALS model. For example,
87+
#' an order-sensitive operation like sampling after a repartition makes dataframe output
88+
#' nondeterministic, like \code{sample(repartition(df, 2L), FALSE, 0.5, 1618L)}.
89+
#' Checkpointing sampled dataframe or adding a sort before sampling can help make the
90+
#' dataframe deterministic.
8591
setMethod("spark.als", signature(data = "SparkDataFrame"),
8692
function(data, ratingCol = "rating", userCol = "user", itemCol = "item",
8793
rank = 10, regParam = 0.1, maxIter = 10, nonnegative = FALSE,

build/mvn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ _DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2222
# Preserve the calling directory
2323
_CALLING_DIR="$(pwd)"
2424
# Options used during compilation
25-
_COMPILE_JVM_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=512m"
25+
_COMPILE_JVM_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g"
2626

2727
# Installs any application tarball given a URL, the expected tarball name,
2828
# and, optionally, a checkable binary path to determine if the binary has

common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private static <T> Predicate<? super T> getPredicate(
252252

253253
return (value) -> set.contains(indexValueForEntity(getter, value));
254254
} else {
255-
HashSet<Comparable> set = new HashSet<>(values.size());
255+
HashSet<Comparable<?>> set = new HashSet<>(values.size());
256256
for (Object key : values) {
257257
set.add(asKey(key));
258258
}

common/kvstore/src/main/java/org/apache/spark/util/kvstore/KVTypeInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ interface Accessor {
124124

125125
Object get(Object instance) throws ReflectiveOperationException;
126126

127-
Class getType();
127+
Class<?> getType();
128128
}
129129

130130
private class FieldAccessor implements Accessor {
@@ -141,7 +141,7 @@ public Object get(Object instance) throws ReflectiveOperationException {
141141
}
142142

143143
@Override
144-
public Class getType() {
144+
public Class<?> getType() {
145145
return field.getType();
146146
}
147147
}
@@ -160,7 +160,7 @@ public Object get(Object instance) throws ReflectiveOperationException {
160160
}
161161

162162
@Override
163-
public Class getType() {
163+
public Class<?> getType() {
164164
return method.getReturnType();
165165
}
166166
}

common/network-common/pom.xml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
</properties>
3636

3737
<dependencies>
38+
<!-- SPARK-28932 This is required in JDK11 -->
39+
<dependency>
40+
<groupId>org.scala-lang</groupId>
41+
<artifactId>scala-library</artifactId>
42+
</dependency>
43+
3844
<!-- Core dependencies -->
3945
<dependency>
4046
<groupId>io.netty</groupId>
@@ -87,13 +93,6 @@
8793
</dependency>
8894

8995
<!-- Test dependencies -->
90-
<!-- SPARK-28932 This is required in JDK11 -->
91-
<dependency>
92-
<groupId>org.scala-lang</groupId>
93-
<artifactId>scala-library</artifactId>
94-
<version>${scala.version}</version>
95-
<scope>test</scope>
96-
</dependency>
9796
<dependency>
9897
<groupId>log4j</groupId>
9998
<artifactId>log4j</artifactId>

conf/metrics.properties.template

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@
113113
# /metrics/applications/json # App information
114114
# /metrics/master/json # Master information
115115

116+
# org.apache.spark.metrics.sink.PrometheusServlet
117+
# Name: Default: Description:
118+
# path VARIES* Path prefix from the web server root
119+
#
120+
# * Default path is /metrics/prometheus for all instances except the master. The
121+
# master has two paths:
122+
# /metrics/applications/prometheus # App information
123+
# /metrics/master/prometheus # Master information
124+
116125
# org.apache.spark.metrics.sink.GraphiteSink
117126
# Name: Default: Description:
118127
# host NONE Hostname of the Graphite server, must be set
@@ -192,4 +201,10 @@
192201

193202
#driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource
194203

195-
#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource
204+
#executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource
205+
206+
# Example configuration for PrometheusServlet
207+
#*.sink.prometheusServlet.class=org.apache.spark.metrics.sink.PrometheusServlet
208+
#*.sink.prometheusServlet.path=/metrics/prometheus
209+
#master.sink.prometheusServlet.path=/metrics/master/prometheus
210+
#applications.sink.prometheusServlet.path=/metrics/applications/prometheus
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
================================================================================================
2+
Properties Cloning
3+
================================================================================================
4+
5+
Java HotSpot(TM) 64-Bit Server VM 1.8.0_131-b11 on Mac OS X 10.14.6
6+
Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
7+
Empty Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
8+
------------------------------------------------------------------------------------------------------------------------
9+
SerializationUtils.clone 0 0 0 0.2 4184.0 1.0X
10+
Utils.cloneProperties 0 0 0 55.6 18.0 232.4X
11+
12+
Java HotSpot(TM) 64-Bit Server VM 1.8.0_131-b11 on Mac OS X 10.14.6
13+
Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
14+
System Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
15+
------------------------------------------------------------------------------------------------------------------------
16+
SerializationUtils.clone 0 0 0 0.0 107612.0 1.0X
17+
Utils.cloneProperties 0 0 0 1.0 962.0 111.9X
18+
19+
Java HotSpot(TM) 64-Bit Server VM 1.8.0_131-b11 on Mac OS X 10.14.6
20+
Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
21+
Small Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
22+
------------------------------------------------------------------------------------------------------------------------
23+
SerializationUtils.clone 0 0 0 0.0 330210.0 1.0X
24+
Utils.cloneProperties 0 0 0 0.9 1082.0 305.2X
25+
26+
Java HotSpot(TM) 64-Bit Server VM 1.8.0_131-b11 on Mac OS X 10.14.6
27+
Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
28+
Medium Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
29+
------------------------------------------------------------------------------------------------------------------------
30+
SerializationUtils.clone 1 2 0 0.0 1336301.0 1.0X
31+
Utils.cloneProperties 0 0 0 0.2 5456.0 244.9X
32+
33+
Java HotSpot(TM) 64-Bit Server VM 1.8.0_131-b11 on Mac OS X 10.14.6
34+
Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
35+
Large Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative
36+
------------------------------------------------------------------------------------------------------------------------
37+
SerializationUtils.clone 3 3 0 0.0 2634336.0 1.0X
38+
Utils.cloneProperties 0 0 0 0.1 10822.0 243.4X
39+
40+

core/src/main/java/org/apache/spark/ExecutorPlugin.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,15 @@ public interface ExecutorPlugin {
4040
* Initialize the executor plugin.
4141
*
4242
* <p>Each executor will, during its initialization, invoke this method on each
43-
* plugin provided in the spark.executor.plugins configuration.</p>
43+
* plugin provided in the spark.executor.plugins configuration. The Spark executor
44+
* will wait on the completion of the execution of the init method.</p>
4445
*
4546
* <p>Plugins should create threads in their implementation of this method for
4647
* any polling, blocking, or intensive computation.</p>
48+
*
49+
* @param pluginContext Context information for the executor where the plugin is running.
4750
*/
48-
default void init() {}
51+
default void init(ExecutorPluginContext pluginContext) {}
4952

5053
/**
5154
* Clean up and terminate this plugin.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 com.codahale.metrics.MetricRegistry;
21+
import org.apache.spark.annotation.DeveloperApi;
22+
import org.apache.spark.annotation.Private;
23+
24+
/**
25+
* Encapsulates information about the executor when initializing {@link ExecutorPlugin} instances.
26+
*/
27+
@DeveloperApi
28+
public class ExecutorPluginContext {
29+
30+
public final MetricRegistry metricRegistry;
31+
public final SparkConf sparkConf;
32+
public final String executorId;
33+
public final String executorHostName;
34+
public final boolean isLocal;
35+
36+
@Private
37+
public ExecutorPluginContext(
38+
MetricRegistry registry,
39+
SparkConf conf,
40+
String id,
41+
String hostName,
42+
boolean local) {
43+
metricRegistry = registry;
44+
sparkConf = conf;
45+
executorId = id;
46+
executorHostName = hostName;
47+
isLocal = local;
48+
}
49+
50+
}

0 commit comments

Comments
 (0)