xiaoyuyao 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_r287901207
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/OzoneAcl.java
##########
@@ -75,9 +77,20 @@ public OzoneAcl(ACLIdentityType type, String name, ACLType
acl) {
* @param name - Name of user
* @param acls - Rights
*/
- public OzoneAcl(ACLIdentityType type, String name, List<ACLType> acls) {
+ public OzoneAcl(ACLIdentityType type, String name, BitSet acls) {
+ Objects.requireNonNull(type);
+ Objects.requireNonNull(acls);
+
+ if(acls.cardinality() > ACLType.getNoOfAcls()) {
+ throw new IllegalArgumentException("Acl bitset passed has unexpected " +
+ "size. bitset size:" + acls.cardinality() + ", bitset:"
+ + acls.toString());
+ }
+
+ this.aclBitSet = new BitSet();
Review comment:
this can be simplified as this.aclBitSet= acls.clone();
----------------------------------------------------------------
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]