Github user pwendell commented on a diff in the pull request:

    https://github.com/apache/spark/pull/563#discussion_r12022413
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala ---
    @@ -156,119 +156,123 @@ private[spark] class SparkSubmitArguments(args: 
Array[String]) {
         """.stripMargin
       }
     
    -  private def parseOpts(opts: List[String]): Unit = opts match {
    -    case ("--name") :: value :: tail =>
    -      name = value
    -      parseOpts(tail)
    -
    -    case ("--master") :: value :: tail =>
    -      master = value
    -      parseOpts(tail)
    -
    -    case ("--class") :: value :: tail =>
    -      mainClass = value
    -      parseOpts(tail)
    -
    -    case ("--deploy-mode") :: value :: tail =>
    -      if (value != "client" && value != "cluster") {
    -        SparkSubmit.printErrorAndExit("--deploy-mode must be either 
\"client\" or \"cluster\"")
    -      }
    -      deployMode = value
    -      parseOpts(tail)
    -
    -    case ("--num-executors") :: value :: tail =>
    -      numExecutors = value
    -      parseOpts(tail)
    -
    -    case ("--total-executor-cores") :: value :: tail =>
    -      totalExecutorCores = value
    -      parseOpts(tail)
    -
    -    case ("--executor-cores") :: value :: tail =>
    -      executorCores = value
    -      parseOpts(tail)
    -
    -    case ("--executor-memory") :: value :: tail =>
    -      executorMemory = value
    -      parseOpts(tail)
    -
    -    case ("--driver-memory") :: value :: tail =>
    -      driverMemory = value
    -      parseOpts(tail)
    -
    -    case ("--driver-cores") :: value :: tail =>
    -      driverCores = value
    -      parseOpts(tail)
    -
    -    case ("--driver-class-path") :: value :: tail =>
    -      driverExtraClassPath = value
    -      parseOpts(tail)
    -
    -    case ("--driver-java-options") :: value :: tail =>
    -      driverExtraJavaOptions = value
    -      parseOpts(tail)
    -
    -    case ("--driver-library-path") :: value :: tail =>
    -      driverExtraLibraryPath = value
    -      parseOpts(tail)
    -
    -    case ("--properties-file") :: value :: tail =>
    -      propertiesFile = value
    -      parseOpts(tail)
    -
    -    case ("--supervise") :: tail =>
    -      supervise = true
    -      parseOpts(tail)
    -
    -    case ("--queue") :: value :: tail =>
    -      queue = value
    -      parseOpts(tail)
    -
    -    case ("--files") :: value :: tail =>
    -      files = value
    -      parseOpts(tail)
    -
    -    case ("--archives") :: value :: tail =>
    -      archives = value
    -      parseOpts(tail)
    -
    -    case ("--arg") :: value :: tail =>
    -      childArgs += value
    -      parseOpts(tail)
    -
    -    case ("--jars") :: value :: tail =>
    -      jars = value
    -      parseOpts(tail)
    -
    -    case ("--help" | "-h") :: tail =>
    -      printUsageAndExit(0)
    -
    -    case ("--verbose" | "-v") :: tail =>
    -      verbose = true
    -      parseOpts(tail)
    -
    -    case value :: tail =>
    -      if (value.startsWith("-")) {
    -        val errMessage = s"Unrecognized option '$value'."
    -        val suggestion: Option[String] = value match {
    -          case v if v.startsWith("--") && v.contains("=") =>
    -            val parts = v.split("=")
    -            Some(s"Perhaps you want '${parts(0)} ${parts(1)}'?")
    -          case _ =>
    -            None
    +  /** Fill in values by parsing user options. */
    +  private def parseOpts(opts: Seq[String]): Unit = {
    +    // Delineates parsing of Spark options from parsing of user options.
    +    var inSparkOpts = true
    +    parse(opts)
    +
    +    def parse(opts: Seq[String]): Unit = {
    +      opts match {
    +      case ("--name") :: value :: tail =>
    +        name = value
    +        parse(tail)
    +
    +      case ("--master") :: value :: tail =>
    +        master = value
    +        parse(tail)
    +
    +      case ("--class") :: value :: tail =>
    +        mainClass = value
    +        parse(tail)
    +
    +      case ("--deploy-mode") :: value :: tail =>
    +        if (value != "client" && value != "cluster") {
    +          SparkSubmit.printErrorAndExit("--deploy-mode must be either 
\"client\" or \"cluster\"")
    +        }
    +        deployMode = value
    +        parse(tail)
    +
    +      case ("--num-executors") :: value :: tail =>
    +        numExecutors = value
    +        parse(tail)
    +
    +      case ("--total-executor-cores") :: value :: tail =>
    +        totalExecutorCores = value
    +        parse(tail)
    +
    +      case ("--executor-cores") :: value :: tail =>
    +        executorCores = value
    +        parse(tail)
    +
    +      case ("--executor-memory") :: value :: tail =>
    +        executorMemory = value
    +        parse(tail)
    +
    +      case ("--driver-memory") :: value :: tail =>
    +        driverMemory = value
    +        parse(tail)
    +
    +      case ("--driver-cores") :: value :: tail =>
    +        driverCores = value
    +        parse(tail)
    +
    +      case ("--driver-class-path") :: value :: tail =>
    +        driverExtraClassPath = value
    +        parse(tail)
    +
    +      case ("--driver-java-options") :: value :: tail =>
    +        driverExtraJavaOptions = value
    +        parse(tail)
    +
    +      case ("--driver-library-path") :: value :: tail =>
    +        driverExtraLibraryPath = value
    +        parse(tail)
    +
    +      case ("--properties-file") :: value :: tail =>
    +        propertiesFile = value
    +        parse(tail)
    +
    +      case ("--supervise") :: tail =>
    +        supervise = true
    +        parse(tail)
    +
    +      case ("--queue") :: value :: tail =>
    +        queue = value
    +        parse(tail)
    +
    +      case ("--files") :: value :: tail =>
    +        files = value
    +        parse(tail)
    +
    +      case ("--archives") :: value :: tail =>
    +        archives = value
    +        parse(tail)
    +
    +      case ("--jars") :: value :: tail =>
    +        jars = value
    +        parse(tail)
    +
    +      case ("--help" | "-h") :: tail =>
    +        printUsageAndExit(0)
    +
    +      case ("--verbose" | "-v") :: tail =>
    +        verbose = true
    +        parse(tail)
    +
    +      case value :: tail =>
    +        if (inSparkOpts) {
    --- End diff --
    
    The only change is here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to