From 33423838506ce1e8bb7121a9a581a9b927b70567 Mon Sep 17 00:00:00 2001 From: tedyu Date: Wed, 11 Apr 2018 11:59:10 -0700 Subject: [PATCH] HBASE-20375 Remove use of getCurrentUserCredentials in hbase-spark module --- .../org/apache/hadoop/hbase/spark/HBaseContext.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala b/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala index d376bf2408b..656b8c2be01 100644 --- a/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala +++ b/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala @@ -65,7 +65,7 @@ class HBaseContext(@transient val sc: SparkContext, val tmpHdfsConfgFile: String = null) extends Serializable with Logging { - @transient var credentials = SparkHadoopUtil.get.getCurrentUserCredentials() + @transient var credentials = UserGroupInformation.getCurrentUser().getCredentials() @transient var tmpHdfsConfiguration:Configuration = config @transient var appliedCredentials = false @transient val job = Job.getInstance(config) @@ -233,9 +233,11 @@ class HBaseContext(@transient val sc: SparkContext, } def applyCreds[T] (){ - credentials = SparkHadoopUtil.get.getCurrentUserCredentials() + credentials = UserGroupInformation.getCurrentUser().getCredentials() - logDebug("appliedCredentials:" + appliedCredentials + ",credentials:" + credentials) + if (log.isDebugEnabled) { + logDebug("appliedCredentials:" + appliedCredentials + ",credentials:" + credentials) + } if (!appliedCredentials && credentials != null) { appliedCredentials = true