This is an automated email from the ASF dual-hosted git repository.

vanzin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new b484490  [SPARK-26694][CORE] Progress bar should be enabled by default 
for spark-shell
b484490 is described below

commit b484490824527bd036b94bba86972d7c0bad26c8
Author: ankurgupta <ankur.gu...@cloudera.com>
AuthorDate: Fri Jan 25 10:21:26 2019 -0800

    [SPARK-26694][CORE] Progress bar should be enabled by default for 
spark-shell
    
    ## What changes were proposed in this pull request?
    SPARK-21568 made a change to ensure that progress bar is enabled for 
spark-shell
    by default but not for other apps. Before that change, this was 
distinguished
    using log-level which is not a good way to determine the same as users can 
change
    the default log-level. That commit changed the way to determine whether 
current
    app is running in spark-shell or not but it left the log-level part as it 
is,
    which causes this regression. SPARK-25118 changed the default log level to 
INFO
    for spark-shell because of which the progress bar is not enabled anymore.
    
    This commit will remove the log-level check for enabling progress bar for
    spark-shell as it is not necessary and seems to be a leftover from 
SPARK-21568
    
    ## How was this patch tested?
    1. Ensured that progress bar is enabled with spark-shell by default
    2. Ensured that progress bar is not enabled with spark-submit
    
    Closes #23618 from ankuriitg/ankurgupta/SPARK-26694.
    
    Authored-by: ankurgupta <ankur.gu...@cloudera.com>
    Signed-off-by: Marcelo Vanzin <van...@cloudera.com>
---
 .../src/main/scala/org/apache/spark/SparkContext.scala |  2 +-
 .../org/apache/spark/deploy/SparkSubmitSuite.scala     | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala 
b/core/src/main/scala/org/apache/spark/SparkContext.scala
index be70d42..f2b79b8 100644
--- a/core/src/main/scala/org/apache/spark/SparkContext.scala
+++ b/core/src/main/scala/org/apache/spark/SparkContext.scala
@@ -434,7 +434,7 @@ class SparkContext(config: SparkConf) extends Logging {
     _statusTracker = new SparkStatusTracker(this, _statusStore)
 
     _progressBar =
-      if (_conf.get(UI_SHOW_CONSOLE_PROGRESS) && !log.isInfoEnabled) {
+      if (_conf.get(UI_SHOW_CONSOLE_PROGRESS)) {
         Some(new ConsoleProgressBar(this))
       } else {
         None
diff --git a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala 
b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
index 3712d1a..4b414f7 100644
--- a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
+++ b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala
@@ -479,11 +479,29 @@ class SparkSubmitSuite
     val appArgs1 = new SparkSubmitArguments(clArgs1)
     val (_, _, conf1, _) = submit.prepareSubmitEnvironment(appArgs1)
     conf1.get(UI_SHOW_CONSOLE_PROGRESS) should be (true)
+    var sc1: SparkContext = null
+    try {
+      sc1 = new SparkContext(conf1)
+      assert(sc1.progressBar.isDefined)
+    } finally {
+      if (sc1 != null) {
+        sc1.stop()
+      }
+    }
 
     val clArgs2 = Seq("--class", "org.SomeClass", "thejar.jar")
     val appArgs2 = new SparkSubmitArguments(clArgs2)
     val (_, _, conf2, _) = submit.prepareSubmitEnvironment(appArgs2)
     assert(!conf2.contains(UI_SHOW_CONSOLE_PROGRESS))
+    var sc2: SparkContext = null
+    try {
+      sc2 = new SparkContext(conf2)
+      assert(!sc2.progressBar.isDefined)
+    } finally {
+      if (sc2 != null) {
+        sc2.stop()
+      }
+    }
   }
 
   test("launch simple application with spark-submit") {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to