vanzin commented on a change in pull request #23698: [SPARK-26766][CORE] Remove 
the list of filesystems from 
HadoopDelegationTokenProvider.obtainDelegationTokens
URL: https://github.com/apache/spark/pull/23698#discussion_r252862407
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala
 ##########
 @@ -133,3 +133,45 @@ private[deploy] class HadoopFSDelegationTokenProvider
     if (renewIntervals.isEmpty) None else Some(renewIntervals.min)
   }
 }
+
+private[deploy] object HadoopFSDelegationTokenProvider {
+  def hadoopFSsToAccess(
+      sparkConf: SparkConf,
+      hadoopConf: Configuration): Set[FileSystem] = {
+    val filesystemsToAccess = sparkConf.get(KERBEROS_FILESYSTEMS_TO_ACCESS)
+
+    val defaultFS = FileSystem.get(hadoopConf)
+    val master = sparkConf.get("spark.master", null)
+    val stagingFS = if (master != null && master.contains("yarn")) {
+      sparkConf.get(STAGING_DIR)
+        .map(new Path(_).getFileSystem(hadoopConf))
+        .getOrElse(defaultFS)
 
 Review comment:
   Feels weird to have this fall back to `defaultFS` when the default FS is 
treated separately. An `Option` seems better.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]

Reply via email to