Ngone51 commented on a change in pull request #31876:
URL: https://github.com/apache/spark/pull/31876#discussion_r618108242
##########
File path: core/src/main/scala/org/apache/spark/scheduler/MapStatus.scala
##########
@@ -52,8 +55,41 @@ private[spark] sealed trait MapStatus {
* partitionId of the task or taskContext.taskAttemptId is used.
*/
def mapId: Long
+
}
+private[spark] class MapStatusLocationFactory(conf: SparkConf) {
+ private val locationExtension = classOf[Location]
+ private val (locationConstructor, locationName) = {
+ conf.get(config.SHUFFLE_LOCATION_PLUGIN_CLASS).map { className =>
+ val clazz = Utils.classForName(className)
+ require(locationExtension.isAssignableFrom(clazz),
+ s"$className is not a subclass of ${locationExtension.getName}.")
+ (clazz.getConstructor(), className)
+ }.orNull
+ }
+
+ private lazy val locationCache: LoadingCache[Location, Location] =
CacheBuilder.newBuilder()
+ .maximumSize(10000)
Review comment:
The number (10000) actually comes from the `blockManagerIdCache`.
Make a conf sounds good to me.
--
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]