shuwang21 commented on code in PR #41821:
URL: https://github.com/apache/spark/pull/41821#discussion_r1252563553
##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/ClientDistributedCacheManagerSuite.scala:
##########
@@ -45,6 +45,63 @@ class ClientDistributedCacheManagerSuite extends
SparkFunSuite with MockitoSugar
}
}
+ /*
+ * This this a customized ClientDistributedCacheManager to test statCache.
+ * */
+ class CustomizedClientDistributedCacheManager extends
ClientDistributedCacheManager {
+ override def addResource(fs: FileSystem, conf: Configuration, destPath:
Path,
+ localResources: HashMap[String, LocalResource], resourceType:
LocalResourceType,
+ link: String, statCache: Map[URI, FileStatus], appMasterOnly: Boolean):
Unit = {
+ statCache.getOrElseUpdate(destPath.toUri(), fs.getFileStatus(destPath))
+ }
+
+ /*
+ * This simulates the isPublic method. It will return true if the result is
cached in the
+ * statCache.
+ * */
+ def isPublicResultCached(uri: URI, statCache: Map[URI, FileStatus]):
Boolean = {
+ statCache.get(uri) match {
+ case Some(_) => true
+ case None => false
+ }
Review Comment:
Thanks!
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]