File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
core/src/main/scala/org/apache/spark/deploy/worker Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -47,9 +47,16 @@ object CommandUtils extends Logging {
4747 */
4848 def buildJavaOpts (command : Command , memory : Int , sparkHome : String ): Seq [String ] = {
4949 val memoryOpts = Seq (s " -Xms ${memory}M " , s " -Xmx ${memory}M " )
50- // Note, this will coalesce multiple options into a single command component
5150 val extraOpts = command.extraJavaOptions.map(Utils .splitCommandString).getOrElse(Seq ())
5251
52+ // Exists for backwards compatibility with older Spark versions
53+ val workerLocalOpts = Option (getenv(" SPARK_JAVA_OPTS" )).map(Utils .splitCommandString)
54+ .getOrElse(Nil )
55+ if (workerLocalOpts.length > 0 ) {
56+ logWarning(" SPARK_JAVA_OPTS was set on the worker. It is deprecated in Spark 1.0." )
57+ logWarning(" Set SPARK_LOCAL_DIRS for node-specific storage locations." )
58+ }
59+
5360 val libraryOpts =
5461 if (command.libraryPathEntries.size > 0 ) {
5562 val joined = command.libraryPathEntries.mkString(File .pathSeparator)
@@ -66,7 +73,7 @@ object CommandUtils extends Logging {
6673 val userClassPath = command.classPathEntries ++ Seq (classPath)
6774
6875 Seq (" -cp" , userClassPath.filterNot(_.isEmpty).mkString(File .pathSeparator)) ++
69- libraryOpts ++ extraOpts ++ memoryOpts
76+ libraryOpts ++ extraOpts ++ workerLocalOpts ++ memoryOpts
7077 }
7178
7279 /** Spawn a thread that will redirect a given stream to a file */
You can’t perform that action at this time.
0 commit comments