Skip to content
Snippets Groups Projects
Commit 601e3719 authored by Jacek Laskowski's avatar Jacek Laskowski Committed by Patrick Wendell
Browse files

String interpolation + some other small changes

After having been invited to make the change in https://github.com/apache/spark/commit/6bee01dd04ef73c6b829110ebcdd622d521ea8ff#commitcomment-6284165 by @witgo.

Author: Jacek Laskowski <jacek@japila.pl>

Closes #748 from jaceklaskowski/sparkenv-string-interpolation and squashes the following commits:

be6ebac [Jacek Laskowski] String interpolation + some other small changes
parent 94c6c06e
No related branches found
No related tags found
No related merge requests found
......@@ -278,10 +278,11 @@ object SparkEnv extends Logging {
addedJars: Seq[String],
addedFiles: Seq[String]): Map[String, Seq[(String, String)]] = {
import Properties._
val jvmInformation = Seq(
("Java Version", "%s (%s)".format(Properties.javaVersion, Properties.javaVendor)),
("Java Home", Properties.javaHome),
("Scala Version", Properties.versionString)
("Java Version", s"$javaVersion ($javaVendor)"),
("Java Home", javaHome),
("Scala Version", versionString)
).sorted
// Spark properties
......@@ -296,18 +297,15 @@ object SparkEnv extends Logging {
// System properties that are not java classpaths
val systemProperties = System.getProperties.iterator.toSeq
val otherProperties = systemProperties.filter { case (k, v) =>
val otherProperties = systemProperties.filter { case (k, _) =>
k != "java.class.path" && !k.startsWith("spark.")
}.sorted
// Class paths including all added jars and files
val classPathProperty = systemProperties.find { case (k, v) =>
k == "java.class.path"
}.getOrElse(("", ""))
val classPathEntries = classPathProperty._2
val classPathEntries = javaClassPath
.split(File.pathSeparator)
.filterNot(e => e.isEmpty)
.map(e => (e, "System Classpath"))
.filterNot(_.isEmpty)
.map((_, "System Classpath"))
val addedJarsAndFiles = (addedJars ++ addedFiles).map((_, "Added By User"))
val classPaths = (addedJarsAndFiles ++ classPathEntries).sorted
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment