wypoon commented on a change in pull request #28848:
URL: https://github.com/apache/spark/pull/28848#discussion_r450568119
##########
File path:
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
##########
@@ -248,17 +252,17 @@ class DAGSchedulerSuite extends SparkFunSuite with
LocalSparkContext with TimeLi
*/
val cacheLocations = new HashMap[(Int, Int), Seq[BlockManagerId]]
// stub out BlockManagerMaster.getLocations to use our cacheLocations
- val blockManagerMaster = new BlockManagerMaster(null, null, conf, true) {
- override def getLocations(blockIds: Array[BlockId]):
IndexedSeq[Seq[BlockManagerId]] = {
- blockIds.map {
- _.asRDDId.map(id => (id.rddId -> id.splitIndex)).flatMap(key =>
cacheLocations.get(key)).
- getOrElse(Seq())
- }.toIndexedSeq
- }
- override def removeExecutor(execId: String): Unit = {
- // don't need to propagate to the driver, which we don't have
- }
+ class MyBlockManagerMaster(conf: SparkConf) extends BlockManagerMaster(null,
null, conf, true) {
+ override def getLocations(blockIds: Array[BlockId]):
IndexedSeq[Seq[BlockManagerId]] = {
+ blockIds.map {
+ _.asRDDId.map(id => (id.rddId -> id.splitIndex)).flatMap(key =>
cacheLocations.get(key)).
Review comment:
This was existing code that I simply moved into a class. Nevertheless, I
have now changed it to use braces for the map and flatMap.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]