[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-31 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 31/May/19 21:08
Start Date: 31/May/19 21:08
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874
 
 
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 252059)
Time Spent: 3h 40m  (was: 3.5h)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 31/May/19 04:32
Start Date: 31/May/19 04:32
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#issuecomment-497571655
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 28 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 0 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | +1 | test4tests | 0 | The patch appears to include 1 new or modified test 
files. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 29 | Maven dependency ordering for branch |
   | +1 | mvninstall | 573 | trunk passed |
   | +1 | compile | 302 | trunk passed |
   | +1 | checkstyle | 85 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 974 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 169 | trunk passed |
   | 0 | spotbugs | 347 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | +1 | findbugs | 585 | trunk passed |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 20 | Maven dependency ordering for patch |
   | +1 | mvninstall | 539 | the patch passed |
   | +1 | compile | 279 | the patch passed |
   | +1 | javac | 279 | the patch passed |
   | +1 | checkstyle | 81 | the patch passed |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 730 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 153 | the patch passed |
   | +1 | findbugs | 523 | the patch passed |
   ||| _ Other Tests _ |
   | -1 | unit | 240 | hadoop-hdds in the patch failed. |
   | -1 | unit | 1195 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 49 | The patch does not generate ASF License warnings. |
   | | | 6736 | |
   
   
   | Reason | Tests |
   |---:|:--|
   | Failed junit tests | 
hadoop.hdds.scm.container.placement.algorithms.TestSCMContainerPlacementRackAware
 |
   |   | hadoop.ozone.om.TestOzoneManagerHA |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=17.05.0-ce Server=17.05.0-ce base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/6/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/874 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux 2291ebe574ac 4.4.0-139-generic #165~14.04.1-Ubuntu SMP Wed 
Oct 31 10:55:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 35f1014 |
   | Default Java | 1.8.0_212 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/6/artifact/out/patch-unit-hadoop-hdds.txt
 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/6/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/6/testReport/ |
   | Max. process+thread count | 5160 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/ozone-manager hadoop-ozone/integration-test U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/6/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   
   
   This message was automatically generated.
   
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251490)
Time Spent: 3.5h  (was: 3h 20m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 3.5h
>  

[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 31/May/19 02:23
Start Date: 31/May/19 02:23
Worklog Time Spent: 10m 
  Work Description: ajayydv commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289237945
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/IOzoneAcl.java
 ##
 @@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership.  The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.hadoop.ozone.om;
+
+import org.apache.hadoop.ozone.OzoneAcl;
+import org.apache.hadoop.ozone.security.acl.OzoneObj;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Interface for Ozone Acl management.
+ */
+public interface IOzoneAcl {
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException;
+
+  /**
+   * Remove acl for Ozone object. Return true if acl is removed successfully
+   * else false.
+   * @param obj Ozone object.
+   * @param acl Ozone acl to be removed.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException;
+
+  /**
+   * Acls to be set for given Ozone object. This operations reset ACL for
+   * given object to list of ACLs provided in argument.
+   * @param obj Ozone object.
+   * @param acls List of acls.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean setAcl(OzoneObj obj, List acls) throws IOException;
+
+  /**
+   * Returns list of ACLs for given Ozone object.
+   * @param obj Ozone object.
+   *
+   * @throws IOException if there is error.
+   * */
+  List getAcl(OzoneObj obj) throws IOException;
+
+  /**
+   * Returns list of ACLs for given Ozone object.
+   * @param newAcl new acl to be added.
+   * @param currentAcls list of acls.
+   *
+   * @return true if newAcl addition to existing acls is valid, else false.
+   * */
+  static boolean validateNewAcl(OzoneAcl newAcl, List currentAcls) {
+
+// Check 1: Check for duplicate.
+if(currentAcls.contains(newAcl)) {
 
 Review comment:
   Moved new function to BucketImpl. Remove check is already added. Seperate 
helper function for addAcl validation, as we need to do further validation with 
dacls.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251454)
Time Spent: 3h 20m  (was: 3h 10m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 31/May/19 02:23
Start Date: 31/May/19 02:23
Worklog Time Spent: 10m 
  Work Description: ajayydv commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289237945
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/IOzoneAcl.java
 ##
 @@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership.  The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.hadoop.ozone.om;
+
+import org.apache.hadoop.ozone.OzoneAcl;
+import org.apache.hadoop.ozone.security.acl.OzoneObj;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Interface for Ozone Acl management.
+ */
+public interface IOzoneAcl {
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException;
+
+  /**
+   * Remove acl for Ozone object. Return true if acl is removed successfully
+   * else false.
+   * @param obj Ozone object.
+   * @param acl Ozone acl to be removed.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException;
+
+  /**
+   * Acls to be set for given Ozone object. This operations reset ACL for
+   * given object to list of ACLs provided in argument.
+   * @param obj Ozone object.
+   * @param acls List of acls.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean setAcl(OzoneObj obj, List acls) throws IOException;
+
+  /**
+   * Returns list of ACLs for given Ozone object.
+   * @param obj Ozone object.
+   *
+   * @throws IOException if there is error.
+   * */
+  List getAcl(OzoneObj obj) throws IOException;
+
+  /**
+   * Returns list of ACLs for given Ozone object.
+   * @param newAcl new acl to be added.
+   * @param currentAcls list of acls.
+   *
+   * @return true if newAcl addition to existing acls is valid, else false.
+   * */
+  static boolean validateNewAcl(OzoneAcl newAcl, List currentAcls) {
+
+// Check 1: Check for duplicate.
+if(currentAcls.contains(newAcl)) {
 
 Review comment:
   Moved new function to BucketImpl. Remove check is already added. Seperate 
helper function for addAcl validation as we need to do further validation with 
dacls.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251453)
Time Spent: 3h 10m  (was: 3h)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 31/May/19 01:09
Start Date: 31/May/19 01:09
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#issuecomment-497539183
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 31 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 0 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | +1 | test4tests | 0 | The patch appears to include 1 new or modified test 
files. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 13 | Maven dependency ordering for branch |
   | +1 | mvninstall | 547 | trunk passed |
   | +1 | compile | 293 | trunk passed |
   | +1 | checkstyle | 86 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 887 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 191 | trunk passed |
   | 0 | spotbugs | 311 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | +1 | findbugs | 500 | trunk passed |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 25 | Maven dependency ordering for patch |
   | +1 | mvninstall | 502 | the patch passed |
   | +1 | compile | 295 | the patch passed |
   | +1 | javac | 295 | the patch passed |
   | +1 | checkstyle | 99 | the patch passed |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 146 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 171 | the patch passed |
   | +1 | findbugs | 511 | the patch passed |
   ||| _ Other Tests _ |
   | +1 | unit | 237 | hadoop-hdds in the patch passed. |
   | -1 | unit | 1036 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 45 | The patch does not generate ASF License warnings. |
   | | | 5809 | |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=17.05.0-ce Server=17.05.0-ce base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/5/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/874 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux 8dda786bc398 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 
17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 9122b9b |
   | Default Java | 1.8.0_212 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/5/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/5/testReport/ |
   | Max. process+thread count | 4453 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/ozone-manager hadoop-ozone/integration-test U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/5/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   
   
   This message was automatically generated.
   
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251434)
Time Spent: 3h  (was: 2h 50m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 3h
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 31/May/19 01:05
Start Date: 31/May/19 01:05
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#issuecomment-497538327
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 32 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 1 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | +1 | test4tests | 0 | The patch appears to include 1 new or modified test 
files. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 37 | Maven dependency ordering for branch |
   | +1 | mvninstall | 589 | trunk passed |
   | +1 | compile | 288 | trunk passed |
   | +1 | checkstyle | 89 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 905 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 167 | trunk passed |
   | 0 | spotbugs | 299 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | +1 | findbugs | 491 | trunk passed |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 38 | Maven dependency ordering for patch |
   | +1 | mvninstall | 502 | the patch passed |
   | +1 | compile | 316 | the patch passed |
   | +1 | javac | 316 | the patch passed |
   | +1 | checkstyle | 90 | the patch passed |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 649 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 178 | the patch passed |
   | +1 | findbugs | 571 | the patch passed |
   ||| _ Other Tests _ |
   | -1 | unit | 146 | hadoop-hdds in the patch failed. |
   | -1 | unit | 1154 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 61 | The patch does not generate ASF License warnings. |
   | | | 6499 | |
   
   
   | Reason | Tests |
   |---:|:--|
   | Failed junit tests | 
hadoop.ozone.container.common.statemachine.commandhandler.TestCloseContainerCommandHandler
 |
   |   | hadoop.ozone.client.rpc.TestFailureHandlingByClient |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=17.05.0-ce Server=17.05.0-ce base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/4/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/874 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux 666edfb3af78 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 
17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 9122b9b |
   | Default Java | 1.8.0_212 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/4/artifact/out/patch-unit-hadoop-hdds.txt
 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/4/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/4/testReport/ |
   | Max. process+thread count | 4615 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/ozone-manager hadoop-ozone/integration-test U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/4/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   
   
   This message was automatically generated.
   
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251432)
Time Spent: 2h 50m  (was: 2h 40m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time 

[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 31/May/19 01:00
Start Date: 31/May/19 01:00
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#issuecomment-497537679
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 51 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 0 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | +1 | test4tests | 0 | The patch appears to include 1 new or modified test 
files. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 11 | Maven dependency ordering for branch |
   | +1 | mvninstall | 507 | trunk passed |
   | +1 | compile | 259 | trunk passed |
   | +1 | checkstyle | 75 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 813 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 143 | trunk passed |
   | 0 | spotbugs | 302 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | +1 | findbugs | 494 | trunk passed |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 16 | Maven dependency ordering for patch |
   | +1 | mvninstall | 507 | the patch passed |
   | +1 | compile | 284 | the patch passed |
   | +1 | javac | 284 | the patch passed |
   | +1 | checkstyle | 85 | the patch passed |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 668 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 145 | the patch passed |
   | +1 | findbugs | 519 | the patch passed |
   ||| _ Other Tests _ |
   | -1 | unit | 334 | hadoop-hdds in the patch failed. |
   | -1 | unit | 1313 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 39 | The patch does not generate ASF License warnings. |
   | | | 6418 | |
   
   
   | Reason | Tests |
   |---:|:--|
   | Failed junit tests | 
hadoop.hdds.scm.container.placement.algorithms.TestSCMContainerPlacementRackAware
 |
   |   | hadoop.ozone.client.rpc.TestHybridPipelineOnDatanode |
   |   | hadoop.ozone.client.rpc.TestOzoneAtRestEncryption |
   |   | hadoop.hdds.scm.pipeline.TestPipelineClose |
   |   | hadoop.ozone.client.rpc.TestOzoneRpcClient |
   |   | hadoop.hdds.scm.pipeline.TestSCMPipelineManager |
   |   | hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=17.05.0-ce Server=17.05.0-ce base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/3/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/874 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux 52f230d9b19a 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 
17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 9122b9b |
   | Default Java | 1.8.0_212 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/3/artifact/out/patch-unit-hadoop-hdds.txt
 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/3/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/3/testReport/ |
   | Max. process+thread count | 3231 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/ozone-manager hadoop-ozone/integration-test U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/3/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   
   
   This message was automatically generated.
   
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251430)
Time Spent: 2h 40m  (was: 2.5h)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: 

[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 23:51
Start Date: 30/May/19 23:51
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289214524
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/IOzoneAcl.java
 ##
 @@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership.  The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.hadoop.ozone.om;
+
+import org.apache.hadoop.ozone.OzoneAcl;
+import org.apache.hadoop.ozone.security.acl.OzoneObj;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Interface for Ozone Acl management.
+ */
+public interface IOzoneAcl {
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException;
+
+  /**
+   * Remove acl for Ozone object. Return true if acl is removed successfully
+   * else false.
+   * @param obj Ozone object.
+   * @param acl Ozone acl to be removed.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException;
+
+  /**
+   * Acls to be set for given Ozone object. This operations reset ACL for
+   * given object to list of ACLs provided in argument.
+   * @param obj Ozone object.
+   * @param acls List of acls.
+   *
+   * @throws IOException if there is error.
+   * */
+  boolean setAcl(OzoneObj obj, List acls) throws IOException;
+
+  /**
+   * Returns list of ACLs for given Ozone object.
+   * @param obj Ozone object.
+   *
+   * @throws IOException if there is error.
+   * */
+  List getAcl(OzoneObj obj) throws IOException;
+
+  /**
+   * Returns list of ACLs for given Ozone object.
+   * @param newAcl new acl to be added.
+   * @param currentAcls list of acls.
+   *
+   * @return true if newAcl addition to existing acls is valid, else false.
+   * */
+  static boolean validateNewAcl(OzoneAcl newAcl, List currentAcls) {
+
+// Check 1: Check for duplicate.
+if(currentAcls.contains(newAcl)) {
 
 Review comment:
   Let's remove the default implementation as add/remove have different 
validation semantics.
   
   when you add, we check for duplication
   when you remove, we check for existence. 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251408)
Time Spent: 2.5h  (was: 2h 20m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 23:32
Start Date: 30/May/19 23:32
Worklog Time Spent: 10m 
  Work Description: ajayydv commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289210837
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
+  OmBucketInfo updatedBucket = OmBucketInfo.newBuilder()
+  .setVolumeName(bucketInfo.getVolumeName())
+  .setBucketName(bucketInfo.getBucketName())
+  .setStorageType(bucketInfo.getStorageType())
+  .setIsVersionEnabled(bucketInfo.getIsVersionEnabled())
+  .setCreationTime(bucketInfo.getCreationTime())
+  .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo())
+  .addAllMetadata(bucketInfo.getMetadata())
+  .setAcls(list)
+  .build();
+
+  metadataManager.getBucketTable().put(dbBucketKey, updatedBucket);
+} catch (IOException ex) {
+  if (!(ex instanceof OMException)) {
+LOG.error("Add acl operation failed for bucket:{}/{} acl:{}",
+volume, bucket, acl, ex);
+  }
+  throw ex;
+} finally {
+  metadataManager.getLock().releaseBucketLock(volume, bucket);
+}
+
+return true;
+  }
+
+  /**
+   * Remove acl for Ozone object. Return true if acl is removed successfully
+   * else false.
+   *
+   * @param obj Ozone object.
+   * @param acl Ozone acl to be removed.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.remove(acl);
 
 Review comment:
   added check which return false if it doesn't exist.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251401)
Time Spent: 2h 20m  (was: 2h 10m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: 

[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 23:16
Start Date: 30/May/19 23:16
Worklog Time Spent: 10m 
  Work Description: ajayydv commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289207459
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
+  OmBucketInfo updatedBucket = OmBucketInfo.newBuilder()
+  .setVolumeName(bucketInfo.getVolumeName())
+  .setBucketName(bucketInfo.getBucketName())
+  .setStorageType(bucketInfo.getStorageType())
+  .setIsVersionEnabled(bucketInfo.getIsVersionEnabled())
+  .setCreationTime(bucketInfo.getCreationTime())
+  .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo())
+  .addAllMetadata(bucketInfo.getMetadata())
+  .setAcls(list)
+  .build();
+
+  metadataManager.getBucketTable().put(dbBucketKey, updatedBucket);
 
 Review comment:
   Added a todo to handle this. jira is [HDDS-1619].
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251398)
Time Spent: 2h 10m  (was: 2h)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 23:14
Start Date: 30/May/19 23:14
Worklog Time Spent: 10m 
  Work Description: ajayydv commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289207003
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
 
 Review comment:
   added a static function in new interface to check for existing duplicate 
acls, we can add more rules when we add dacls.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

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

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 23:10
Start Date: 30/May/19 23:10
Worklog Time Spent: 10m 
  Work Description: bharatviswa504 commented on pull request #874: 
HDDS-1540. Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by 
Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289200410
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
+  OmBucketInfo updatedBucket = OmBucketInfo.newBuilder()
+  .setVolumeName(bucketInfo.getVolumeName())
+  .setBucketName(bucketInfo.getBucketName())
+  .setStorageType(bucketInfo.getStorageType())
+  .setIsVersionEnabled(bucketInfo.getIsVersionEnabled())
+  .setCreationTime(bucketInfo.getCreationTime())
+  .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo())
+  .addAllMetadata(bucketInfo.getMetadata())
+  .setAcls(list)
+  .build();
+
+  metadataManager.getBucketTable().put(dbBucketKey, updatedBucket);
 
 Review comment:
   Yes in HA path, we shall not do table put, we will use cache and double 
buffer.
   For reference, have a look into HDDS-1551.
   
   I have opened HDDS-1618 to use the newly added code for HA/Non-HA. As this 
is newly implemented OM request, it can follow the new approach, so that we can 
avoid refactoring again.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

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

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 22:43
Start Date: 30/May/19 22:43
Worklog Time Spent: 10m 
  Work Description: bharatviswa504 commented on pull request #874: 
HDDS-1540. Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by 
Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289200410
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
+  OmBucketInfo updatedBucket = OmBucketInfo.newBuilder()
+  .setVolumeName(bucketInfo.getVolumeName())
+  .setBucketName(bucketInfo.getBucketName())
+  .setStorageType(bucketInfo.getStorageType())
+  .setIsVersionEnabled(bucketInfo.getIsVersionEnabled())
+  .setCreationTime(bucketInfo.getCreationTime())
+  .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo())
+  .addAllMetadata(bucketInfo.getMetadata())
+  .setAcls(list)
+  .build();
+
+  metadataManager.getBucketTable().put(dbBucketKey, updatedBucket);
 
 Review comment:
   Yes in HA path, we shall not do table put, we will use cache and double 
buffer.
   For reference, have a look into HDDS-1551.
   
   I have opened HDDS-1618 to use the same code for HA/Non-HA. As this is newly 
implemented OM request, it can follow that approach, so that we can avoid 
refactoring again.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251373)
Time Spent: 1h 40m  (was: 1.5h)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 19:28
Start Date: 30/May/19 19:28
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#issuecomment-497454916
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 31 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 0 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | +1 | test4tests | 0 | The patch appears to include 1 new or modified test 
files. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 12 | Maven dependency ordering for branch |
   | +1 | mvninstall | 509 | trunk passed |
   | +1 | compile | 262 | trunk passed |
   | +1 | checkstyle | 73 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 842 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 147 | trunk passed |
   | 0 | spotbugs | 304 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | +1 | findbugs | 498 | trunk passed |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 19 | Maven dependency ordering for patch |
   | +1 | mvninstall | 502 | the patch passed |
   | +1 | compile | 265 | the patch passed |
   | +1 | javac | 265 | the patch passed |
   | +1 | checkstyle | 72 | the patch passed |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 639 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 141 | the patch passed |
   | +1 | findbugs | 527 | the patch passed |
   ||| _ Other Tests _ |
   | +1 | unit | 237 | hadoop-hdds in the patch passed. |
   | -1 | unit | 1060 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 43 | The patch does not generate ASF License warnings. |
   | | | 6041 | |
   
   
   | Reason | Tests |
   |---:|:--|
   | Failed junit tests | hadoop.ozone.om.TestScmSafeMode |
   |   | hadoop.ozone.client.rpc.TestOzoneClientRetriesOnException |
   |   | hadoop.ozone.client.rpc.TestSecureOzoneRpcClient |
   |   | hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=17.05.0-ce Server=17.05.0-ce base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/2/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/874 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux 3f1788c89eea 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 
17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 30c6dd9 |
   | Default Java | 1.8.0_212 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/2/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/2/testReport/ |
   | Max. process+thread count | 4469 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/ozone-manager hadoop-ozone/integration-test U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/2/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   
   
   This message was automatically generated.
   
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251254)
Time Spent: 1.5h  (was: 1h 20m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Implement 

[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 18:32
Start Date: 30/May/19 18:32
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289115910
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
+  OmBucketInfo updatedBucket = OmBucketInfo.newBuilder()
+  .setVolumeName(bucketInfo.getVolumeName())
+  .setBucketName(bucketInfo.getBucketName())
+  .setStorageType(bucketInfo.getStorageType())
+  .setIsVersionEnabled(bucketInfo.getIsVersionEnabled())
+  .setCreationTime(bucketInfo.getCreationTime())
+  .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo())
+  .addAllMetadata(bucketInfo.getMetadata())
+  .setAcls(list)
+  .build();
+
+  metadataManager.getBucketTable().put(dbBucketKey, updatedBucket);
+} catch (IOException ex) {
+  if (!(ex instanceof OMException)) {
+LOG.error("Add acl operation failed for bucket:{}/{} acl:{}",
+volume, bucket, acl, ex);
+  }
+  throw ex;
+} finally {
+  metadataManager.getLock().releaseBucketLock(volume, bucket);
+}
+
+return true;
+  }
+
+  /**
+   * Remove acl for Ozone object. Return true if acl is removed successfully
+   * else false.
+   *
+   * @param obj Ozone object.
+   * @param acl Ozone acl to be removed.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.remove(acl);
 
 Review comment:
   what if the acl is not found? we should skip metadata update in this case 
and return false?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251228)
Time Spent: 1h 20m  (was: 1h 10m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: 

[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 18:31
Start Date: 30/May/19 18:31
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289115910
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
+  OmBucketInfo updatedBucket = OmBucketInfo.newBuilder()
+  .setVolumeName(bucketInfo.getVolumeName())
+  .setBucketName(bucketInfo.getBucketName())
+  .setStorageType(bucketInfo.getStorageType())
+  .setIsVersionEnabled(bucketInfo.getIsVersionEnabled())
+  .setCreationTime(bucketInfo.getCreationTime())
+  .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo())
+  .addAllMetadata(bucketInfo.getMetadata())
+  .setAcls(list)
+  .build();
+
+  metadataManager.getBucketTable().put(dbBucketKey, updatedBucket);
+} catch (IOException ex) {
+  if (!(ex instanceof OMException)) {
+LOG.error("Add acl operation failed for bucket:{}/{} acl:{}",
+volume, bucket, acl, ex);
+  }
+  throw ex;
+} finally {
+  metadataManager.getLock().releaseBucketLock(volume, bucket);
+}
+
+return true;
+  }
+
+  /**
+   * Remove acl for Ozone object. Return true if acl is removed successfully
+   * else false.
+   *
+   * @param obj Ozone object.
+   * @param acl Ozone acl to be removed.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean removeAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.remove(acl);
 
 Review comment:
   what if the acl is not found? we may skip metadata update in this case and 
return false?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251227)
Time Spent: 1h 10m  (was: 1h)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
>  

[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 18:30
Start Date: 30/May/19 18:30
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289115495
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
+  OmBucketInfo updatedBucket = OmBucketInfo.newBuilder()
+  .setVolumeName(bucketInfo.getVolumeName())
+  .setBucketName(bucketInfo.getBucketName())
+  .setStorageType(bucketInfo.getStorageType())
+  .setIsVersionEnabled(bucketInfo.getIsVersionEnabled())
+  .setCreationTime(bucketInfo.getCreationTime())
+  .setBucketEncryptionKey(bucketInfo.getEncryptionKeyInfo())
+  .addAllMetadata(bucketInfo.getMetadata())
+  .setAcls(list)
+  .build();
+
+  metadataManager.getBucketTable().put(dbBucketKey, updatedBucket);
 
 Review comment:
   Local DB put may not work with OM HA. cc: @bharatviswa504 for additional 
comments on the proper way to commit OM metadata changes via Ratis.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

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

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 18:25
Start Date: 30/May/19 18:25
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289113393
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
 ##
 @@ -423,4 +428,205 @@ private void commitDeleteBucketInfoToOMDB(String 
dbBucketKey)
 volumeName, startBucket, bucketPrefix, maxNumOfBuckets);
 
   }
+
+  /**
+   * Add acl for Ozone object. Return true if acl is added successfully else
+   * false.
+   *
+   * @param obj Ozone object for which acl should be added.
+   * @param acl ozone acl top be added.
+   * @throws IOException if there is error.
+   */
+  @Override
+  public boolean addAcl(OzoneObj obj, OzoneAcl acl) throws IOException {
+Objects.requireNonNull(obj);
+Objects.requireNonNull(acl);
+if (!obj.getResourceType().equals(OzoneObj.ResourceType.BUCKET)) {
+  throw new IllegalArgumentException("Unexpected argument passed to " +
+  "BucketManager. OzoneObj type:" + obj.getResourceType());
+}
+String volume = obj.getVolumeName();
+String bucket = obj.getBucketName();
+metadataManager.getLock().acquireBucketLock(volume, bucket);
+try {
+  String dbBucketKey = metadataManager.getBucketKey(volume, bucket);
+  OmBucketInfo bucketInfo =
+  metadataManager.getBucketTable().get(dbBucketKey);
+  if (bucketInfo == null) {
+LOG.debug("Bucket:{}/{} does not exist", volume, bucket);
+throw new OMException("Bucket " + bucket + " is not found",
+BUCKET_NOT_FOUND);
+  }
+  List list = bucketInfo.getAcls();
+  list.add(acl);
 
 Review comment:
   Do we need some sanity check to avoid newly added acls conflict with 
existing ones?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251220)
Time Spent: 50m  (was: 40m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 18:21
Start Date: 30/May/19 18:21
Worklog Time Spent: 10m 
  Work Description: xiaoyuyao commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#discussion_r289111643
 
 

 ##
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManager.java
 ##
 @@ -101,4 +103,43 @@ void applyDeleteBucket(String volumeName, String 
bucketName)
   List listBuckets(String volumeName,
   String startBucket, String bucketPrefix, int maxNumOfBuckets)
   throws IOException;
+
 
 Review comment:
   Can we abstract these 4 acl operations into a separate ACL interface so that 
we can reuse it for volume/bucket/key/prefix? 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251216)
Time Spent: 40m  (was: 0.5h)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 16:52
Start Date: 30/May/19 16:52
Worklog Time Spent: 10m 
  Work Description: ajayydv commented on issue #874: HDDS-1540. Implement 
addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#issuecomment-497400846
 
 
   Test failures are unrelated.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 251104)
Time Spent: 0.5h  (was: 20m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 11:11
Start Date: 30/May/19 11:11
Worklog Time Spent: 10m 
  Work Description: hadoop-yetus commented on issue #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874#issuecomment-497294931
 
 
   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | 0 | reexec | 31 | Docker mode activated. |
   ||| _ Prechecks _ |
   | +1 | dupname | 0 | No case conflicting files found. |
   | +1 | @author | 0 | The patch does not contain any @author tags. |
   | +1 | test4tests | 0 | The patch appears to include 1 new or modified test 
files. |
   ||| _ trunk Compile Tests _ |
   | 0 | mvndep | 41 | Maven dependency ordering for branch |
   | +1 | mvninstall | 550 | trunk passed |
   | +1 | compile | 279 | trunk passed |
   | +1 | checkstyle | 74 | trunk passed |
   | +1 | mvnsite | 0 | trunk passed |
   | +1 | shadedclient | 844 | branch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 143 | trunk passed |
   | 0 | spotbugs | 288 | Used deprecated FindBugs config; considering 
switching to SpotBugs. |
   | +1 | findbugs | 472 | trunk passed |
   ||| _ Patch Compile Tests _ |
   | 0 | mvndep | 15 | Maven dependency ordering for patch |
   | +1 | mvninstall | 490 | the patch passed |
   | +1 | compile | 251 | the patch passed |
   | +1 | javac | 251 | the patch passed |
   | -0 | checkstyle | 37 | hadoop-ozone: The patch generated 1 new + 0 
unchanged - 0 fixed = 1 total (was 0) |
   | +1 | mvnsite | 0 | the patch passed |
   | +1 | whitespace | 0 | The patch has no whitespace issues. |
   | +1 | shadedclient | 619 | patch has no errors when building and testing 
our client artifacts. |
   | +1 | javadoc | 142 | the patch passed |
   | +1 | findbugs | 500 | the patch passed |
   ||| _ Other Tests _ |
   | -1 | unit | 151 | hadoop-hdds in the patch failed. |
   | -1 | unit | 1105 | hadoop-ozone in the patch failed. |
   | +1 | asflicense | 61 | The patch does not generate ASF License warnings. |
   | | | 5993 | |
   
   
   | Reason | Tests |
   |---:|:--|
   | Failed junit tests | hadoop.ozone.container.ozoneimpl.TestOzoneContainer |
   |   | hadoop.ozone.client.rpc.TestFailureHandlingByClient |
   |   | hadoop.ozone.client.rpc.TestOzoneClientRetriesOnException |
   |   | hadoop.ozone.client.rpc.TestWatchForCommit |
   
   
   | Subsystem | Report/Notes |
   |--:|:-|
   | Docker | Client=17.05.0-ce Server=17.05.0-ce base: 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/1/artifact/out/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/hadoop/pull/874 |
   | Optional Tests | dupname asflicense compile javac javadoc mvninstall 
mvnsite unit shadedclient findbugs checkstyle |
   | uname | Linux f26ce480d1f2 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 
17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | personality/hadoop.sh |
   | git revision | trunk / 2b303e9 |
   | Default Java | 1.8.0_212 |
   | checkstyle | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/1/artifact/out/diff-checkstyle-hadoop-ozone.txt
 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/1/artifact/out/patch-unit-hadoop-hdds.txt
 |
   | unit | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/1/artifact/out/patch-unit-hadoop-ozone.txt
 |
   |  Test Results | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/1/testReport/ |
   | Max. process+thread count | 4958 (vs. ulimit of 5500) |
   | modules | C: hadoop-ozone/ozone-manager hadoop-ozone/integration-test U: 
hadoop-ozone |
   | Console output | 
https://builds.apache.org/job/hadoop-multibranch/job/PR-874/1/console |
   | versions | git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1 |
   | Powered by | Apache Yetus 0.10.0 http://yetus.apache.org |
   
   
   This message was automatically generated.
   
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 250896)
Time Spent: 20m  (was: 10m)

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: 

[jira] [Work logged] (HDDS-1540) Implement addAcl,removeAcl,setAcl,getAcl for Bucket

2019-05-30 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HDDS-1540:


Author: ASF GitHub Bot
Created on: 30/May/19 07:21
Start Date: 30/May/19 07:21
Worklog Time Spent: 10m 
  Work Description: ajayydv commented on pull request #874: HDDS-1540. 
Implement addAcl,removeAcl,setAcl,getAcl for Bucket. Contributed by Ajay Kumar.
URL: https://github.com/apache/hadoop/pull/874
 
 
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 250772)
Time Spent: 10m
Remaining Estimate: 0h

> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket
> 
>
> Key: HDDS-1540
> URL: https://issues.apache.org/jira/browse/HDDS-1540
> Project: Hadoop Distributed Data Store
>  Issue Type: Sub-task
>Reporter: Ajay Kumar
>Assignee: Ajay Kumar
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> Implement addAcl,removeAcl,setAcl,getAcl  for Bucket



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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