goiri commented on a change in pull request #1478: HDFS-14856 Fetch file ACLs
while mounting external store
URL: https://github.com/apache/hadoop/pull/1478#discussion_r326313103
##########
File path:
hadoop-tools/hadoop-fs2img/src/main/java/org/apache/hadoop/hdfs/server/namenode/UGIResolver.java
##########
@@ -132,4 +138,134 @@ public FsPermission permission(FileStatus s) {
return s.getPermission();
}
+ private long resolve(AclStatus aclStatus) {
+ return buildPermissionStatus(
+ user(aclStatus), group(aclStatus), permission(aclStatus).toShort());
+ }
+
+ /**
+ * Get the locally mapped user for external {@link AclStatus}.
+ *
+ * @param aclStatus AclStatus on external store.
+ * @return locally mapped user name.
+ */
+ public String user(AclStatus aclStatus) {
+ return aclStatus.getOwner();
+ }
+
+ /**
+ * Get the locally mapped group for the external {@link AclStatus}.
+ *
+ * @param aclStatus AclStatus on the external store.
+ * @return locally mapped group name.
+ */
+ public String group(AclStatus aclStatus) {
+ return aclStatus.getGroup();
+ }
+
+ /**
+ * Get the locally mapped {@link FsPermission} for the external
+ * {@link AclStatus}.
+ *
+ * @param aclStatus AclStatus on the external store.
+ * @return local {@link FsPermission} the external AclStatus maps to.
+ */
+ public FsPermission permission(AclStatus aclStatus) {
+ return aclStatus.getPermission();
+ }
+
+ /**
+ * Returns list of Acl entries to apply to local paths based on remote acls.
+ *
+ * @param aclStatus remote ACL status.
+ * @return local HDFS ACL entries.
+ */
+ public List<AclEntry> aclEntries(AclStatus aclStatus) {
Review comment:
static getACLEntries()
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]