diff options
author | Jacek Laskowski <jacek@japila.pl> | 2014-05-14 15:45:52 -0700 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-05-14 15:45:52 -0700 |
commit | 601e37198b97ba52e72ac13213c391c932e97b67 (patch) | |
tree | 8e7c21c3d3c7bf4d3d5873d7a00859a2afdc6e2c | |
parent | 94c6c06ea13032b80610b3f54401d2ef2aa4874a (diff) | |
download | spark-601e37198b97ba52e72ac13213c391c932e97b67.tar.gz spark-601e37198b97ba52e72ac13213c391c932e97b67.tar.bz2 spark-601e37198b97ba52e72ac13213c391c932e97b67.zip |
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
-rw-r--r-- | core/src/main/scala/org/apache/spark/SparkEnv.scala | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/core/src/main/scala/org/apache/spark/SparkEnv.scala b/core/src/main/scala/org/apache/spark/SparkEnv.scala index 19d507c0cf..720151a6b0 100644 --- a/core/src/main/scala/org/apache/spark/SparkEnv.scala +++ b/core/src/main/scala/org/apache/spark/SparkEnv.scala @@ -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 |