什么进度条上的数字火花壳是什么意思? [英] What do the numbers on the progress bar mean in spark-shell?

查看:204
本文介绍了什么进度条上的数字火花壳是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的火花壳,什么样的条目下面的意思,当我执行一个功能?

  [Stage7:===========> (14174 + 5)/ 62500]


解决方案

你得到的是一个控制台进度条
[阶段7:显示你是在现在的阶段,
(14174 + 5)/ 62500] (numCompletedTasks + numActiveTasks)/ totalNumOfTasksInThisStage] 。进度条显示 numCompletedTasks / totalNumOfTasksInThisStage

这将是表明,当两个 spark.ui.showConsoleProgress 为真(默认)日志级别在的conf / log4j.properties 错误 WARN !log.isInfoEnabled 为true)。

让我们来看看code在<一个href=\"https://github.com/apache/spark/blob/v1.6.0/core/src/main/scala/org/apache/spark/ui/ConsoleProgressBar.scala#L73\">ConsoleProgressBar.scala显示出来:

专用高清节目(现:长,阶段:序号[SparkStageInfo]){
  VAL WIDTH = TerminalWidth / stages.size
  VAL栏= {stages.map S =&GT;
    VAL总= s.numTasks()
    VAL头= S[舞台$ {s.stageId()}
    VAL零售商= S($ {s.numCompletedTasks()} + $ {s.numActiveTasks()})/ $总]
    VAL W =宽度 - header.length - tailer.length
    VAL栏=如果(并且R w 0){
      VAL百分比= W * s.numCompletedTasks()/总
      (0,直至W){.MAP I =​​&GT;
        如果(ⅰ&下;百分比)=否则如果(ⅰ==百分比)&gt;中其他
      } .mkString()
    }其他{
    
    }
    头+酒吧+零售商
  } .mkString()  //只有当它在1分钟后改变(或ssh连接将被关闭刷新
  //闲置一段时间后)
  如果(BAR = lastProgressBar ||现在 - lastUpdateTime&GT;!60 * 1000L){
    System.err.print(CR +巴)
    lastUpdateTime =现在
  }
  lastProgressBar =酒吧
}

In my spark-shell, what do entries like the below mean when I execute a function ?

[Stage7:===========>                              (14174 + 5) / 62500]

解决方案

What you get is a Console Progress Bar, [Stage 7: shows the stage you are in now, and (14174 + 5) / 62500] is (numCompletedTasks + numActiveTasks) / totalNumOfTasksInThisStage]. The progress bar shows numCompletedTasks / totalNumOfTasksInThisStage.

It will be shown when both spark.ui.showConsoleProgress is true (by default) and log level in conf/log4j.properties is ERROR or WARN (!log.isInfoEnabled is true).

Let's see the code in ConsoleProgressBar.scala that shows it out:

private def show(now: Long, stages: Seq[SparkStageInfo]) {
  val width = TerminalWidth / stages.size
  val bar = stages.map { s =>
    val total = s.numTasks()
    val header = s"[Stage ${s.stageId()}:"
    val tailer = s"(${s.numCompletedTasks()} + ${s.numActiveTasks()}) / $total]"
    val w = width - header.length - tailer.length
    val bar = if (w > 0) {
      val percent = w * s.numCompletedTasks() / total
      (0 until w).map { i =>
        if (i < percent) "=" else if (i == percent) ">" else " "
      }.mkString("")
    } else {
    ""
    }
    header + bar + tailer
  }.mkString("")

  // only refresh if it's changed of after 1 minute (or the ssh connection will be closed
  // after idle some time)
  if (bar != lastProgressBar || now - lastUpdateTime > 60 * 1000L) {
    System.err.print(CR + bar)
    lastUpdateTime = now
  }
  lastProgressBar = bar
}

这篇关于什么进度条上的数字火花壳是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆