Skip to content

Commit f56be4b

Browse files
committed
Fixed JsonProtocolSuite.
1 parent e29e0f7 commit f56be4b

File tree

2 files changed

+51
-28
lines changed

2 files changed

+51
-28
lines changed

core/src/main/scala/org/apache/spark/ui/jobs/StagePage.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private[ui] class StagePage(parent: JobProgressTab) extends WebUIPage("stage") {
263263
{if (gcTime > 0) UIUtils.formatDuration(gcTime) else ""}
264264
</td>
265265
<!--
266-
TODO: Add this back after we add support to hive certain columns.
266+
TODO: Add this back after we add support to hide certain columns.
267267
<td sorttable_customkey={serializationTime.toString}>
268268
{if (serializationTime > 0) UIUtils.formatDuration(serializationTime) else ""}
269269
</td>

core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ class JsonProtocolSuite extends FunSuite {
454454
new StageInfo(a, "greetings", b, rddInfos, "details")
455455
}
456456

457-
private def makeTaskInfo(a: Long, b: Int, c: Int, d: Long, e: Boolean) = {
458-
new TaskInfo(a, b, c, d, "executor", "your kind sir", TaskLocality.NODE_LOCAL, e)
457+
private def makeTaskInfo(a: Long, b: Int, c: Int, d: Long, speculative: Boolean) = {
458+
new TaskInfo(a, b, c, d, "executor", "your kind sir", TaskLocality.NODE_LOCAL, speculative)
459459
}
460460

461461
private def makeTaskMetrics(a: Long, b: Long, c: Long, d: Long, e: Int, f: Int) = {
@@ -511,37 +511,60 @@ class JsonProtocolSuite extends FunSuite {
511511

512512
private val taskStartJsonString =
513513
"""
514-
{"Event":"SparkListenerTaskStart","Stage ID":111,"Task Info":{"Task ID":222,
515-
"Index":333,"Launch Time":444,"Executor ID":"executor","Host":"your kind sir",
516-
"Locality":"NODE_LOCAL","Getting Result Time":0,"Finish Time":0,"Failed":false,
517-
"Serialized Size":0}}
518-
"""
514+
|{"Event":"SparkListenerTaskStart","Stage ID":111,"Task Info":{"Task ID":222,
515+
|"Index":333,"Attempt":1,"Launch Time":444,"Executor ID":"executor","Host":"your kind sir",
516+
|"Locality":"NODE_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,
517+
|"Failed":false,"Serialized Size":0}}
518+
""".stripMargin
519519

520520
private val taskGettingResultJsonString =
521521
"""
522-
{"Event":"SparkListenerTaskGettingResult","Task Info":{"Task ID":1000,"Index":
523-
2000,"Launch Time":3000,"Executor ID":"executor","Host":"your kind sir",
524-
"Locality":"NODE_LOCAL","Getting Result Time":0,"Finish Time":0,"Failed":false,
525-
"Serialized Size":0}}
526-
"""
522+
|{"Event":"SparkListenerTaskGettingResult","Task Info":
523+
| {"Task ID":1000,"Index":2000,"Attempt":5,"Launch Time":3000,"Executor ID":"executor",
524+
| "Host":"your kind sir","Locality":"NODE_LOCAL","Speculative":true,"Getting Result Time":0,
525+
| "Finish Time":0,"Failed":false,"Serialized Size":0
526+
| }
527+
|}
528+
""".stripMargin
527529

528530
private val taskEndJsonString =
529531
"""
530-
{"Event":"SparkListenerTaskEnd","Stage ID":1,"Task Type":"ShuffleMapTask",
531-
"Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":123,"Index":
532-
234,"Launch Time":345,"Executor ID":"executor","Host":"your kind sir",
533-
"Locality":"NODE_LOCAL","Getting Result Time":0,"Finish Time":0,"Failed":
534-
false,"Serialized Size":0},"Task Metrics":{"Host Name":"localhost",
535-
"Executor Deserialize Time":300,"Executor Run Time":400,"Result Size":500,
536-
"JVM GC Time":600,"Result Serialization Time":700,"Memory Bytes Spilled":
537-
800,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Shuffle Finish Time":
538-
900,"Total Blocks Fetched":1500,"Remote Blocks Fetched":800,"Local Blocks Fetched":
539-
700,"Fetch Wait Time":900,"Remote Bytes Read":1000},"Shuffle Write Metrics":
540-
{"Shuffle Bytes Written":1200,"Shuffle Write Time":1500},"Updated Blocks":
541-
[{"Block ID":"rdd_0_0","Status":{"Storage Level":{"Use Disk":true,"Use Memory":true,
542-
"Use Tachyon":false,"Deserialized":false,"Replication":2},"Memory Size":0,"Tachyon Size":0,
543-
"Disk Size":0}}]}}
544-
"""
532+
|{"Event":"SparkListenerTaskEnd","Stage ID":1,"Task Type":"ShuffleMapTask",
533+
|"Task End Reason":{"Reason":"Success"},
534+
|"Task Info":{
535+
| "Task ID":123,"Index":234,"Attempt":67,"Launch Time":345,"Executor ID":"executor",
536+
| "Host":"your kind sir","Locality":"NODE_LOCAL","Speculative":false,
537+
| "Getting Result Time":0,"Finish Time":0,"Failed":false,"Serialized Size":0
538+
|},
539+
|"Task Metrics":{
540+
| "Host Name":"localhost","Executor Deserialize Time":300,"Executor Run Time":400,
541+
| "Result Size":500,"JVM GC Time":600,"Result Serialization Time":700,
542+
| "Memory Bytes Spilled":800,"Disk Bytes Spilled":0,
543+
| "Shuffle Read Metrics":{
544+
| "Shuffle Finish Time":900,
545+
| "Total Blocks Fetched":1500,
546+
| "Remote Blocks Fetched":800,
547+
| "Local Blocks Fetched":700,
548+
| "Fetch Wait Time":900,
549+
| "Remote Bytes Read":1000
550+
| },
551+
| "Shuffle Write Metrics":{
552+
| "Shuffle Bytes Written":1200,
553+
| "Shuffle Write Time":1500},
554+
| "Updated Blocks":[
555+
| {"Block ID":"rdd_0_0",
556+
| "Status":{
557+
| "Storage Level":{
558+
| "Use Disk":true,"Use Memory":true,"Use Tachyon":false,"Deserialized":false,
559+
| "Replication":2
560+
| },
561+
| "Memory Size":0,"Tachyon Size":0,"Disk Size":0
562+
| }
563+
| }
564+
| ]
565+
| }
566+
|}
567+
""".stripMargin
545568

546569
private val jobStartJsonString =
547570
"""

0 commit comments

Comments
 (0)