in client/migrationx/migrationx-transformer/src/main/java/com/aliyun/dataworks/migrationx/transformer/core/spark/command/SparkSubmitCommandBuilder.java [430:515]
protected boolean handle(String opt, String value) {
switch (opt) {
case FILES:
files.addAll(Arrays.asList(value.split(",")));
break;
case PY_FILES:
pyFiles.addAll(Arrays.asList(value.split(",")));
break;
case EXECUTOR_CORES:
conf.put(SparkLauncher.EXECUTOR_CORES, value);
break;
case EXECUTOR_MEMORY:
conf.put(SparkLauncher.EXECUTOR_MEMORY, value);
break;
case DRIVER_CORES:
conf.put(SparkLauncher.DRIVER_CORES, value);
break;
case NUM_EXECUTORS:
numExecutors = Integer.valueOf(value);
conf.put(SparkLauncher.EXECUTOR_INSTANCES, value);
break;
case QUEUE:
queue = value;
break;
case NAME:
appName = value;
break;
case MASTER:
master = value;
break;
case DEPLOY_MODE:
deployMode = value;
break;
case PROPERTIES_FILE:
propertiesFile = value;
break;
case DRIVER_MEMORY:
conf.put(SparkLauncher.DRIVER_MEMORY, value);
break;
case DRIVER_JAVA_OPTIONS:
conf.put(SparkLauncher.DRIVER_EXTRA_JAVA_OPTIONS, value);
break;
case DRIVER_LIBRARY_PATH:
conf.put(SparkLauncher.DRIVER_EXTRA_LIBRARY_PATH, value);
break;
case DRIVER_CLASS_PATH:
conf.put(SparkLauncher.DRIVER_EXTRA_CLASSPATH, value);
break;
case CONF:
checkArgument(value != null, "Missing argument to %s", CONF);
String[] setConf = value.split("=", 2);
checkArgument(setConf.length == 2, "Invalid argument to %s: %s", CONF, value);
conf.put(setConf[0], setConf[1]);
break;
case CLASS:
// The special classes require some special command line handling, since they allow
// mixing spark-submit arguments with arguments that should be propagated to the shell
// itself. Note that for this to work, the "--class" argument must come before any
// non-spark-submit arguments.
mainClass = value;
if (specialClasses.containsKey(value)) {
allowsMixedArguments = true;
appResource = specialClasses.get(value);
}
break;
case KILL_SUBMISSION:
case STATUS:
isSpecialCommand = true;
parsedArgs.add(opt);
parsedArgs.add(value);
break;
case HELP:
case USAGE_ERROR:
case VERSION:
isSpecialCommand = true;
parsedArgs.add(opt);
break;
default:
parsedArgs.add(opt);
if (value != null) {
parsedArgs.add(value);
}
break;
}
return true;
}