Skip to content

Commit 81f80e2

Browse files
committed
Merge branch 'master' into leveldb_external_shuffle_service_NM_restart
2 parents 594d520 + 2e68066 commit 81f80e2

File tree

547 files changed

+22431
-9272
lines changed

Some content is hidden

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

547 files changed

+22431
-9272
lines changed

.rat-excludes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,5 @@ INDEX
9393
.lintr
9494
gen-java.*
9595
.*avpr
96+
org.apache.spark.sql.sources.DataSourceRegister
97+
.*parquet

R/install-dev.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,4 @@ Rscript -e ' if("devtools" %in% rownames(installed.packages())) { library(devtoo
4242
# Install SparkR to $LIB_DIR
4343
R CMD INSTALL --library=$LIB_DIR $FWDIR/pkg/
4444

45-
# Zip the SparkR package so that it can be distributed to worker nodes on YARN
46-
cd $LIB_DIR
47-
jar cfM "$LIB_DIR/sparkr.zip" SparkR
48-
4945
popd > /dev/null

R/pkg/R/generics.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,8 @@ setGeneric("showDF", function(x,...) { standardGeneric("showDF") })
535535
#' @export
536536
setGeneric("summarize", function(x,...) { standardGeneric("summarize") })
537537

538-
##' rdname summary
539-
##' @export
538+
#' @rdname summary
539+
#' @export
540540
setGeneric("summary", function(x, ...) { standardGeneric("summary") })
541541

542542
# @rdname tojson

R/pkg/R/mllib.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ setMethod("glm", signature(formula = "formula", family = "ANY", data = "DataFram
5656
#'
5757
#' Makes predictions from a model produced by glm(), similarly to R's predict().
5858
#'
59-
#' @param model A fitted MLlib model
59+
#' @param object A fitted MLlib model
6060
#' @param newData DataFrame for testing
6161
#' @return DataFrame containing predicted values
62-
#' @rdname glm
62+
#' @rdname predict
6363
#' @export
6464
#' @examples
6565
#'\dontrun{
@@ -76,10 +76,10 @@ setMethod("predict", signature(object = "PipelineModel"),
7676
#'
7777
#' Returns the summary of a model produced by glm(), similarly to R's summary().
7878
#'
79-
#' @param model A fitted MLlib model
79+
#' @param x A fitted MLlib model
8080
#' @return a list with a 'coefficient' component, which is the matrix of coefficients. See
8181
#' summary.glm for more information.
82-
#' @rdname glm
82+
#' @rdname summary
8383
#' @export
8484
#' @examples
8585
#'\dontrun{
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
library(SparkR)
18+
library(sparkPackageTest)
19+
20+
sc <- sparkR.init()
21+
22+
run1 <- myfunc(5L)
23+
24+
run2 <- myfunc(-4L)
25+
26+
sparkR.stop()
27+
28+
if(run1 != 6) quit(save = "no", status = 1)
29+
30+
if(run2 != -3) quit(save = "no", status = 1)

R/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FAILED=0
2323
LOGFILE=$FWDIR/unit-tests.out
2424
rm -f $LOGFILE
2525

26-
SPARK_TESTING=1 $FWDIR/../bin/sparkR --conf spark.buffer.pageSize=4m --driver-java-options "-Dlog4j.configuration=file:$FWDIR/log4j.properties" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE
26+
SPARK_TESTING=1 $FWDIR/../bin/sparkR --driver-java-options "-Dlog4j.configuration=file:$FWDIR/log4j.properties" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE
2727
FAILED=$((PIPESTATUS[0]||$FAILED))
2828

2929
if [[ $FAILED != 0 ]]; then

build/mvn

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ install_app() {
5151
# check if we have curl installed
5252
# download application
5353
[ ! -f "${local_tarball}" ] && [ $(command -v curl) ] && \
54-
echo "exec: curl ${curl_opts} ${remote_tarball}" && \
54+
echo "exec: curl ${curl_opts} ${remote_tarball}" 1>&2 && \
5555
curl ${curl_opts} "${remote_tarball}" > "${local_tarball}"
5656
# if the file still doesn't exist, lets try `wget` and cross our fingers
5757
[ ! -f "${local_tarball}" ] && [ $(command -v wget) ] && \
58-
echo "exec: wget ${wget_opts} ${remote_tarball}" && \
58+
echo "exec: wget ${wget_opts} ${remote_tarball}" 1>&2 && \
5959
wget ${wget_opts} -O "${local_tarball}" "${remote_tarball}"
6060
# if both were unsuccessful, exit
6161
[ ! -f "${local_tarball}" ] && \
@@ -82,7 +82,7 @@ install_mvn() {
8282
# Install zinc under the build/ folder
8383
install_zinc() {
8484
local zinc_path="zinc-0.3.5.3/bin/zinc"
85-
[ ! -f "${zinc_path}" ] && ZINC_INSTALL_FLAG=1
85+
[ ! -f "${_DIR}/${zinc_path}" ] && ZINC_INSTALL_FLAG=1
8686
install_app \
8787
"http://downloads.typesafe.com/zinc/0.3.5.3" \
8888
"zinc-0.3.5.3.tgz" \
@@ -135,9 +135,9 @@ cd "${_CALLING_DIR}"
135135

136136
# Now that zinc is ensured to be installed, check its status and, if its
137137
# not running or just installed, start it
138-
if [ -n "${ZINC_INSTALL_FLAG}" -o -z "`${ZINC_BIN} -status`" ]; then
138+
if [ -n "${ZINC_INSTALL_FLAG}" -o -z "`${ZINC_BIN} -status -port ${ZINC_PORT}`" ]; then
139139
export ZINC_OPTS=${ZINC_OPTS:-"$_COMPILE_JVM_OPTS"}
140-
${ZINC_BIN} -shutdown
140+
${ZINC_BIN} -shutdown -port ${ZINC_PORT}
141141
${ZINC_BIN} -start -port ${ZINC_PORT} \
142142
-scala-compiler "${SCALA_COMPILER}" \
143143
-scala-library "${SCALA_LIBRARY}" &>/dev/null
@@ -146,7 +146,7 @@ fi
146146
# Set any `mvn` options if not already present
147147
export MAVEN_OPTS=${MAVEN_OPTS:-"$_COMPILE_JVM_OPTS"}
148148

149-
echo "Using \`mvn\` from path: $MVN_BIN"
149+
echo "Using \`mvn\` from path: $MVN_BIN" 1>&2
150150

151151
# Last, call the `mvn` command as usual
152-
${MVN_BIN} "$@"
152+
${MVN_BIN} -DzincPort=${ZINC_PORT} "$@"

build/sbt-launch-lib.bash

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ dlog () {
3838

3939
acquire_sbt_jar () {
4040
SBT_VERSION=`awk -F "=" '/sbt\.version/ {print $2}' ./project/build.properties`
41-
URL1=http://typesafe.artifactoryonline.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch.jar
42-
URL2=http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch.jar
41+
URL1=https://dl.bintray.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/${SBT_VERSION}/sbt-launch.jar
4342
JAR=build/sbt-launch-${SBT_VERSION}.jar
4443

4544
sbt_jar=$JAR
@@ -51,12 +50,10 @@ acquire_sbt_jar () {
5150
printf "Attempting to fetch sbt\n"
5251
JAR_DL="${JAR}.part"
5352
if [ $(command -v curl) ]; then
54-
(curl --fail --location --silent ${URL1} > "${JAR_DL}" ||\
55-
(rm -f "${JAR_DL}" && curl --fail --location --silent ${URL2} > "${JAR_DL}")) &&\
53+
curl --fail --location --silent ${URL1} > "${JAR_DL}" &&\
5654
mv "${JAR_DL}" "${JAR}"
5755
elif [ $(command -v wget) ]; then
58-
(wget --quiet ${URL1} -O "${JAR_DL}" ||\
59-
(rm -f "${JAR_DL}" && wget --quiet ${URL2} -O "${JAR_DL}")) &&\
56+
wget --quiet ${URL1} -O "${JAR_DL}" &&\
6057
mv "${JAR_DL}" "${JAR}"
6158
else
6259
printf "You do not have curl or wget installed, please install sbt manually from http://www.scala-sbt.org/\n"

core/src/main/java/org/apache/spark/api/java/JavaSparkContextVarargsWorkaround.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
// See
2424
// http://scala-programming-language.1934581.n4.nabble.com/Workaround-for-implementing-java-varargs-in-2-7-2-final-tp1944767p1944772.html
2525
abstract class JavaSparkContextVarargsWorkaround {
26-
public <T> JavaRDD<T> union(JavaRDD<T>... rdds) {
26+
27+
@SafeVarargs
28+
public final <T> JavaRDD<T> union(JavaRDD<T>... rdds) {
2729
if (rdds.length == 0) {
2830
throw new IllegalArgumentException("Union called on empty list");
2931
}
30-
ArrayList<JavaRDD<T>> rest = new ArrayList<JavaRDD<T>>(rdds.length - 1);
32+
List<JavaRDD<T>> rest = new ArrayList<>(rdds.length - 1);
3133
for (int i = 1; i < rdds.length; i++) {
3234
rest.add(rdds[i]);
3335
}
@@ -38,26 +40,27 @@ public JavaDoubleRDD union(JavaDoubleRDD... rdds) {
3840
if (rdds.length == 0) {
3941
throw new IllegalArgumentException("Union called on empty list");
4042
}
41-
ArrayList<JavaDoubleRDD> rest = new ArrayList<JavaDoubleRDD>(rdds.length - 1);
43+
List<JavaDoubleRDD> rest = new ArrayList<>(rdds.length - 1);
4244
for (int i = 1; i < rdds.length; i++) {
4345
rest.add(rdds[i]);
4446
}
4547
return union(rdds[0], rest);
4648
}
4749

48-
public <K, V> JavaPairRDD<K, V> union(JavaPairRDD<K, V>... rdds) {
50+
@SafeVarargs
51+
public final <K, V> JavaPairRDD<K, V> union(JavaPairRDD<K, V>... rdds) {
4952
if (rdds.length == 0) {
5053
throw new IllegalArgumentException("Union called on empty list");
5154
}
52-
ArrayList<JavaPairRDD<K, V>> rest = new ArrayList<JavaPairRDD<K, V>>(rdds.length - 1);
55+
List<JavaPairRDD<K, V>> rest = new ArrayList<>(rdds.length - 1);
5356
for (int i = 1; i < rdds.length; i++) {
5457
rest.add(rdds[i]);
5558
}
5659
return union(rdds[0], rest);
5760
}
5861

5962
// These methods take separate "first" and "rest" elements to avoid having the same type erasure
60-
abstract public <T> JavaRDD<T> union(JavaRDD<T> first, List<JavaRDD<T>> rest);
61-
abstract public JavaDoubleRDD union(JavaDoubleRDD first, List<JavaDoubleRDD> rest);
62-
abstract public <K, V> JavaPairRDD<K, V> union(JavaPairRDD<K, V> first, List<JavaPairRDD<K, V>> rest);
63+
public abstract <T> JavaRDD<T> union(JavaRDD<T> first, List<JavaRDD<T>> rest);
64+
public abstract JavaDoubleRDD union(JavaDoubleRDD first, List<JavaDoubleRDD> rest);
65+
public abstract <K, V> JavaPairRDD<K, V> union(JavaPairRDD<K, V> first, List<JavaPairRDD<K, V>> rest);
6366
}

core/src/main/java/org/apache/spark/serializer/DummySerializerInstance.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import scala.reflect.ClassTag;
2626

2727
import org.apache.spark.annotation.Private;
28-
import org.apache.spark.unsafe.PlatformDependent;
28+
import org.apache.spark.unsafe.Platform;
2929

3030
/**
3131
* Unfortunately, we need a serializer instance in order to construct a DiskBlockObjectWriter.
@@ -49,7 +49,7 @@ public void flush() {
4949
try {
5050
s.flush();
5151
} catch (IOException e) {
52-
PlatformDependent.throwException(e);
52+
Platform.throwException(e);
5353
}
5454
}
5555

@@ -64,7 +64,7 @@ public void close() {
6464
try {
6565
s.close();
6666
} catch (IOException e) {
67-
PlatformDependent.throwException(e);
67+
Platform.throwException(e);
6868
}
6969
}
7070
};

0 commit comments

Comments
 (0)