@@ -24,7 +24,7 @@ import scala.xml.{NodeSeq, Node}
24
24
import org .apache .commons .lang3 .StringEscapeUtils
25
25
26
26
import org .apache .spark .streaming .Time
27
- import org .apache .spark .ui .{UIUtils , WebUIPage }
27
+ import org .apache .spark .ui .{UIUtils => SparkUIUtils , WebUIPage }
28
28
import org .apache .spark .streaming .ui .StreamingJobProgressListener .{SparkJobId , OutputOpId }
29
29
import org .apache .spark .ui .jobs .UIData .JobUIData
30
30
@@ -73,8 +73,8 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
73
73
sparkJob.stageIds.sorted.reverse.flatMap(sparkListener.stageIdToInfo.get).
74
74
dropWhile(_.failureReason == None ).take(1 ). // get the first info that contains failure
75
75
flatMap(info => info.failureReason).headOption.getOrElse(" " )
76
- val formattedDuration = duration.map(d => UIUtils .formatDuration(d)).getOrElse(" -" )
77
- val detailUrl = s " ${UIUtils .prependBaseUri(parent.basePath)}/jobs/job?id= ${sparkJob.jobId}"
76
+ val formattedDuration = duration.map(d => SparkUIUtils .formatDuration(d)).getOrElse(" -" )
77
+ val detailUrl = s " ${SparkUIUtils .prependBaseUri(parent.basePath)}/jobs/job?id= ${sparkJob.jobId}"
78
78
79
79
// In the first row, output op id and its information needs to be shown. In other rows, these
80
80
// cells will be taken up due to "rowspan".
@@ -110,7 +110,7 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
110
110
</td >
111
111
<td class =" progress-cell" >
112
112
{
113
- UIUtils .makeProgressBar(
113
+ SparkUIUtils .makeProgressBar(
114
114
started = sparkJob.numActiveTasks,
115
115
completed = sparkJob.numCompletedTasks,
116
116
failed = sparkJob.numFailedTasks,
@@ -135,7 +135,7 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
135
135
// If any job does not finish, set "formattedOutputOpDuration" to "-"
136
136
" -"
137
137
} else {
138
- UIUtils .formatDuration(sparkjobDurations.flatMap(x => x).sum)
138
+ SparkUIUtils .formatDuration(sparkjobDurations.flatMap(x => x).sum)
139
139
}
140
140
generateJobRow(outputOpId, formattedOutputOpDuration, sparkJobs.size, true , sparkJobs.head) ++
141
141
sparkJobs.tail.map { sparkJob =>
@@ -212,24 +212,24 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
212
212
val batchTime = Option (request.getParameter(" id" )).map(id => Time (id.toLong)).getOrElse {
213
213
throw new IllegalArgumentException (s " Missing id parameter " )
214
214
}
215
- val formattedBatchTime = UIUtils .formatDate(batchTime.milliseconds)
215
+ val formattedBatchTime = SparkUIUtils .formatDate(batchTime.milliseconds)
216
216
217
217
val batchUIData = streamingListener.getBatchUIData(batchTime).getOrElse {
218
218
throw new IllegalArgumentException (s " Batch $formattedBatchTime does not exist " )
219
219
}
220
220
221
221
val formattedSchedulingDelay =
222
- batchUIData.schedulingDelay.map(UIUtils .formatDuration).getOrElse(" -" )
222
+ batchUIData.schedulingDelay.map(SparkUIUtils .formatDuration).getOrElse(" -" )
223
223
val formattedProcessingTime =
224
- batchUIData.processingDelay.map(UIUtils .formatDuration).getOrElse(" -" )
225
- val formattedTotalDelay = batchUIData.totalDelay.map(UIUtils .formatDuration).getOrElse(" -" )
224
+ batchUIData.processingDelay.map(SparkUIUtils .formatDuration).getOrElse(" -" )
225
+ val formattedTotalDelay = batchUIData.totalDelay.map(SparkUIUtils .formatDuration).getOrElse(" -" )
226
226
227
227
val summary : NodeSeq =
228
228
<div >
229
229
<ul class =" unstyled" >
230
230
<li >
231
231
<strong >Batch Duration : </strong >
232
- {UIUtils .formatDuration(streamingListener.batchDuration)}
232
+ {SparkUIUtils .formatDuration(streamingListener.batchDuration)}
233
233
</li >
234
234
<li >
235
235
<strong >Input data size : </strong >
@@ -259,6 +259,6 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
259
259
260
260
val content = summary ++ jobTable
261
261
262
- UIUtils .headerSparkPage(s " Details of batch at $formattedBatchTime" , content, parent)
262
+ SparkUIUtils .headerSparkPage(s " Details of batch at $formattedBatchTime" , content, parent)
263
263
}
264
264
}
0 commit comments