Skip to content

Commit 6ff0522

Browse files
committed
Merge branch 'master' into SPARK-35112
2 parents 700efa4 + 11ea255 commit 6ff0522

File tree

339 files changed

+8664
-3380
lines changed

Some content is hidden

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

339 files changed

+8664
-3380
lines changed

.github/PULL_REQUEST_TEMPLATE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Thanks for sending a pull request! Here are some tips for you:
88
6. If possible, provide a concise example to reproduce the issue for a faster review.
99
7. If you want to add a new configuration, please read the guideline first for naming configurations in
1010
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
11+
8. If you want to add or modify an error message, please read the guideline first:
12+
https://spark.apache.org/error-message-guidelines.html
1113
-->
1214

1315
### What changes were proposed in this pull request?

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
.ensime_cache/
1616
.ensime_lucene
1717
.generated-mima*
18-
.idea/
18+
# The star is required for further !.idea/ to work, see https://git-scm.com/docs/gitignore
19+
.idea/*
20+
!.idea/vcs.xml
1921
.idea_modules/
2022
.project
2123
.pydevproject

.idea/vcs.xml

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

R/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ export R_HOME=/home/username/R
1717

1818
#### Build Spark
1919

20-
Build Spark with [Maven](https://spark.apache.org/docs/latest/building-spark.html#buildmvn) and include the `-Psparkr` profile to build the R package. For example to use the default Hadoop versions you can run
20+
Build Spark with [Maven](https://spark.apache.org/docs/latest/building-spark.html#buildmvn) or [SBT](https://spark.apache.org/docs/latest/building-spark.html#building-with-sbt), and include the `-Psparkr` profile to build the R package. For example to use the default Hadoop versions you can run
2121

2222
```bash
23+
# Maven
2324
./build/mvn -DskipTests -Psparkr package
25+
26+
# SBT
27+
./build/sbt -Psparkr package
2428
```
2529

2630
#### Running sparkR

R/pkg/DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Depends:
2020
Suggests:
2121
knitr,
2222
rmarkdown,
23+
markdown,
2324
testthat,
2425
e1071,
2526
survival,

R/pkg/tests/fulltests/test_mllib_classification.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ test_that("spark.svmLinear", {
3838
expect_true(class(summary$coefficients[, 1]) == "numeric")
3939

4040
coefs <- summary$coefficients[, "Estimate"]
41-
expected_coefs <- c(-0.06004978, -0.1563083, -0.460648, 0.2276626, 1.055085)
41+
expected_coefs <- c(-6.8823988, -0.6154984, -1.5135447, 1.9694126, 3.3736856)
4242
expect_true(all(abs(coefs - expected_coefs) < 0.1))
4343

4444
# Test prediction with string label
4545
prediction <- predict(model, training)
4646
expect_equal(typeof(take(select(prediction, "prediction"), 1)$prediction), "character")
47-
expected <- c("versicolor", "versicolor", "versicolor", "virginica", "virginica",
48-
"virginica", "virginica", "virginica", "virginica", "virginica")
47+
expected <- c("versicolor", "versicolor", "versicolor", "versicolor", "versicolor",
48+
"versicolor", "versicolor", "versicolor", "versicolor", "versicolor")
4949
expect_equal(sort(as.list(take(select(prediction, "prediction"), 10))[[1]]), expected)
5050

5151
# Test model save and load

build/mvn

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ _COMPILE_JVM_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g"
3131
## Arg2 - Tarball Name
3232
## Arg3 - Checkable Binary
3333
install_app() {
34-
local remote_tarball="$1/$2"
34+
local remote_tarball="$1"
3535
local local_tarball="${_DIR}/$2"
3636
local binary="${_DIR}/$3"
3737

@@ -71,19 +71,20 @@ install_mvn() {
7171
local MVN_DETECTED_VERSION="$(mvn --version | head -n1 | awk '{print $3}')"
7272
fi
7373
if [ $(version $MVN_DETECTED_VERSION) -lt $(version $MVN_VERSION) ]; then
74-
local APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua?action=download&filename='}
75-
74+
local FILE_PATH="maven/maven-3/${MVN_VERSION}/binaries/apache-maven-${MVN_VERSION}-bin.tar.gz"
75+
local APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua'}
76+
local MIRROR_URL="${APACHE_MIRROR}/${FILE_PATH}?action=download"
77+
7678
if [ $(command -v curl) ]; then
77-
local TEST_MIRROR_URL="${APACHE_MIRROR}/maven/maven-3/${MVN_VERSION}/binaries/apache-maven-${MVN_VERSION}-bin.tar.gz"
78-
if ! curl -L --output /dev/null --silent --head --fail "$TEST_MIRROR_URL" ; then
79+
if ! curl -L --output /dev/null --silent --head --fail "${MIRROR_URL}" ; then
7980
# Fall back to archive.apache.org for older Maven
8081
echo "Falling back to archive.apache.org to download Maven"
81-
APACHE_MIRROR="https://archive.apache.org/dist"
82+
MIRROR_URL="https://archive.apache.org/dist/${FILE_PATH}"
8283
fi
8384
fi
8485

8586
install_app \
86-
"${APACHE_MIRROR}/maven/maven-3/${MVN_VERSION}/binaries" \
87+
"${MIRROR_URL}" \
8788
"apache-maven-${MVN_VERSION}-bin.tar.gz" \
8889
"apache-maven-${MVN_VERSION}/bin/mvn"
8990

@@ -102,7 +103,7 @@ install_scala() {
102103
local TYPESAFE_MIRROR=${TYPESAFE_MIRROR:-https://downloads.lightbend.com}
103104

104105
install_app \
105-
"${TYPESAFE_MIRROR}/scala/${scala_version}" \
106+
"${TYPESAFE_MIRROR}/scala/${scala_version}/scala-${scala_version}.tgz" \
106107
"scala-${scala_version}.tgz" \
107108
"scala-${scala_version}/bin/scala"
108109

conf/log4j.properties.template

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ log4j.appender.console.target=System.err
2222
log4j.appender.console.layout=org.apache.log4j.PatternLayout
2323
log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n
2424

25-
# Set the default spark-shell log level to WARN. When running the spark-shell, the
26-
# log level for this class is used to overwrite the root logger's log level, so that
27-
# the user can have different defaults for the shell and regular Spark apps.
25+
# Set the default spark-shell/spark-sql log level to WARN. When running the
26+
# spark-shell/spark-sql, the log level for these classes is used to overwrite
27+
# the root logger's log level, so that the user can have different defaults
28+
# for the shell and regular Spark apps.
2829
log4j.logger.org.apache.spark.repl.Main=WARN
30+
log4j.logger.org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver=WARN
2931

3032
# Settings to quiet third party logs that are too verbose
3133
log4j.logger.org.sparkproject.jetty=WARN

core/src/main/resources/org/apache/spark/ui/static/stagepage.js

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ $.extend( $.fn.dataTable.ext.type.order, {
4343
a = ConvertDurationString( a );
4444
b = ConvertDurationString( b );
4545
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
46+
},
47+
48+
"size-pre": function (data) {
49+
var floatValue = parseFloat(data)
50+
return isNaN(floatValue) ? 0 : floatValue;
51+
},
52+
53+
"size-asc": function (a, b) {
54+
a = parseFloat(a);
55+
b = parseFloat(b);
56+
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
57+
},
58+
59+
"size-desc": function (a, b) {
60+
a = parseFloat(a);
61+
b = parseFloat(b);
62+
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
4663
}
4764
} );
4865

@@ -562,10 +579,27 @@ $(document).ready(function () {
562579
}
563580
],
564581
"columnDefs": [
565-
{ "visible": false, "targets": 15 },
566-
{ "visible": false, "targets": 16 },
567-
{ "visible": false, "targets": 17 },
568-
{ "visible": false, "targets": 18 }
582+
// SPARK-35087 [type:size] means String with structures like : 'size / records',
583+
// they should be sorted as numerical-order instead of lexicographical-order by default.
584+
// The targets: $id represents column id which comes from stagespage-template.html
585+
// #summary-executor-table.If the relative position of the columns in the table
586+
// #summary-executor-table has changed,please be careful to adjust the column index here
587+
// Input Size / Records
588+
{"type": "size", "targets": 9},
589+
// Output Size / Records
590+
{"type": "size", "targets": 10},
591+
// Shuffle Read Size / Records
592+
{"type": "size", "targets": 11},
593+
// Shuffle Write Size / Records
594+
{"type": "size", "targets": 12},
595+
// Peak JVM Memory OnHeap / OffHeap
596+
{"visible": false, "targets": 15},
597+
// Peak Execution Memory OnHeap / OffHeap
598+
{"visible": false, "targets": 16},
599+
// Peak Storage Memory OnHeap / OffHeap
600+
{"visible": false, "targets": 17},
601+
// Peak Pool Memory Direct / Mapped
602+
{"visible": false, "targets": 18}
569603
],
570604
"deferRender": true,
571605
"order": [[0, "asc"]],
@@ -746,7 +780,7 @@ $(document).ready(function () {
746780
"paging": true,
747781
"info": true,
748782
"processing": true,
749-
"lengthMenu": [[20, 40, 60, 100, totalTasksToShow], [20, 40, 60, 100, "All"]],
783+
"lengthMenu": [[20, 40, 60, 100, -1], [20, 40, 60, 100, "All"]],
750784
"orderMulti": false,
751785
"bAutoWidth": false,
752786
"ajax": {
@@ -762,6 +796,9 @@ $(document).ready(function () {
762796
data.numTasks = totalTasksToShow;
763797
data.columnIndexToSort = columnIndexToSort;
764798
data.columnNameToSort = columnNameToSort;
799+
if (data.length === -1) {
800+
data.length = totalTasksToShow;
801+
}
765802
},
766803
"dataSrc": function (jsons) {
767804
var jsonStr = JSON.stringify(jsons);

core/src/main/scala/org/apache/spark/ExecutorAllocationManager.scala

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ private[spark] class ExecutorAllocationManager(
290290
* under the current load to satisfy all running and pending tasks, rounded up.
291291
*/
292292
private[spark] def maxNumExecutorsNeededPerResourceProfile(rpId: Int): Int = {
293-
val pending = listener.totalPendingTasksPerResourceProfile(rpId)
293+
val pendingTask = listener.pendingTasksPerResourceProfile(rpId)
294294
val pendingSpeculative = listener.pendingSpeculativeTasksPerResourceProfile(rpId)
295295
val unschedulableTaskSets = listener.pendingUnschedulableTaskSetsPerResourceProfile(rpId)
296296
val running = listener.totalRunningTasksPerResourceProfile(rpId)
297-
val numRunningOrPendingTasks = pending + running
297+
val numRunningOrPendingTasks = pendingTask + pendingSpeculative + running
298298
val rp = resourceProfileManager.resourceProfileFromId(rpId)
299299
val tasksPerExecutor = rp.maxTasksPerExecutor(conf)
300300
logDebug(s"max needed for rpId: $rpId numpending: $numRunningOrPendingTasks," +
@@ -916,18 +916,6 @@ private[spark] class ExecutorAllocationManager(
916916
hasPendingSpeculativeTasks || hasPendingRegularTasks
917917
}
918918

919-
def totalPendingTasksPerResourceProfile(rp: Int): Int = {
920-
pendingTasksPerResourceProfile(rp) + pendingSpeculativeTasksPerResourceProfile(rp)
921-
}
922-
923-
/**
924-
* The number of tasks currently running across all stages.
925-
* Include running-but-zombie stage attempts
926-
*/
927-
def totalRunningTasks(): Int = {
928-
stageAttemptToNumRunningTask.values.sum
929-
}
930-
931919
def totalRunningTasksPerResourceProfile(rp: Int): Int = {
932920
val attempts = resourceProfileIdToStageAttempt.getOrElse(rp, Set.empty).toSeq
933921
// attempts is a Set, change to Seq so we keep all values

0 commit comments

Comments
 (0)