sarvekshayr commented on code in PR #9719: URL: https://github.com/apache/ozone/pull/9719#discussion_r2791456081
########## hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/container/AckMissingSubcommand.java: ########## @@ -0,0 +1,97 @@ +/* + * 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.hdds.scm.cli.container; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Set; +import java.util.stream.Collectors; +import org.apache.hadoop.hdds.cli.HddsVersionProvider; +import org.apache.hadoop.hdds.scm.cli.ScmSubcommand; +import org.apache.hadoop.hdds.scm.client.ScmClient; +import org.apache.hadoop.hdds.scm.container.ContainerInfo; +import org.apache.hadoop.hdds.scm.container.ContainerListResult; +import picocli.CommandLine; + +/** + * Acknowledge missing container(s) to suppress them from Replication Manager Report. + */ [email protected]( + name = "ack", + description = "Acknowledge missing container(s) to suppress them from reports", + mixinStandardHelpOptions = true, + versionProvider = HddsVersionProvider.class) +public class AckMissingSubcommand extends ScmSubcommand { + + @CommandLine.Parameters(description = "Container IDs to acknowledge (comma-separated)", + arity = "0..1") + private String containers; + + @CommandLine.Option(names = {"--list"}, + description = "List all acknowledged missing containers") + private boolean list; + + @Override + public void execute(ScmClient scmClient) throws IOException { + if (list) { + // List acknowledged containers + ContainerListResult result = scmClient.listContainer(1, Integer.MAX_VALUE); Review Comment: Do we plan to display the list of acknowledged missing containers in the Recon UI? If yes, I can add the required server-side filter. If not, since this isn’t a frequently used command, we can retain the current implementation. cc: @errose28 @devmadhuu -- 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]
