Skip to content
Snippets Groups Projects
Commit 49dbfccf authored by Matei Zaharia's avatar Matei Zaharia
Browse files

Merge pull request #28 from tgravescs/sparYarnAppName

Allow users to set the application name for Spark on Yarn
parents e597ea34 c021b8c2
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ The command to launch the YARN Client is as follows: ...@@ -50,6 +50,7 @@ The command to launch the YARN Client is as follows:
--master-memory <MEMORY_FOR_MASTER> \ --master-memory <MEMORY_FOR_MASTER> \
--worker-memory <MEMORY_PER_WORKER> \ --worker-memory <MEMORY_PER_WORKER> \
--worker-cores <CORES_PER_WORKER> \ --worker-cores <CORES_PER_WORKER> \
--name <application_name> \
--queue <queue_name> --queue <queue_name>
For example: For example:
......
...@@ -106,7 +106,7 @@ class Client(conf: Configuration, args: ClientArguments) extends YarnClientImpl ...@@ -106,7 +106,7 @@ class Client(conf: Configuration, args: ClientArguments) extends YarnClientImpl
logInfo("Setting up application submission context for ASM") logInfo("Setting up application submission context for ASM")
val appContext = Records.newRecord(classOf[ApplicationSubmissionContext]) val appContext = Records.newRecord(classOf[ApplicationSubmissionContext])
appContext.setApplicationId(appId) appContext.setApplicationId(appId)
appContext.setApplicationName("Spark") appContext.setApplicationName(args.appName)
return appContext return appContext
} }
......
...@@ -32,6 +32,7 @@ class ClientArguments(val args: Array[String]) { ...@@ -32,6 +32,7 @@ class ClientArguments(val args: Array[String]) {
var numWorkers = 2 var numWorkers = 2
var amQueue = System.getProperty("QUEUE", "default") var amQueue = System.getProperty("QUEUE", "default")
var amMemory: Int = 512 var amMemory: Int = 512
var appName: String = "Spark"
// TODO // TODO
var inputFormatInfo: List[InputFormatInfo] = null var inputFormatInfo: List[InputFormatInfo] = null
...@@ -78,6 +79,10 @@ class ClientArguments(val args: Array[String]) { ...@@ -78,6 +79,10 @@ class ClientArguments(val args: Array[String]) {
amQueue = value amQueue = value
args = tail args = tail
case ("--name") :: value :: tail =>
appName = value
args = tail
case Nil => case Nil =>
if (userJar == null || userClass == null) { if (userJar == null || userClass == null) {
printUsageAndExit(1) printUsageAndExit(1)
...@@ -108,6 +113,7 @@ class ClientArguments(val args: Array[String]) { ...@@ -108,6 +113,7 @@ class ClientArguments(val args: Array[String]) {
" --worker-cores NUM Number of cores for the workers (Default: 1). This is unsused right now.\n" + " --worker-cores NUM Number of cores for the workers (Default: 1). This is unsused right now.\n" +
" --master-memory MEM Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n" + " --master-memory MEM Memory for Master (e.g. 1000M, 2G) (Default: 512 Mb)\n" +
" --worker-memory MEM Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n" + " --worker-memory MEM Memory per Worker (e.g. 1000M, 2G) (Default: 1G)\n" +
" --name NAME The name of your application (Default: Spark)\n" +
" --queue QUEUE The hadoop queue to use for allocation requests (Default: 'default')" " --queue QUEUE The hadoop queue to use for allocation requests (Default: 'default')"
) )
System.exit(exitCode) System.exit(exitCode)
......
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