Skip to content

Commit 0e1c9d9

Browse files
Tom GravesAndrew Or
authored andcommitted
[SPARK-10549] scala 2.11 spark on yarn with security - Repl doesn't work
Make this lazy so that it can set the yarn mode before creating the securityManager. Author: Tom Graves <[email protected]> Author: Thomas Graves <[email protected]> Closes #8719 from tgravescs/SPARK-10549.
1 parent a0d564a commit 0e1c9d9

File tree

1 file changed

+2
-1
lines changed
  • repl/scala-2.11/src/main/scala/org/apache/spark/repl

1 file changed

+2
-1
lines changed

repl/scala-2.11/src/main/scala/org/apache/spark/repl/Main.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ object Main extends Logging {
3535
s.processArguments(List("-Yrepl-class-based",
3636
"-Yrepl-outdir", s"${outputDir.getAbsolutePath}",
3737
"-classpath", getAddedJars.mkString(File.pathSeparator)), true)
38-
val classServer = new HttpServer(conf, outputDir, new SecurityManager(conf))
38+
// the creation of SecurityManager has to be lazy so SPARK_YARN_MODE is set if needed
39+
lazy val classServer = new HttpServer(conf, outputDir, new SecurityManager(conf))
3940
var sparkContext: SparkContext = _
4041
var sqlContext: SQLContext = _
4142
var interp = new SparkILoop // this is a public var because tests reset it.

0 commit comments

Comments
 (0)