You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/05/09 17:07:45 UTC

[GitHub] [hive] ramesh0201 commented on a diff in pull request #3264: HVIE-26199 Reduce FileSystem init during user impersonation

ramesh0201 commented on code in PR #3264:
URL: https://github.com/apache/hive/pull/3264#discussion_r868231109


##########
common/src/java/org/apache/hadoop/hive/common/FileUtils.java:
##########
@@ -449,25 +462,18 @@ public static void checkFileAccessWithImpersonation(final FileSystem fs,
     }
 
     // Otherwise, try user impersonation. Current user must be configured to do user impersonation.
-    UserGroupInformation proxyUser = UserGroupInformation.createProxyUser(
-        user, UserGroupInformation.getLoginUser());
-    try {
-      proxyUser.doAs(new PrivilegedExceptionAction<Object>() {
-        @Override
-        public Object run() throws Exception {
-          FileSystem fsAsUser = FileSystem.get(fs.getUri(), fs.getConf());
-          ShimLoader.getHadoopShims().checkFileAccess(fsAsUser, stat, action);
-          addChildren(fsAsUser, stat.getPath(), children);
-          return null;
-        }
-      });
-    } finally {
-      FileSystem.closeAllForUGI(proxyUser);

Review Comment:
   I am removing this because we moved the FIleSystem.get() call outside the recursive call, and hence i thought we can just close once for every FileSystem.get() call



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org