18
18
package org .apache .spark .deploy
19
19
20
20
import java .io ._
21
- import java .lang .reflect .{InvocationTargetException , Modifier , UndeclaredThrowableException }
21
+ import java .lang .reflect .{InvocationTargetException , UndeclaredThrowableException }
22
22
import java .net .URL
23
23
import java .security .PrivilegedExceptionAction
24
24
import java .text .ParseException
25
25
26
26
import scala .annotation .tailrec
27
- import scala .collection .mutable .{ ArrayBuffer , HashMap , Map }
27
+ import scala .collection .mutable .ArrayBuffer
28
28
import scala .util .{Properties , Try }
29
29
30
30
import org .apache .commons .lang3 .StringUtils
@@ -77,11 +77,7 @@ object SparkSubmit extends CommandLineUtils with Logging {
77
77
private val MESOS = 4
78
78
private val LOCAL = 8
79
79
private val KUBERNETES = 16
80
- <<<<<<< HEAD
81
- private val ALL_CLUSTER_MGRS = YARN | STANDALONE | MESOS | KUBERNETES | LOCAL
82
- =======
83
80
private val ALL_CLUSTER_MGRS = YARN | STANDALONE | MESOS | LOCAL | KUBERNETES
84
- >>>>>>> master
85
81
86
82
// Deploy modes
87
83
private val CLIENT = 1
@@ -351,7 +347,6 @@ object SparkSubmit extends CommandLineUtils with Logging {
351
347
val isMesosCluster = clusterManager == MESOS && deployMode == CLUSTER
352
348
val isKubernetesCluster = clusterManager == KUBERNETES && deployMode == CLUSTER
353
349
val isStandAloneCluster = clusterManager == STANDALONE && deployMode == CLUSTER
354
- val isKubernetesCluster = clusterManager == KUBERNETES && deployMode == CLUSTER
355
350
356
351
if (! isMesosCluster && ! isStandAloneCluster) {
357
352
// Resolve maven dependencies if there are any and add classpath to jars. Add them to py-files
@@ -586,16 +581,11 @@ object SparkSubmit extends CommandLineUtils with Logging {
586
581
OptionAssigner (args.principal, YARN , ALL_DEPLOY_MODES , confKey = " spark.yarn.principal" ),
587
582
OptionAssigner (args.keytab, YARN , ALL_DEPLOY_MODES , confKey = " spark.yarn.keytab" ),
588
583
589
- <<<<<<< HEAD
590
584
OptionAssigner (args.kubernetesNamespace, KUBERNETES , ALL_DEPLOY_MODES ,
591
585
confKey = " spark.kubernetes.namespace" ),
592
586
593
- // Other options
594
- OptionAssigner (args.executorCores, STANDALONE | YARN , ALL_DEPLOY_MODES ,
595
- =======
596
587
// Other options
597
588
OptionAssigner (args.executorCores, STANDALONE | YARN | KUBERNETES , ALL_DEPLOY_MODES ,
598
- >>>>>>> master
599
589
confKey = " spark.executor.cores" ),
600
590
OptionAssigner (args.executorMemory, STANDALONE | MESOS | YARN | KUBERNETES , ALL_DEPLOY_MODES ,
601
591
confKey = " spark.executor.memory" ),
@@ -606,11 +596,7 @@ object SparkSubmit extends CommandLineUtils with Logging {
606
596
OptionAssigner (args.jars, LOCAL , CLIENT , confKey = " spark.jars" ),
607
597
OptionAssigner (args.jars, STANDALONE | MESOS | KUBERNETES , ALL_DEPLOY_MODES ,
608
598
confKey = " spark.jars" ),
609
- <<<<<<< HEAD
610
- OptionAssigner (args.driverMemory, STANDALONE | MESOS | YARN , CLUSTER ,
611
- =======
612
599
OptionAssigner (args.driverMemory, STANDALONE | MESOS | YARN | KUBERNETES , CLUSTER ,
613
- >>>>>>> master
614
600
confKey = " spark.driver.memory" ),
615
601
OptionAssigner (args.driverCores, STANDALONE | MESOS | YARN | KUBERNETES , CLUSTER ,
616
602
confKey = " spark.driver.cores" ),
@@ -748,32 +734,22 @@ object SparkSubmit extends CommandLineUtils with Logging {
748
734
}
749
735
750
736
if (isKubernetesCluster) {
751
- <<<<<<< HEAD
752
- childMainClass = " org.apache.spark.deploy.k8s.submit.Client"
737
+ childMainClass = KUBERNETES_CLUSTER_SUBMIT_CLASS
753
738
if (args.isPython) {
754
739
childArgs ++= Array (" --primary-py-file" , args.primaryResource)
755
740
childArgs ++= Array (" --main-class" , " org.apache.spark.deploy.PythonRunner" )
756
741
if (args.pyFiles != null ) {
757
742
childArgs ++= Array (" --other-py-files" , args.pyFiles)
758
743
}
759
744
} else {
760
- childArgs ++= Array (" --primary-java-resource" , args.primaryResource)
745
+ if (args.primaryResource != SparkLauncher .NO_RESOURCE ) {
746
+ childArgs ++= Array (" --primary-java-resource" , args.primaryResource)
747
+ }
761
748
childArgs ++= Array (" --main-class" , args.mainClass)
762
749
}
763
750
args.childArgs.foreach { arg =>
764
751
childArgs += " --arg"
765
752
childArgs += arg
766
- =======
767
- childMainClass = KUBERNETES_CLUSTER_SUBMIT_CLASS
768
- if (args.primaryResource != SparkLauncher .NO_RESOURCE ) {
769
- childArgs ++= Array (" --primary-java-resource" , args.primaryResource)
770
- }
771
- childArgs ++= Array (" --main-class" , args.mainClass)
772
- if (args.childArgs != null ) {
773
- args.childArgs.foreach { arg =>
774
- childArgs += (" --arg" , arg)
775
- }
776
- >>>>>>> master
777
753
}
778
754
}
779
755
0 commit comments