You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/03/24 12:28:49 UTC

[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #701: HDDS-2691. Ozone Shell code cleanup

adoroszlai commented on a change in pull request #701: HDDS-2691. Ozone Shell code cleanup
URL: https://github.com/apache/hadoop-ozone/pull/701#discussion_r397114558
 
 

 ##########
 File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/web/ozShell/acl/AclHandler.java
 ##########
 @@ -0,0 +1,62 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.web.ozShell.acl;
+
+import org.apache.hadoop.ozone.client.OzoneClient;
+import org.apache.hadoop.ozone.security.acl.OzoneObj;
+import org.apache.hadoop.ozone.web.ozShell.Handler;
+import org.apache.hadoop.ozone.web.ozShell.OzoneAddress;
+
+import org.apache.hadoop.ozone.web.ozShell.StoreTypeOption;
+import picocli.CommandLine;
+
+import java.io.IOException;
+
+/**
+ * Base class for ACL-related commands.
+ */
+public abstract class AclHandler extends Handler {
 
 Review comment:
   They differ in the type of `address`, which can be `VolumeUri`, `BucketUri`, or `KeyUri`.
   
   `AclHandler` subclasses mix two aspects: operation (get/set/etc.) and target (volume/bucket/key).  I kept the hierarchy shallow and extracted logic into `*Uri` and `AclOption`, so that duplicated implementations are reduced to one-liners.
   
   We could introduce additional intermediate level classes into the hierarchy either by operation or target, but unfortunately the other aspect would still be duplicated.  I didn't find it worth introducing a new class to extract a one-liner method out of 4 classes.  (`extends ...` would still be duplicated ;) )

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org