Skip to content

Commit 2fbfd1f

Browse files
committed
fixed test
1 parent f9524c6 commit 2fbfd1f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

core/src/main/scala/org/apache/spark/ui/UIUtils.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,9 @@ private[spark] object UIUtils extends Logging {
398398
}
399399

400400
/**
401-
* Convert a description string to HTML. It will try to parse the string as HTML and sanitize
402-
* any links. If that fails, then whole string will treated as a simple text.
401+
* Returns HTML rendering of a job or stage description. It will try to parse the string as HTML
402+
* and make sure that it only contains anchors with relative links. Otherwise, the whole string
403+
* will rendered as a simple escaped text.
403404
*/
404405
def makeDescription(desc: String, basePathUri: String): NodeSeq = {
405406
import scala.language.postfixOps
@@ -426,7 +427,7 @@ private[spark] object UIUtils extends Logging {
426427
xml \\ "a" flatMap { _.attributes } filter { _.key == "href" } map { _.value.toString }
427428
if (allLinks.exists { ! _.startsWith ("/") }) {
428429
throw new IllegalArgumentException(
429-
"Links in job descriptions must be relative:\n" + allLinks.mkString("\n\t"))
430+
"Links in job descriptions must be root-relative:\n" + allLinks.mkString("\n\t"))
430431
}
431432

432433
// Prepend the relative links with basePathUri

streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import org.apache.spark.rdd.RDD
3030
import org.apache.spark.rpc._
3131
import org.apache.spark.streaming.{StreamingContext, Time}
3232
import org.apache.spark.streaming.receiver._
33-
import org.apache.spark.util.{ThreadUtils, SerializableConfiguration}
33+
import org.apache.spark.util.{Utils, ThreadUtils, SerializableConfiguration}
3434

3535

3636
/** Enumeration to identify current state of a Receiver */
@@ -555,7 +555,7 @@ class ReceiverTracker(ssc: StreamingContext, skipReceiverLaunch: Boolean = false
555555
}
556556
receiverRDD.setName(s"Receiver $receiverId")
557557
ssc.sparkContext.setJobDescription(s"Streaming job running receiver $receiverId")
558-
ssc.sparkContext.setCallSite(ssc.getStartSite())
558+
ssc.sparkContext.setCallSite(Option(ssc.getStartSite()).getOrElse(Utils.getCallSite()))
559559

560560
val future = ssc.sparkContext.submitJob[Receiver[_], Unit, Unit](
561561
receiverRDD, startReceiverFunc, Seq(0), (_, _) => Unit, ())

0 commit comments

Comments
 (0)