Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPARK-1652: Remove incorrect deprecation warning in spark-submit #578

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ object SparkSubmit {
childArgs += ("--class", appArgs.mainClass)
}

// Special flag to avoid deprecation warnings at the client
sysProps("SPARK_SUBMIT") = "true"

val options = List[OptionAssigner](
new OptionAssigner(appArgs.master, ALL_CLUSTER_MGRS, false, sysProp = "spark.master"),
new OptionAssigner(appArgs.driverExtraClassPath, STANDALONE | YARN, true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class SparkSubmitSuite extends FunSuite with ShouldMatchers {
childArgsStr should include ("--num-executors 6")
mainClass should be ("org.apache.spark.deploy.yarn.Client")
classpath should have length (0)
sysProps should have size (0)
sysProps should have size (1)
}

test("handles YARN client mode") {
Expand All @@ -146,6 +146,7 @@ class SparkSubmitSuite extends FunSuite with ShouldMatchers {
sysProps("spark.yarn.dist.files") should be ("file1.txt,file2.txt")
sysProps("spark.yarn.dist.archives") should be ("archive1.txt,archive2.txt")
sysProps("spark.executor.instances") should be ("6")
sysProps("SPARK_SUBMIT") should be ("true")
}

test("handles standalone cluster mode") {
Expand All @@ -159,7 +160,7 @@ class SparkSubmitSuite extends FunSuite with ShouldMatchers {
childArgsStr should include ("launch spark://h:p thejar.jar org.SomeClass arg1 arg2")
mainClass should be ("org.apache.spark.deploy.Client")
classpath should have length (0)
sysProps should have size (1) // contains --jar entry
sysProps should have size (2) // contains --jar entry and SPARK_SUBMIT
}

test("handles standalone client mode") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
object Client {

def main(argStrings: Array[String]) {
println("WARNING: This client is deprecated and will be removed in a future version of Spark.")
println("Use ./bin/spark-submit with \"--master yarn\"")
if (!sys.props.contains("SPARK_SUBMIT")) {
println("WARNING: This client is deprecated and will be removed in a " +
"future version of Spark. Use ./bin/spark-submit with \"--master yarn\"")
}

// Set an env variable indicating we are running in YARN mode.
// Note that anything with SPARK prefix gets propagated to all (remote) processes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ class Client(clientArgs: ClientArguments, hadoopConf: Configuration, spConf: Spa
object Client {

def main(argStrings: Array[String]) {
println("WARNING: This client is deprecated and will be removed in a future version of Spark.")
println("Use ./bin/spark-submit with \"--master yarn\"")
if (!sys.props.contains("SPARK_SUBMIT")) {
println("WARNING: This client is deprecated and will be removed in a " +
"future version of Spark. Use ./bin/spark-submit with \"--master yarn\"")
}

// Set an env variable indicating we are running in YARN mode.
// Note: anything env variable with SPARK_ prefix gets propagated to all (remote) processes -
Expand Down