ajayydv commented on a change in pull request #847: HDDS-1539. Implement
addAcl,removeAcl,setAcl,getAcl for Volume. Contributed Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/847#discussion_r288754975
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/protocolPB/OMPBHelper.java
##########
@@ -84,15 +84,14 @@ public static OzoneAclInfo convertOzoneAcl(OzoneAcl acl) {
default:
throw new IllegalArgumentException("ACL type is not recognized");
}
- List<OzoneAclRights> aclRights = new ArrayList<>();
-
- for (ACLType right : acl.getRights()) {
- aclRights.add(OzoneAclRights.valueOf(right.name()));
- }
+ List<OzoneAclRights> ozAclRights =
+ new ArrayList<>(acl.getAclBitSet().cardinality());
+ acl.getAclBitSet().stream().forEach(a -> ozAclRights.add(
+ OzoneAclRights.valueOf(ACLType.values()[a].name())));
Review comment:
@anuengineer thanks for review. I remember that discussion, i think reason
was too many type castings involved in in streams. I dont see any consistent
approach to tackle it. (We are using streams all over the place) Updated other
stream usage to foreach loop. In this particular case foreach doesn't support
Bitset so left it as it is. Hopefully performance of streams and parallel
streams will improve in java.
----------------------------------------------------------------
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]