Skip to content

Commit f798c82

Browse files
committed
[SPARK-4409] Updated API according to SPARK-4614
2 parents c75f3cd + 561d31d commit f798c82

File tree

272 files changed

+7150
-3448
lines changed

Some content is hidden

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

272 files changed

+7150
-3448
lines changed

assembly/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>org.apache.spark</groupId>
2323
<artifactId>spark-parent</artifactId>
24-
<version>1.2.0-SNAPSHOT</version>
24+
<version>1.3.0-SNAPSHOT</version>
2525
<relativePath>../pom.xml</relativePath>
2626
</parent>
2727

bagel/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>org.apache.spark</groupId>
2323
<artifactId>spark-parent</artifactId>
24-
<version>1.2.0-SNAPSHOT</version>
24+
<version>1.3.0-SNAPSHOT</version>
2525
<relativePath>../pom.xml</relativePath>
2626
</parent>
2727

bin/spark-submit

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)"
2323
ORIG_ARGS=("$@")
2424

25+
# Set COLUMNS for progress bar
26+
export COLUMNS=`tput cols`
27+
2528
while (($#)); do
2629
if [ "$1" = "--deploy-mode" ]; then
2730
SPARK_SUBMIT_DEPLOY_MODE=$2

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>org.apache.spark</groupId>
2323
<artifactId>spark-parent</artifactId>
24-
<version>1.2.0-SNAPSHOT</version>
24+
<version>1.3.0-SNAPSHOT</version>
2525
<relativePath>../pom.xml</relativePath>
2626
</parent>
2727

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
public interface SparkStageInfo {
2727
int stageId();
2828
int currentAttemptId();
29+
long submissionTime();
2930
String name();
3031
int numTasks();
3132
int numActiveTasks();

core/src/main/java/org/apache/spark/api/java/function/package.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ package org.apache.spark.api.java
2222
* these interfaces to pass functions to various Java API methods for Spark. Please visit Spark's
2323
* Java programming guide for more details.
2424
*/
25-
package object function
25+
package object function

core/src/main/resources/org/apache/spark/ui/static/additional-metrics.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,24 @@ $(function() {
2626
// Switch the class of the arrow from open to closed.
2727
$(this).find('.expand-additional-metrics-arrow').toggleClass('arrow-open');
2828
$(this).find('.expand-additional-metrics-arrow').toggleClass('arrow-closed');
29-
30-
// If clicking caused the metrics to expand, automatically check all options for additional
31-
// metrics (don't trigger a click when collapsing metrics, because it leads to weird
32-
// toggling behavior).
33-
if (!$(additionalMetricsDiv).hasClass('collapsed')) {
34-
$(this).parent().find('input:checkbox:not(:checked)').trigger('click');
35-
}
3629
});
3730

38-
$("input:checkbox:not(:checked)").each(function() {
39-
var column = "table ." + $(this).attr("name");
40-
$(column).hide();
41-
});
42-
// Stripe table rows after rows have been hidden to ensure correct striping.
43-
stripeTables();
31+
stripeSummaryTable();
4432

4533
$("input:checkbox").click(function() {
4634
var column = "table ." + $(this).attr("name");
4735
$(column).toggle();
48-
stripeTables();
36+
stripeSummaryTable();
37+
});
38+
39+
$("#select-all-metrics").click(function() {
40+
if (this.checked) {
41+
// Toggle all un-checked options.
42+
$('input:checkbox:not(:checked)').trigger('click');
43+
} else {
44+
// Toggle all checked options.
45+
$('input:checkbox:checked').trigger('click');
46+
}
4947
});
5048

5149
// Trigger a click on the checkbox if a user clicks the label next to it.

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@
1515
* limitations under the License.
1616
*/
1717

18-
/* Adds background colors to stripe table rows. This is necessary (instead of using css or the
19-
* table striping provided by bootstrap) to appropriately stripe tables with hidden rows. */
20-
function stripeTables() {
21-
$("table.table-striped-custom").each(function() {
22-
$(this).find("tr:not(:hidden)").each(function (index) {
23-
if (index % 2 == 1) {
24-
$(this).css("background-color", "#f9f9f9");
25-
} else {
26-
$(this).css("background-color", "#ffffff");
27-
}
28-
});
18+
/* Adds background colors to stripe table rows in the summary table (on the stage page). This is
19+
* necessary (instead of using css or the table striping provided by bootstrap) because the summary
20+
* table has hidden rows.
21+
*
22+
* An ID selector (rather than a class selector) is used to ensure this runs quickly even on pages
23+
* with thousands of task rows (ID selectors are much faster than class selectors). */
24+
function stripeSummaryTable() {
25+
$("#task-summary-table").find("tr:not(:hidden)").each(function (index) {
26+
if (index % 2 == 1) {
27+
$(this).css("background-color", "#f9f9f9");
28+
} else {
29+
$(this).css("background-color", "#ffffff");
30+
}
2931
});
3032
}

core/src/main/resources/org/apache/spark/ui/static/webui.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,9 @@ span.additional-metric-title {
168168
border-left: 5px solid black;
169169
display: inline-block;
170170
}
171+
172+
/* Hide all additional metrics by default. This is done here rather than using JavaScript to
173+
* avoid slow page loads for stage pages with large numbers (e.g., thousands) of tasks. */
174+
.scheduler_delay, .gc_time, .deserialization_time, .serialization_time, .getting_result_time {
175+
display: none;
176+
}

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,36 @@ trait AccumulatorParam[T] extends AccumulableParam[T, T] {
244244
}
245245
}
246246

247+
object AccumulatorParam {
248+
249+
// The following implicit objects were in SparkContext before 1.2 and users had to
250+
// `import SparkContext._` to enable them. Now we move them here to make the compiler find
251+
// them automatically. However, as there are duplicate codes in SparkContext for backward
252+
// compatibility, please update them accordingly if you modify the following implicit objects.
253+
254+
implicit object DoubleAccumulatorParam extends AccumulatorParam[Double] {
255+
def addInPlace(t1: Double, t2: Double): Double = t1 + t2
256+
def zero(initialValue: Double) = 0.0
257+
}
258+
259+
implicit object IntAccumulatorParam extends AccumulatorParam[Int] {
260+
def addInPlace(t1: Int, t2: Int): Int = t1 + t2
261+
def zero(initialValue: Int) = 0
262+
}
263+
264+
implicit object LongAccumulatorParam extends AccumulatorParam[Long] {
265+
def addInPlace(t1: Long, t2: Long) = t1 + t2
266+
def zero(initialValue: Long) = 0L
267+
}
268+
269+
implicit object FloatAccumulatorParam extends AccumulatorParam[Float] {
270+
def addInPlace(t1: Float, t2: Float) = t1 + t2
271+
def zero(initialValue: Float) = 0f
272+
}
273+
274+
// TODO: Add AccumulatorParams for other types, e.g. lists and strings
275+
}
276+
247277
// TODO: The multi-thread support in accumulators is kind of lame; check
248278
// if there's a more intuitive way of doing it right
249279
private object Accumulators {

0 commit comments

Comments
 (0)