Skip to content

Commit 5774deb

Browse files
author
amenck
authored
Merge pull request apache-spark-on-k8s#343 from jeremyjliu/jl/expose-r-backend
Move RBackend to member variable
2 parents 5d88c95 + 44a14cd commit 5774deb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/src/main/scala/org/apache/spark/deploy/RRunner.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import org.apache.spark.util.RedirectThread
4040
* subprocess and then has it connect back to the JVM to access system properties etc.
4141
*/
4242
object RRunner extends CondaRunner with Logging {
43+
val sparkRBackend = new RBackend()
44+
4345
override def run(args: Array[String], maybeConda: Option[CondaEnvironment]): Unit = {
4446
val rFile = PythonRunner.formatPath(args(0))
4547

@@ -84,7 +86,6 @@ object RRunner extends CondaRunner with Logging {
8486

8587
// Launch a SparkR backend server for the R process to connect to; this will let it see our
8688
// Java system properties etc.
87-
val sparkRBackend = new RBackend()
8889
@volatile var sparkRBackendPort = 0
8990
val initialized = new Semaphore(0)
9091
val sparkRBackendThread = new Thread("SparkR backend") {

0 commit comments

Comments
 (0)