virajith commented on code in PR #3987:
URL: https://github.com/apache/hadoop/pull/3987#discussion_r851024809


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java:
##########
@@ -1466,5 +1476,27 @@ public void setStoragePolicy(Path path, String 
policyName)
         throws IOException {
       throw readOnlyMountTable("setStoragePolicy", path);
     }
+
+    private FsPermission getMountLinkDefaultPermissions() {
+      return PERMISSION_555;
+    }
+
+    private String getMountLinkUserName() {
+      if (mountLinkUserName != null) {
+        return mountLinkUserName;
+      }
+      String username = ugi.getShortUserName();
+      mountLinkUserName = username;
+      return username;
+    }
+
+    private String getMountLinkGroupName() throws IOException {
+      if (mountLinkGroupName != null) {
+        return mountLinkGroupName;
+      }
+      String groupname = ugi.getPrimaryGroupName();
+      mountLinkGroupName = groupname;

Review Comment:
   alternatively, just set mountLinkGroupName to ugi.getPrimaryGroupName() in 
the constructor if the config is not set?



##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java:
##########
@@ -1466,5 +1476,27 @@ public void setStoragePolicy(Path path, String 
policyName)
         throws IOException {
       throw readOnlyMountTable("setStoragePolicy", path);
     }
+
+    private FsPermission getMountLinkDefaultPermissions() {
+      return PERMISSION_555;
+    }
+
+    private String getMountLinkUserName() {
+      if (mountLinkUserName != null) {
+        return mountLinkUserName;
+      }
+      String username = ugi.getShortUserName();
+      mountLinkUserName = username;
+      return username;
+    }
+
+    private String getMountLinkGroupName() throws IOException {
+      if (mountLinkGroupName != null) {
+        return mountLinkGroupName;
+      }
+      String groupname = ugi.getPrimaryGroupName();
+      mountLinkGroupName = groupname;

Review Comment:
   Instead of setting this, a cleaner way is to declare mountLinkGroupName as a 
final variable and return ugi.getPrimaryGroupName() here. Same goes for the 
implementation of getMountLinkUserName()



-- 
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: common-issues-unsubscr...@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to