adoroszlai commented on a change in pull request #3179:
URL: https://github.com/apache/ozone/pull/3179#discussion_r824702008



##########
File path: 
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/scm/protocolPB/StorageContainerLocationProtocolClientSideTranslatorPB.java
##########
@@ -400,6 +418,15 @@ public ContainerWithPipeline getContainerWithPipeline(long 
containerID)
     return containerList;
   }
 
+  @Deprecated
+  @Override
+  public List<ContainerInfo> listContainer(long startContainerID, int count,
+      HddsProtos.LifeCycleState state, HddsProtos.ReplicationFactor factor)
+      throws IOException {
+    throw new NotImplementedException("Should no longer be called from the " +

Review comment:
       Nit: Please consider changing to `UnsupportedOperationException` as
   > 
[`NotImplementedException`](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/NotImplementedException.html)
 represents the case where the author has yet to implement the logic at this 
point in the program

##########
File path: 
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ListSubcommand.java
##########
@@ -65,9 +69,14 @@
           "DELETING, DELETED)")
   private HddsProtos.LifeCycleState state;
 
-  @Option(names = {"--factor"},
-      description = "Container factor(ONE, THREE)")
-  private HddsProtos.ReplicationFactor factor;
+  @Option(names = {"-t", "--type"},
+      description = "Replication Type (RATIS, STANDALONE or EC)")

Review comment:
       Since `ReplicationType.valueOf` is used below, this should refer to 
`STAND_ALONE`.  Better yet, can it be omitted?
   
   ```
   $ ozone admin container list -t STANDALONE
   Invalid value for option '--type': expected one of [RATIS, STAND_ALONE, 
CHAINED, EC, NONE] (case-sensitive) but was 'STANDALONE'
   ```

##########
File path: 
hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/container/ListSubcommand.java
##########
@@ -90,8 +99,17 @@ private void outputContainerInfo(ContainerInfo containerInfo)
 
   @Override
   public void execute(ScmClient scmClient) throws IOException {
+    if (!Strings.isNullOrEmpty(replication) && type == null) {
+      throw new IOException("Type must be set if replication is passed");
+    }

Review comment:
       If `replication` is `ONE` or `THREE`, can we guess `type = RATIS` 
instead of bailing out?  I think this would keep previously valid commands 
working.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to