viirya commented on a change in pull request #31761:
URL: https://github.com/apache/spark/pull/31761#discussion_r588969225



##########
File path: 
core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala
##########
@@ -99,11 +100,24 @@ private[deploy] class HadoopFSDelegationTokenProvider
   private def fetchDelegationTokens(
       renewer: String,
       filesystems: Set[FileSystem],
-      creds: Credentials): Credentials = {
+      creds: Credentials,
+      hadoopConf: Configuration,
+      sparkConf: SparkConf): Credentials = {
+
+    // The filesystems excluded from token renewal
+    val fsToExclude = sparkConf.get(KERBEROS_FILESYSTEM_RENEWAL_EXCLUDE)
+      .map(new Path(_).getFileSystem(hadoopConf).getUri.getHost)
+      .toSet
 
     filesystems.foreach { fs =>
-      logInfo(s"getting token for: $fs with renewer $renewer")
-      fs.addDelegationTokens(renewer, creds)
+      if (fsToExclude.contains(fs.getUri.getHost)) {

Review comment:
       No, we can accept hosts directly. It doesn't matter here. Either URL or 
host can achieve the same result we want.
   
   It takes file system URLs because I let it to be consistent with other 
configs like `KERBEROS_FILESYSTEMS_TO_ACCESS`.
   
   




----------------------------------------------------------------
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]

Reply via email to