[SPARK-14232][WEBUI] Fix event timeline display issue when an executor is removed with a multiple line reason.

## What changes were proposed in this pull request?
The event timeline doesn't show on job page if an executor is removed with a multiple line reason. This PR replaces all new line characters in the reason string with spaces.

![timelineerror](https://cloud.githubusercontent.com/assets/9278199/14100211/5fd4cd30-f5be-11e5-9cea-f32651a4cd62.jpg)

## How was this patch tested?
Verified on the Web UI.

Author: Carson Wang <carson.wang@intel.com>

Closes #12029 from carsonwang/eventTimeline.
This commit is contained in:
Carson Wang 2016-03-29 11:07:58 -07:00 committed by Andrew Or
parent d2a819a636
commit 15c0b0006b
2 changed files with 2 additions and 2 deletions

View file

@ -148,7 +148,7 @@ private[ui] class AllJobsPage(parent: JobsTab) extends WebUIPage("") {
| 'Removed at ${UIUtils.formatDate(new Date(event.finishTime.get))}' +
| '${
if (event.finishReason.isDefined) {
s"""<br>Reason: ${event.finishReason.get}"""
s"""<br>Reason: ${event.finishReason.get.replace("\n", " ")}"""
} else {
""
}

View file

@ -122,7 +122,7 @@ private[ui] class JobPage(parent: JobsTab) extends WebUIPage("job") {
| 'Removed at ${UIUtils.formatDate(new Date(event.finishTime.get))}' +
| '${
if (event.finishReason.isDefined) {
s"""<br>Reason: ${event.finishReason.get}"""
s"""<br>Reason: ${event.finishReason.get.replace("\n", " ")}"""
} else {
""
}