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

    https://github.com/apache/spark/pull/563#discussion_r12023282
  
    --- 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 {
    --- End diff --
    
    the indent is off here - maybe you want to put opts match on the previous 
line?


---
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