Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/2711#discussion_r19254244
--- Diff:
core/src/main/scala/org/apache/spark/deploy/worker/CommandUtils.scala ---
@@ -38,6 +40,19 @@ object CommandUtils extends Logging {
command.arguments
}
+ def buildEnvironment(command: Command,
+ env: Map[String, String] = sys.env): Map[String, String] = {
+ val libraryPathEntries = command.libraryPathEntries
+ if (libraryPathEntries.nonEmpty) {
+ val libraryPathName = Utils.libraryPathName
+ val cmdLibraryPath = command.environment.get(libraryPathName)
+ val libraryPaths = libraryPathEntries ++ cmdLibraryPath ++
env.get(libraryPathName)
+ command.environment + ((libraryPathName,
libraryPaths.mkString(File.pathSeparator)))
+ } else {
+ command.environment
+ }
+ }
+
--- End diff --
The semantics of `buildEnvironment` is very strange to me. It's not
intuitive to me at all why the user should use
`CommandUtils.buildEnvironment(command)` instead of `command.environment`. I
think we should add the library path when we create the `Command` in the first
place (e.g. in `SparkDeploySchedulerBackend`).
(Same for `buildJavaOpts`, which should really be private since it's used
only in the same file in 1 place)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]