You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/05/10 04:17:38 UTC

[GitHub] [ozone] bshashikant commented on a change in pull request #2213: HDDS-5183. For AccessControlException do not perform failover.

bshashikant commented on a change in pull request #2213:
URL: https://github.com/apache/ozone/pull/2213#discussion_r629038653



##########
File path: hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/proxy/SCMContainerLocationFailoverProxyProvider.java
##########
@@ -77,15 +77,26 @@
 
   private final UserGroupInformation ugi;
 
-
-  public SCMContainerLocationFailoverProxyProvider(ConfigurationSource conf) {
+  /**
+   * Construct SCMContainerLocationFailoverProxyProvider.
+   * If userGroupInformation is not null, use the passed ugi, else obtain
+   * from {@link UserGroupInformation#getCurrentUser()}
+   * @param conf
+   * @param userGroupInformation
+   */
+  public SCMContainerLocationFailoverProxyProvider(ConfigurationSource conf,
+      UserGroupInformation userGroupInformation) {
     this.conf = conf;
 
-    try {
-      this.ugi = UserGroupInformation.getCurrentUser();
-    } catch (IOException ex) {
-      LOG.error("Unable to fetch user credentials from UGI", ex);
-      throw new RuntimeException(ex);
+    if (userGroupInformation == null) {

Review comment:
       Do we need similar change in SCMBlockLocationfailoverProxyProvider as well? 




-- 
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org