Github user jerryshao commented on a diff in the pull request:
https://github.com/apache/spark/pull/16432#discussion_r95537856
--- Diff:
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/security/HadoopFSCredentialProvider.scala
---
@@ -17,37 +17,39 @@
package org.apache.spark.deploy.yarn.security
-import java.io.{ByteArrayInputStream, DataInputStream}
-
import scala.collection.JavaConverters._
+import scala.util.Try
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.fs.{FileSystem, Path}
-import
org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier
import org.apache.hadoop.mapred.Master
import org.apache.hadoop.security.Credentials
+import
org.apache.hadoop.security.token.delegation.AbstractDelegationTokenIdentifier
import org.apache.spark.{SparkConf, SparkException}
import org.apache.spark.deploy.yarn.config._
import org.apache.spark.internal.Logging
import org.apache.spark.internal.config._
-private[security] class HDFSCredentialProvider extends
ServiceCredentialProvider with Logging {
+private[security] class HadoopFSCredentialProvider
+ extends ServiceCredentialProvider with Logging {
// Token renewal interval, this value will be set in the first call,
- // if None means no token renewer specified, so cannot get token renewal
interval.
+ // if None means no token renewer specified or no token can be renewed,
+ // so cannot get token renewal interval.
private var tokenRenewalInterval: Option[Long] = null
- override val serviceName: String = "hdfs"
+ override val serviceName: String = "hadoopfs"
override def obtainCredentials(
hadoopConf: Configuration,
sparkConf: SparkConf,
creds: Credentials): Option[Long] = {
// NameNode to access, used to get tokens from different FileSystems
+ val tmpCreds = new Credentials()
nnsToAccess(hadoopConf, sparkConf).foreach { dst =>
val dstFs = dst.getFileSystem(hadoopConf)
- logInfo("getting token for namenode: " + dst)
- dstFs.addDelegationTokens(getTokenRenewer(hadoopConf), creds)
+ logInfo("getting token for: " + dst)
+ dstFs.addDelegationTokens(getTokenRenewer(hadoopConf), tmpCreds)
--- End diff --
Done, thanks for your comment.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]