adoroszlai commented on code in PR #5488: URL: https://github.com/apache/ozone/pull/5488#discussion_r1415444387
########## hadoop-hdds/tools/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DecommissionStatusSubCommand.java: ########## @@ -0,0 +1,93 @@ +/** + * 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.hdds.scm.cli.datanode; + +import com.google.common.base.Strings; +import org.apache.hadoop.hdds.cli.HddsVersionProvider; +import org.apache.hadoop.hdds.protocol.DatanodeDetails; +import org.apache.hadoop.hdds.protocol.proto.HddsProtos; +import org.apache.hadoop.hdds.scm.cli.ScmSubcommand; +import org.apache.hadoop.hdds.scm.client.ScmClient; +import picocli.CommandLine; + +import java.io.IOException; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState.DECOMMISSIONING; + +/** + * Handler to print decommissioning nodes status. + */ [email protected]( + name = "decommission-status", Review Comment: On another look, I have concerns about adding a command that is a "continuation" of an existing command (`decomission`): ``` $ ozone admin datanode -h Usage: ozone admin datanode [-hV] [COMMAND] Datanode specific operations -h, --help Show this help message and exit. -V, --version Print version information and exit. Commands: list List info of datanodes decommission Decommission a datanode maintenance Put a datanode into Maintenance Mode recommission Return a datanode to service usageinfo List usage information (such as Capacity, SCMUsed, Remaining) of a datanode by IP address or UUID decommission-status Show decommission status for datanodes ``` Some ideas: * rename to `status` -- if it can be extended later to show other type of status info about datanodes * rename to `status` and make it a subcommand of `decommission`; so the complete command would be `ozone admin datanode decommission status` What do you think? -- 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]
