[ 
https://issues.apache.org/jira/browse/HDDS-1884?focusedWorklogId=286941&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-286941
 ]

ASF GitHub Bot logged work on HDDS-1884:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Aug/19 18:51
            Start Date: 01/Aug/19 18:51
    Worklog Time Spent: 10m 
      Work Description: xiaoyuyao commented on pull request #1202: HDDS-1884. 
Support Bucket addACL operations for OM HA.
URL: https://github.com/apache/hadoop/pull/1202#discussion_r309844892
 
 

 ##########
 File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
 ##########
 @@ -759,6 +766,43 @@ public void testReadRequest() throws Exception {
     }
   }
 
+  @Test
+  public void testAddBucketAcl() throws Exception {
+    OzoneBucket ozoneBucket = setupBucket();
+    String remoteUserName = "remoteUser";
+    OzoneAcl defaultUserAcl = new OzoneAcl(USER, remoteUserName,
+        READ, DEFAULT);
+
+    OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
+        .setResType(OzoneObj.ResourceType.BUCKET)
+        .setStoreType(OzoneObj.StoreType.OZONE)
+        .setVolumeName(ozoneBucket.getVolumeName())
+        .setBucketName(ozoneBucket.getName()).build();
+
+    boolean addAcl = objectStore.addAcl(ozoneObj, defaultUserAcl);
+    Assert.assertTrue(addAcl);
+
+    ozoneBucket.addAcls(Collections.singletonList(defaultUserAcl));
+    List<OzoneAcl> acls = ozoneBucket.getAcls();
+
+    Assert.assertTrue(containsAcl(defaultUserAcl, acls));
+
+    addAcl = objectStore.addAcl(ozoneObj, defaultUserAcl);
+    Assert.assertFalse(addAcl);
+  }
+
+  private boolean containsAcl(OzoneAcl ozoneAcl, List<OzoneAcl> ozoneAcls) {
+    for (OzoneAcl acl : ozoneAcls) {
+      if (acl.getType().equals(ozoneAcl.getType())
+          && acl.getName().equals(ozoneAcl.getName())
+          && acl.getAclBitSet().equals(ozoneAcl.getAclBitSet())
 
 Review comment:
   containersAcl() may not work for the case when the added is OR-ed into 
existing BitSet where .equals will not be the same?
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 286941)
    Time Spent: 1h  (was: 50m)

> Support Bucket addACL operations for OM HA.
> -------------------------------------------
>
>                 Key: HDDS-1884
>                 URL: https://issues.apache.org/jira/browse/HDDS-1884
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> -HDDS-15+40+- adds 4 new api for Ozone rpc client. OM HA implementation needs 
> to handle them.
> This Jira is to handle addAcl for bucket.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to