You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by pw...@apache.org on 2014/05/15 00:46:01 UTC
git commit: String interpolation + some other small changes
Repository: spark
Updated Branches:
refs/heads/master 94c6c06ea -> 601e37198
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 <ja...@japila.pl>
Closes #748 from jaceklaskowski/sparkenv-string-interpolation and squashes the following commits:
be6ebac [Jacek Laskowski] String interpolation + some other small changes
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/601e3719
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/601e3719
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/601e3719
Branch: refs/heads/master
Commit: 601e37198b97ba52e72ac13213c391c932e97b67
Parents: 94c6c06
Author: Jacek Laskowski <ja...@japila.pl>
Authored: Wed May 14 15:45:52 2014 -0700
Committer: Patrick Wendell <pw...@gmail.com>
Committed: Wed May 14 15:45:52 2014 -0700
----------------------------------------------------------------------
.../main/scala/org/apache/spark/SparkEnv.scala | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/601e3719/core/src/main/scala/org/apache/spark/SparkEnv.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/SparkEnv.scala b/core/src/main/scala/org/apache/spark/SparkEnv.scala
index 19d507c..720151a 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