xBis7 commented on code in PR #5816:
URL: https://github.com/apache/ozone/pull/5816#discussion_r1431320566


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneClientAdapterImpl.java:
##########
@@ -790,15 +790,14 @@ private List<FileStatusAdapter> listStatusVolume(String 
volumeStr,
     OFSPath ofsStartPath = new OFSPath(startPath, config);
     // list buckets in the volume
     OzoneVolume volume = objectStore.getVolume(volumeStr);
-    UserGroupInformation ugi =
-        UserGroupInformation.createRemoteUser(volume.getOwner());
-    String owner = ugi.getShortUserName();
-    String group = getGroupName(ugi);
     Iterator<? extends OzoneBucket> iter =
         volume.listBuckets(null, ofsStartPath.getBucketName());
     List<FileStatusAdapter> res = new ArrayList<>();
     while (iter.hasNext() && res.size() < numEntries) {
       OzoneBucket bucket = iter.next();
+      UserGroupInformation ugi = 
UserGroupInformation.createRemoteUser(bucket.getOwner());
+      String owner = ugi.getShortUserName();
+      String group = getGroupName(ugi);
       res.add(getFileStatusAdapterForBucket(bucket, uri, owner, group));

Review Comment:
   @aswinshakil Nice suggestion. I made the change. Thanks!



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