Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
e49bc8ca
Commit
e49bc8ca
authored
11 years ago
by
Matei Zaharia
Browse files
Options
Downloads
Plain Diff
Merge pull request #663 from stephenh/option_and_getenv
Be cute with Option and getenv.
parents
32370da4
d7011632
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala
+6
-17
6 additions, 17 deletions
core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala
with
6 additions
and
17 deletions
core/src/main/scala/spark/deploy/worker/ExecutorRunner.scala
+
6
−
17
View file @
e49bc8ca
package
spark.deploy.worker
import
java.io._
import
java.lang.System.getenv
import
spark.deploy.
{
ExecutorState
,
ExecutorStateChanged
,
ApplicationDescription
}
import
akka.actor.ActorRef
import
spark.
{
Utils
,
Logging
}
...
...
@@ -77,11 +78,7 @@ private[spark] class ExecutorRunner(
def
buildCommandSeq
()
:
Seq
[
String
]
=
{
val
command
=
appDesc
.
command
val
runner
=
if
(
System
.
getenv
(
"JAVA_HOME"
)
==
null
)
{
"java"
}
else
{
System
.
getenv
(
"JAVA_HOME"
)
+
"/bin/java"
}
val
runner
=
Option
(
getenv
(
"JAVA_HOME"
)).
map
(
_
+
"/bin/java"
).
getOrElse
(
"java"
)
// SPARK-698: do not call the run.cmd script, as process.destroy()
// fails to kill a process tree on Windows
Seq
(
runner
)
++
buildJavaOpts
()
++
Seq
(
command
.
mainClass
)
++
...
...
@@ -93,18 +90,10 @@ private[spark] class ExecutorRunner(
* the way the JAVA_OPTS are assembled there.
*/
def
buildJavaOpts
()
:
Seq
[
String
]
=
{
val
libraryOpts
=
if
(
System
.
getenv
(
"SPARK_LIBRARY_PATH"
)
==
null
)
{
Nil
}
else
{
List
(
"-Djava.library.path="
+
System
.
getenv
(
"SPARK_LIBRARY_PATH"
))
}
val
userOpts
=
if
(
System
.
getenv
(
"SPARK_JAVA_OPTS"
)
==
null
)
{
Nil
}
else
{
Utils
.
splitCommandString
(
System
.
getenv
(
"SPARK_JAVA_OPTS"
))
}
val
libraryOpts
=
Option
(
getenv
(
"SPARK_LIBRARY_PATH"
))
.
map
(
p
=>
List
(
"-Djava.library.path="
+
p
))
.
getOrElse
(
Nil
)
val
userOpts
=
Option
(
getenv
(
"SPARK_JAVA_OPTS"
)).
map
(
Utils
.
splitCommandString
).
getOrElse
(
Nil
)
val
memoryOpts
=
Seq
(
"-Xms"
+
memory
+
"M"
,
"-Xmx"
+
memory
+
"M"
)
// Figure out our classpath with the external compute-classpath script
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment