-
Notifications
You must be signed in to change notification settings - Fork 28k
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-26632][Core] Separate Thread Configurations of Driver and Executor #23560
Closed
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4c16bf8
separate thread configurations of driver and executor for serverThrea…
jiafuzha 81b4bf0
Revert "separate thread configurations of driver and executor for ser…
jiafuzha d5ec0a0
separate thread configurations of driver and executor for serverThrea…
jiafuzha dd8405d
correct some style issue
jiafuzha ab9b965
correct style issue
jiafuzha 5427eb8
correct style issue
jiafuzha ecab1cc
add check for driver's legacy identifier
jiafuzha 7519af3
override io threads with specific values for driver and executor
jiafuzha 64e9536
correct indent
jiafuzha d0b319d
Merge remote-tracking branch 'upstream/master'
jiafuzha 1f813ec
Merge branch 'master' into thread_conf_separation
jiafuzha 0fafe21
use role instead of boolean to differentiate driver and executor
jiafuzha 11233d2
more accurate code to look for driver and executor thread configuration
jiafuzha 59f9922
remove SparkContext.LEGACY_DRIVER_IDENTIFIER
jiafuzha bedf0fe
fix binary incompatibility issue
jiafuzha d73cfb5
refined code
jiafuzha cb4e5aa
restructure code and fix executor id missing issue
jiafuzha 8f82381
Merge branch 'master' of https://github.com/apache/spark
jiafuzha e4b1023
merged from master to resolve conflict
jiafuzha 05164b9
OMerge branch 'master' of https://github.com/apache/spark
jiafuzha 5b9d86e
Merge branch 'master' into thread_conf_separation
jiafuzha cb27a2c
rewrite some code and add documentation
jiafuzha 51f78ed
miscellaneous changes
jiafuzha 6bdfe6d
miscellaneous udpdate
jiafuzha File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
core/src/test/scala/org/apache/spark/network/netty/SparkTransportConfSuite.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* | ||
* 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.network.netty | ||
|
||
import org.scalatest.Matchers | ||
import org.scalatest.mockito.MockitoSugar | ||
|
||
import org.apache.spark.{SparkConf, SparkFunSuite} | ||
import org.apache.spark.network.util.NettyUtils | ||
|
||
class SparkTransportConfSuite extends SparkFunSuite with MockitoSugar { | ||
val module = "rpc" | ||
val serThreads = "serverThreads" | ||
val cliThreads = "clientThreads" | ||
|
||
test("default value is get when neither role nor module is set") { | ||
val numUsableCores = 4 | ||
val conf = new SparkConf() | ||
val sparkTransportConf = SparkTransportConf.fromSparkConf(conf, module, numUsableCores, None) | ||
val expected = NettyUtils.defaultNumThreads(numUsableCores) | ||
val serActual = sparkTransportConf.get(s"spark.$module.io.$serThreads", "") | ||
val cliActual = sparkTransportConf.get(s"spark.$module.io.$cliThreads", "") | ||
assert(serActual == expected.toString) | ||
assert(cliActual == expected.toString) | ||
} | ||
|
||
test("module value is get when role is not set") { | ||
val numUsableCores = 3 | ||
val serExpected = "7" | ||
val cliExpected = "5" | ||
val conf = new SparkConf() | ||
.set(s"spark.$module.io.$serThreads", serExpected) | ||
.set(s"spark.$module.io.$cliThreads", cliExpected) | ||
val sparkTransportConf = SparkTransportConf.fromSparkConf(conf, module, numUsableCores, None) | ||
val serActual = sparkTransportConf.get(s"spark.$module.io.$serThreads", "") | ||
val cliActual = sparkTransportConf.get(s"spark.$module.io.$cliThreads", "") | ||
assert(serActual == serExpected) | ||
assert(cliActual == cliExpected) | ||
} | ||
|
||
test("use correct configuration when both module and role configs are present") { | ||
val role = Some("driver") | ||
val numUsableCores = 10 | ||
val serModule = "7" | ||
val cliModule = "5" | ||
val serExpected = "8" | ||
val cliExpected = "6" | ||
val conf = new SparkConf() | ||
.set(s"spark.$module.io.$serThreads", serModule) | ||
.set(s"spark.$module.io.$cliThreads", cliModule) | ||
.set(s"spark.${role.get}.$module.io.$serThreads", serExpected) | ||
.set(s"spark.${role.get}.$module.io.$cliThreads", cliExpected) | ||
val sparkTransportConf = SparkTransportConf.fromSparkConf(conf, module, numUsableCores, role) | ||
val serActual = sparkTransportConf.get(s"spark.$module.io.$serThreads", "") | ||
val cliActual = sparkTransportConf.get(s"spark.$module.io.$cliThreads", "") | ||
assert(serActual == serExpected) | ||
assert(cliActual == cliExpected) | ||
|
||
val exeRole = Some("executor") | ||
val sparkTransConfExe = SparkTransportConf.fromSparkConf(conf, module, numUsableCores, exeRole) | ||
val serActualExe = sparkTransConfExe.get(s"spark.$module.io.$serThreads", "") | ||
val cliActualExe = sparkTransConfExe.get(s"spark.$module.io.$cliThreads", "") | ||
assert(serActualExe == serModule) | ||
assert(cliActualExe == cliModule) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems not necessary to separate into another line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine (one arg per line).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jerryshao , The guide says,
I'll keep this code.