adoroszlai commented on a change in pull request #3179:
URL: https://github.com/apache/ozone/pull/3179#discussion_r826242892
##########
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:
Ideally we could centralize these replication-related options in a
single object that could be used as a `@Mixin`.
Example (for other options):
https://github.com/apache/ozone/blob/f826d124aa1d8063d37a1ef3c1809787401b7b0b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/ListOptions.java#L22-L40
Some of its usages:
https://github.com/apache/ozone/blob/f826d124aa1d8063d37a1ef3c1809787401b7b0b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/volume/ListVolumeHandler.java#L51-L52
https://github.com/apache/ozone/blob/f826d124aa1d8063d37a1ef3c1809787401b7b0b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/bucket/ListBucketHandler.java#L42-L43
Then handling any special case, backwards compatibility or validation would
need to be addressed in only one place.
I can work on this if you agree.
--
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]