Skip to content

Commit 2f1f476

Browse files
author
Andrew Or
committed
Merge branch 'master' of github.com:apache/spark into clean-more
Conflicts: core/src/main/scala/org/apache/spark/rdd/RDD.scala
2 parents 7265865 + d4cb38a commit 2f1f476

File tree

269 files changed

+25748
-1852
lines changed

Some content is hidden

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

269 files changed

+25748
-1852
lines changed

.rat-excludes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ spark-env.sh.template
3030
log4j-defaults.properties
3131
bootstrap-tooltip.js
3232
jquery-1.11.1.min.js
33+
d3.min.js
34+
dagre-d3.min.js
35+
graphlib-dot.min.js
3336
sorttable.js
3437
vis.min.js
3538
vis.min.css
@@ -71,5 +74,12 @@ logs
7174
.*scalastyle-output.xml
7275
.*dependency-reduced-pom.xml
7376
known_translations
77+
json_expectation
78+
local-1422981759269/*
79+
local-1422981780767/*
80+
local-1425081759269/*
81+
local-1426533911241/*
82+
local-1426633911242/*
83+
local-1427397477963/*
7484
DESCRIPTION
7585
NAMESPACE

R/pkg/R/DataFrame.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ setMethod("isLocal",
167167
setMethod("showDF",
168168
signature(x = "DataFrame"),
169169
function(x, numRows = 20) {
170-
cat(callJMethod(x@sdf, "showString", numToInt(numRows)), "\n")
170+
callJMethod(x@sdf, "showString", numToInt(numRows))
171171
})
172172

173173
#' show

R/pkg/inst/tests/test_sparkSQL.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ test_that("toJSON() returns an RDD of the correct values", {
641641

642642
test_that("showDF()", {
643643
df <- jsonFile(sqlCtx, jsonPath)
644-
expect_output(showDF(df), "age name \nnull Michael\n30 Andy \n19 Justin ")
644+
expect_output(showDF(df), "+----+-------+\n| age| name|\n+----+-------+\n|null|Michael|\n| 30| Andy|\n| 19| Justin|\n+----+-------+\n")
645645
})
646646

647647
test_that("isLocal()", {

core/pom.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,14 @@
228228
<artifactId>json4s-jackson_${scala.binary.version}</artifactId>
229229
<version>3.2.10</version>
230230
</dependency>
231+
<dependency>
232+
<groupId>com.sun.jersey</groupId>
233+
<artifactId>jersey-server</artifactId>
234+
</dependency>
235+
<dependency>
236+
<groupId>com.sun.jersey</groupId>
237+
<artifactId>jersey-core</artifactId>
238+
</dependency>
231239
<dependency>
232240
<groupId>org.apache.mesos</groupId>
233241
<artifactId>mesos</artifactId>
@@ -273,7 +281,6 @@
273281
<dependency>
274282
<groupId>org.apache.ivy</groupId>
275283
<artifactId>ivy</artifactId>
276-
<version>${ivy.version}</version>
277284
</dependency>
278285
<dependency>
279286
<groupId>oro</groupId>
@@ -362,7 +369,7 @@
362369
<dependency>
363370
<groupId>org.spark-project</groupId>
364371
<artifactId>pyrolite</artifactId>
365-
<version>2.0.1</version>
372+
<version>4.4</version>
366373
</dependency>
367374
<dependency>
368375
<groupId>net.sf.py4j</groupId>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@
1717

1818
package org.apache.spark;
1919

20+
import org.apache.spark.util.EnumUtil;
21+
2022
public enum JobExecutionStatus {
2123
RUNNING,
2224
SUCCEEDED,
2325
FAILED,
24-
UNKNOWN
26+
UNKNOWN;
27+
28+
public static JobExecutionStatus fromString(String str) {
29+
return EnumUtil.parseIgnoreCase(JobExecutionStatus.class, str);
30+
}
2531
}
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+
18+
package org.apache.spark.status.api.v1;
19+
20+
import org.apache.spark.util.EnumUtil;
21+
22+
public enum ApplicationStatus {
23+
COMPLETED,
24+
RUNNING;
25+
26+
public static ApplicationStatus fromString(String str) {
27+
return EnumUtil.parseIgnoreCase(ApplicationStatus.class, str);
28+
}
29+
30+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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.status.api.v1;
19+
20+
import org.apache.spark.util.EnumUtil;
21+
22+
public enum StageStatus {
23+
ACTIVE,
24+
COMPLETE,
25+
FAILED,
26+
PENDING;
27+
28+
public static StageStatus fromString(String str) {
29+
return EnumUtil.parseIgnoreCase(StageStatus.class, str);
30+
}
31+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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.status.api.v1;
19+
20+
import org.apache.spark.util.EnumUtil;
21+
22+
import java.util.HashSet;
23+
import java.util.Set;
24+
25+
public enum TaskSorting {
26+
ID,
27+
INCREASING_RUNTIME("runtime"),
28+
DECREASING_RUNTIME("-runtime");
29+
30+
private final Set<String> alternateNames;
31+
private TaskSorting(String... names) {
32+
alternateNames = new HashSet<String>();
33+
for (String n: names) {
34+
alternateNames.add(n);
35+
}
36+
}
37+
38+
public static TaskSorting fromString(String str) {
39+
String lower = str.toLowerCase();
40+
for (TaskSorting t: values()) {
41+
if (t.alternateNames.contains(lower)) {
42+
return t;
43+
}
44+
}
45+
return EnumUtil.parseIgnoreCase(TaskSorting.class, str);
46+
}
47+
48+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
package org.apache.spark.util;
18+
19+
import com.google.common.base.Joiner;
20+
import org.apache.spark.annotation.Private;
21+
22+
@Private
23+
public class EnumUtil {
24+
public static <E extends Enum<E>> E parseIgnoreCase(Class<E> clz, String str) {
25+
E[] constants = clz.getEnumConstants();
26+
if (str == null) {
27+
return null;
28+
}
29+
for (E e : constants) {
30+
if (e.name().equalsIgnoreCase(str)) {
31+
return e;
32+
}
33+
}
34+
throw new IllegalArgumentException(
35+
String.format("Illegal type='%s'. Supported type values: %s",
36+
str, Joiner.on(", ").join(constants)));
37+
}
38+
}

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

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

0 commit comments

Comments
 (0)