xkrogen commented on a change in pull request #34604:
URL: https://github.com/apache/spark/pull/34604#discussion_r750622374
##########
File path:
core/src/main/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProvider.scala
##########
@@ -121,6 +121,15 @@ private[deploy] class HadoopFSDelegationTokenProvider
creds
}
+ private def cancelDelegationTokens(hadoopConf: Configuration,
+ creds: Credentials) : Unit = {
+
+ creds.getAllTokens
+ .asScala
+
.filter(_.decodeIdentifier().isInstanceOf[AbstractDelegationTokenIdentifier])
+ .foreach { token => token.cancel(hadoopConf) }
+ }
Review comment:
Maybe this? A little more Scala-idiomatic to use a pattern match instead
of `isInstanceOf`
```suggestion
creds.getAllTokens.asScala.foreach {
case id: AbstractDelegationTokenIdentifier => id.cancel(hadoopConf)
case _ => // ignore
}
```
--
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]