aboutsummaryrefslogtreecommitdiff
path: root/yarn
diff options
context:
space:
mode:
Diffstat (limited to 'yarn')
-rw-r--r--yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala11
1 files changed, 6 insertions, 5 deletions
diff --git a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
index 4ac3397f1a..fc11bbf97e 100644
--- a/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
+++ b/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
@@ -1295,11 +1295,12 @@ object Client extends Logging {
logDebug("Attempting to fetch HBase security token.")
- val hbaseConf = confCreate.invoke(null, conf)
- val token = obtainToken.invoke(null, hbaseConf).asInstanceOf[Token[TokenIdentifier]]
- credentials.addToken(token.getService, token)
-
- logInfo("Added HBase security token to credentials.")
+ val hbaseConf = confCreate.invoke(null, conf).asInstanceOf[Configuration]
+ if ("kerberos" == hbaseConf.get("hbase.security.authentication")) {
+ val token = obtainToken.invoke(null, hbaseConf).asInstanceOf[Token[TokenIdentifier]]
+ credentials.addToken(token.getService, token)
+ logInfo("Added HBase security token to credentials.")
+ }
} catch {
case e: java.lang.NoSuchMethodException =>
logInfo("HBase Method not found: " + e)