Skip to content

Commit

Permalink
code refine
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-wang committed Aug 18, 2014
1 parent 3c1d554 commit 37db9c1
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ object CommandUtils extends Logging {
Seq()
}

val permGenOpt = Seq("-XX:MaxPermSize=128m")

// Figure out our classpath with the external compute-classpath script
val ext = if (System.getProperty("os.name").startsWith("Windows")) ".cmd" else ".sh"
val classPath = Utils.executeAndGetOutput(
Expand All @@ -77,13 +75,9 @@ object CommandUtils extends Logging {
val jvmversion = Utils.executeAndGetOutput(Seq(runner + " -version "),
extraEnvironment = command.environment)
val version = jvmversion.substring(jvmversion.indexOf("\"") + 1, jvmversion.indexOf("_"))
if (version.compareTo("1.8.0") < 0) {
Seq("-cp", userClassPath.filterNot(_.isEmpty).mkString(File.pathSeparator)) ++
permGenOpt ++ libraryOpts ++ workerLocalOpts ++ command.javaOpts ++ memoryOpts
} else {
Seq("-cp", userClassPath.filterNot(_.isEmpty).mkString(File.pathSeparator)) ++
libraryOpts ++ workerLocalOpts ++ command.javaOpts ++ memoryOpts
}
val permGenOpt = if (version.compareTo("1.8.0") < 0) Some("-XX:MaxPermSize=128m") else None
Seq("-cp", userClassPath.filterNot(_.isEmpty).mkString(File.pathSeparator)) ++
permGenOpt ++ libraryOpts ++ workerLocalOpts ++ command.javaOpts ++ memoryOpts
}

/** Spawn a thread that will redirect a given stream to a file */
Expand Down

0 comments on commit 37db9c1

Please sign in to comment.