sourabh912 commented on code in PR #3233:
URL: https://github.com/apache/hive/pull/3233#discussion_r862089037


##########
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java:
##########
@@ -605,27 +608,44 @@ private THttpClient createHttpClient(URI store, boolean 
useSSL) throws MetaExcep
     String path = MetaStoreUtils.getHttpPath(MetastoreConf.getVar(conf, 
ConfVars.THRIFT_HTTP_PATH));
     String httpUrl = (useSSL ? "https://"; : "http://";) + store.getHost() + ":" 
+ store.getPort() + path;
 
-    String user = MetastoreConf.getVar(conf, 
ConfVars.METASTORE_CLIENT_PLAIN_USERNAME);
-    if (user == null || user.equals("")) {
-      try {
-        LOG.debug("No username passed in config " + 
ConfVars.METASTORE_CLIENT_PLAIN_USERNAME.getHiveName() +
-            ". Trying to get the current user from UGI" );
-        user = UserGroupInformation.getCurrentUser().getShortUserName();
-      } catch (IOException e) {
-        throw new MetaException("Failed to get client username from UGI");
+    HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
+    String authType = MetastoreConf.getAsString(conf, 
ConfVars.METASTORE_CLIENT_AUTH_MODE).toLowerCase(

Review Comment:
   @dengzhhu653 : Sorry I didn't understand your question. Can you please 
elaborate? 
   
   @hsnusonic : For this config, getAsString and getVar work the same way. But 
its better to use `getVar` here since it enforces that defaultVal of this 
config should be of String type. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to