vanzin commented on a change in pull request #24245: [SPARK-13704][CORE][YARN]
Reduce rack resolution time
URL: https://github.com/apache/spark/pull/24245#discussion_r270597904
##########
File path:
resource-managers/yarn/src/main/scala/org/apache/spark/scheduler/cluster/YarnScheduler.scala
##########
@@ -17,23 +17,29 @@
package org.apache.spark.scheduler.cluster
-import org.apache.hadoop.yarn.util.RackResolver
-import org.apache.log4j.{Level, Logger}
+import org.apache.hadoop.net.NetworkTopology
import org.apache.spark._
+import org.apache.spark.deploy.yarn.SparkRackResolver
import org.apache.spark.scheduler.TaskSchedulerImpl
import org.apache.spark.util.Utils
private[spark] class YarnScheduler(sc: SparkContext) extends
TaskSchedulerImpl(sc) {
- // RackResolver logs an INFO message whenever it resolves a rack, which is
way too often.
- if (Logger.getLogger(classOf[RackResolver]).getLevel == null) {
- Logger.getLogger(classOf[RackResolver]).setLevel(Level.WARN)
- }
+ override val defaultRackValue: Option[String] =
Some(NetworkTopology.DEFAULT_RACK)
+
+ private[spark] val resolver = new SparkRackResolver(sc.hadoopConfiguration)
Review comment:
Use the shared instance?
Or, if not using the shared instance, then the `SparkRackResolver` object
can go away.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]