Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/6394#discussion_r31955646
--- Diff: core/src/main/scala/org/apache/spark/SparkContext.scala ---
@@ -1374,12 +1374,15 @@ class SparkContext(config: SparkConf) extends
Logging with ExecutorAllocationCli
* This can result in canceling pending requests or filing additional
requests.
* This is currently only supported in YARN mode. Return whether the
request is received.
*/
- private[spark] override def requestTotalExecutors(numExecutors: Int):
Boolean = {
+ private[spark] override def requestTotalExecutors(
+ numExecutors: Int,
+ localityAwarePendingTasks: Int,
+ preferredLocalityToCount: scala.Predef.Map[String, Int]): Boolean = {
--- End diff --
I don't think there is anything *wrong* with importing `Predef.Map`, but I
always think its somewhat suspicious. Scala collection defines three different
`Map` interfaces: `scala.collecton.immutable.Map`,
`scala.collection.mutable.Map`, and `scala.collection.Map`.
`scala.collection.Map` is a parent for both the mutable and immutable version.
`scala.Predef.Map` is just an alias for `s.c.immutable.Map`.
So you are effectively requiring `s.c.immutable.Map` here. The reason you
need to qualify it in this location and not elsehwere is because this file
already imports `scala.collection.Map`. Do you really want this method to take
any `Map`, whether its mutable or immutable? If so, then in the other places
that interact with this interface, you should explicitly say
`scala.collection.Map`. Or if you really want this as is (only accept
immutable Maps), I personally prefer to make it explicitly
`scala.collection.immutable.Map`, rather than `scala.Predef.Map`, b/c it makes
the intent more clear.
Sorry if you already knew all this, but I think this is an often confusing
part scala collections so thought I'd explain.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]