Skip to content

Commit

Permalink
Some more feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Vanzin committed Jan 14, 2015
1 parent 54cd4fd commit 7ed8859
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package org.apache.spark.deploy.worker

import java.io.{File, FileOutputStream, InputStream, IOException}
import java.lang.System._
import java.util.{ArrayList, List => JList, Map => JMap}
import java.util.{List => JList, Map => JMap}

import scala.collection.JavaConversions._
import scala.collection.Map
Expand Down Expand Up @@ -112,7 +112,7 @@ object CommandUtils extends Logging {
}
}

private class CommandLauncher(sparkHome: String, memory: Int, env: Map[String, String])
private class CommandLauncher(sparkHome: String, memoryMb: Int, env: Map[String, String])
extends AbstractLauncher[CommandLauncher](env) {

setSparkHome(sparkHome)
Expand All @@ -121,8 +121,8 @@ private class CommandLauncher(sparkHome: String, memory: Int, env: Map[String, S
val cmd = buildJavaCommand()
cmd.add("-cp")
cmd.add(buildClassPath(null).mkString(File.pathSeparator))
cmd.add(s"-Xms${memory}M")
cmd.add(s"-Xmx${memory}M")
cmd.add(s"-Xms${memoryMb}M")
cmd.add(s"-Xmx${memoryMb}M")
addOptionString(cmd, getenv("SPARK_JAVA_OPTS"))
cmd
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
import java.util.regex.Pattern;

/**
* Basic functionality for launchers.
* Basic functionality for launchers - objects that encapsulate knowledge about how to build the
* commands to run a Spark application or service. This class is not meant to be extended by user
* code.
*/
public abstract class AbstractLauncher<T extends AbstractLauncher> extends LauncherCommon {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.Map;

/**
* Configuration key definitions for Spark jobs, and some helper methods.
* Configuration key definitions for Spark apps, and some helper methods.
*/
public class LauncherCommon {

Expand Down Expand Up @@ -128,7 +128,7 @@ protected static boolean isWindows() {
* Updates the user environment to contain the merged value of "envKey" after appending
* the given path list.
*/
protected void mergeEnvPathList(Map<String, String> userEnv, String envKey, String pathList) {
protected static void mergeEnvPathList(Map<String, String> userEnv, String envKey, String pathList) {
if (!isEmpty(pathList)) {
String current = firstNonEmpty(userEnv.get(envKey), System.getenv(envKey));
userEnv.put(envKey, join(File.pathSeparator, current, pathList));
Expand Down

0 comments on commit 7ed8859

Please sign in to comment.