Repository: hbase Updated Branches: refs/heads/master 1ad09d2f6 -> 334238385
HBASE-20375 Remove use of getCurrentUserCredentials in hbase-spark module Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/33423838 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/33423838 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/33423838 Branch: refs/heads/master Commit: 33423838506ce1e8bb7121a9a581a9b927b70567 Parents: 1ad09d2 Author: tedyu <yuzhih...@gmail.com> Authored: Wed Apr 11 11:59:10 2018 -0700 Committer: tedyu <yuzhih...@gmail.com> Committed: Wed Apr 11 11:59:10 2018 -0700 ---------------------------------------------------------------------- .../scala/org/apache/hadoop/hbase/spark/HBaseContext.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/33423838/hbase-spark/src/main/scala/org/apache/hadoop/hbase/spark/HBaseContext.scala ---------------------------------------------------------------------- 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 d376bf2..656b8c2 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