@@ -24,7 +24,7 @@ import scala.xml.{NodeSeq, Node}
2424import  org .apache .commons .lang3 .StringEscapeUtils 
2525
2626import  org .apache .spark .streaming .Time 
27- import  org .apache .spark .ui .{UIUtils , WebUIPage }
27+ import  org .apache .spark .ui .{UIUtils   =>   SparkUIUtils , WebUIPage }
2828import  org .apache .spark .streaming .ui .StreamingJobProgressListener .{SparkJobId , OutputOpId }
2929import  org .apache .spark .ui .jobs .UIData .JobUIData 
3030
@@ -73,8 +73,8 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
7373      sparkJob.stageIds.sorted.reverse.flatMap(sparkListener.stageIdToInfo.get).
7474      dropWhile(_.failureReason ==  None ).take(1 ). //  get the first info that contains failure
7575      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}" 
7878
7979    //  In the first row, output op id and its information needs to be shown. In other rows, these
8080    //  cells will be taken up due to "rowspan".
@@ -110,7 +110,7 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
110110      </td >
111111      <td  class =" progress-cell"  >
112112        {
113-           UIUtils .makeProgressBar(
113+           SparkUIUtils .makeProgressBar(
114114            started =  sparkJob.numActiveTasks,
115115            completed =  sparkJob.numCompletedTasks,
116116            failed =  sparkJob.numFailedTasks,
@@ -135,7 +135,7 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
135135        //  If any job does not finish, set "formattedOutputOpDuration" to "-"
136136        " -" 
137137      } else  {
138-         UIUtils .formatDuration(sparkjobDurations.flatMap(x =>  x).sum)
138+         SparkUIUtils .formatDuration(sparkjobDurations.flatMap(x =>  x).sum)
139139      }
140140    generateJobRow(outputOpId, formattedOutputOpDuration, sparkJobs.size, true , sparkJobs.head) ++ 
141141      sparkJobs.tail.map { sparkJob => 
@@ -212,24 +212,24 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
212212    val  batchTime  =  Option (request.getParameter(" id"  )).map(id =>  Time (id.toLong)).getOrElse {
213213      throw  new  IllegalArgumentException (s " Missing id parameter " )
214214    }
215-     val  formattedBatchTime  =  UIUtils .formatDate(batchTime.milliseconds)
215+     val  formattedBatchTime  =  SparkUIUtils .formatDate(batchTime.milliseconds)
216216
217217    val  batchUIData  =  streamingListener.getBatchUIData(batchTime).getOrElse {
218218      throw  new  IllegalArgumentException (s " Batch  $formattedBatchTime does not exist " )
219219    }
220220
221221    val  formattedSchedulingDelay  = 
222-       batchUIData.schedulingDelay.map(UIUtils .formatDuration).getOrElse(" -"  )
222+       batchUIData.schedulingDelay.map(SparkUIUtils .formatDuration).getOrElse(" -"  )
223223    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(" -"  )
226226
227227    val  summary :  NodeSeq  = 
228228      <div >
229229        <ul  class =" unstyled"  >
230230          <li >
231231            <strong >Batch  Duration :  </strong >
232-             {UIUtils .formatDuration(streamingListener.batchDuration)}
232+             {SparkUIUtils .formatDuration(streamingListener.batchDuration)}
233233          </li >
234234          <li >
235235            <strong >Input  data size : </strong >
@@ -259,6 +259,6 @@ private[ui] class BatchPage(parent: StreamingTab) extends WebUIPage("batch") {
259259
260260    val  content  =  summary ++  jobTable
261261
262-     UIUtils .headerSparkPage(s " Details of batch at  $formattedBatchTime" , content, parent)
262+     SparkUIUtils .headerSparkPage(s " Details of batch at  $formattedBatchTime" , content, parent)
263263  }
264264}
0 commit comments