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



##########
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:
       I have added this for testing purposes. We can add this, when needed.




-- 
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:
[email protected]



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

Reply via email to