Skip to content

Commit

Permalink
HBASE-20375 Remove use of getCurrentUserCredentials in hbase-spark mo…
Browse files Browse the repository at this point in the history
…dule
  • Loading branch information
tedyu committed Apr 11, 2018
1 parent 1ad09d2 commit 3342383
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3342383

Please sign in to comment.