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

    https://github.com/apache/spark/pull/3916#discussion_r25315581
  
    --- Diff: 
launcher/src/main/java/org/apache/spark/launcher/SparkSubmitOptionParser.java 
---
    @@ -0,0 +1,226 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.launcher;
    +
    +import java.util.List;
    +import java.util.regex.Matcher;
    +import java.util.regex.Pattern;
    +
    +/**
    + * Parser for spark-submit command line options.
    + * </p>
    + * This class, although public, is not designed to be used outside of 
Spark.
    + * <p/>
    + * This class encapsulates the parsing code for spark-submit command line 
options, so that there
    + * is a single list of options that needs to be maintained (well, sort of, 
but it makes it harder
    + * to break things).
    + */
    +class SparkSubmitOptionParser {
    +
    +  // The following constants define the "main" name for the available 
options. They're defined
    +  // to avoid copy & paste of the raw strings where they're needed.
    +  //
    +  // The fields are not static so that they're exposed to Scala code that 
uses this class. See
    +  // SparkSubmitArguments.scala. That is also why this class is not 
abstract - to allow code to
    +  // easily use these constants without having to create dummy 
implementations of this class.
    +  protected final String CLASS = "--class";
    +  protected final String CONF = "--conf";
    +  protected final String DEPLOY_MODE = "--deploy-mode";
    +  protected final String DRIVER_CLASS_PATH = "--driver-class-path";
    +  protected final String DRIVER_CORES = "--driver-cores";
    +  protected final String DRIVER_JAVA_OPTIONS =  "--driver-java-options";
    +  protected final String DRIVER_LIBRARY_PATH = "--driver-library-path";
    +  protected final String DRIVER_MEMORY = "--driver-memory";
    +  protected final String EXECUTOR_MEMORY = "--executor-memory";
    +  protected final String FILES = "--files";
    +  protected final String JARS = "--jars";
    +  protected final String KILL_SUBMISSION = "--kill";
    +  protected final String MASTER = "--master";
    +  protected final String NAME = "--name";
    +  protected final String PACKAGES = "--packages";
    +  protected final String PROPERTIES_FILE = "--properties-file";
    +  protected final String PROXY_USER = "--proxy-user";
    +  protected final String PY_FILES = "--py-files";
    +  protected final String REPOSITORIES = "--repositories";
    +  protected final String STATUS = "--status";
    +  protected final String TOTAL_EXECUTOR_CORES = "--total-executor-cores";
    +
    +  // Options that do not take arguments.
    +  protected final String HELP = "--help";
    +  protected final String SUPERVISE = "--supervise";
    +  protected final String VERBOSE = "--verbose";
    +  protected final String VERSION = "--version";
    +
    +  // Standalone-only options.
    +
    +  // YARN-only options.
    +  protected final String ARCHIVES = "--archives";
    +  protected final String EXECUTOR_CORES = "--executor-cores";
    +  protected final String QUEUE = "--queue";
    +  protected final String NUM_EXECUTORS = "--num-executors";
    --- End diff --
    
    There's a big comment explaining why they're not static.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to