You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2023/02/01 08:40:24 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #4221: HDDS-3591. ozone.administrators support dynamic changes through the cli.

adoroszlai commented on code in PR #4221:
URL: https://github.com/apache/ozone/pull/4221#discussion_r1092882189


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMCommands.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.cli.SubcommandWithParent;
+import org.kohsuke.MetaInfServices;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Subcommand to group reconfigure OM related operations.
+ */
+@Command(
+    name = "reconfig",
+    description = "Dynamically reconfig OM without restarting server",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class,
+    subcommands = {
+        ReconfigureOMStartSubcommand.class, 
+        ReconfigureOMStatusSubcommand.class,
+        ReconfigureOMPropertiesSubcommand.class
+    })
+@MetaInfServices(SubcommandWithParent.class)
+public class ReconfigureOMCommands implements Callable<Void>,
+    SubcommandWithParent {
+
+  @CommandLine.ParentCommand
+  private OMAdmin parent;
+
+  @Spec
+  private CommandSpec spec;
+
+  @CommandLine.Option(names = {"-address"},

Review Comment:
   Please avoid adding long options with single dash.
   
   ```suggestion
     @CommandLine.Option(names = {"--address"},
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMCommands.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.cli.SubcommandWithParent;
+import org.kohsuke.MetaInfServices;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Subcommand to group reconfigure OM related operations.
+ */
+@Command(
+    name = "reconfig",
+    description = "Dynamically reconfig OM without restarting server",

Review Comment:
   ```suggestion
       description = "Dynamically reconfigure server without restarting it",
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMCommands.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.cli.SubcommandWithParent;
+import org.kohsuke.MetaInfServices;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Subcommand to group reconfigure OM related operations.
+ */
+@Command(
+    name = "reconfig",
+    description = "Dynamically reconfig OM without restarting server",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class,
+    subcommands = {
+        ReconfigureOMStartSubcommand.class, 
+        ReconfigureOMStatusSubcommand.class,
+        ReconfigureOMPropertiesSubcommand.class
+    })
+@MetaInfServices(SubcommandWithParent.class)
+public class ReconfigureOMCommands implements Callable<Void>,

Review Comment:
   Please rename to be service-agnostic (`ReconfigureCommands`, `ReconfigureStartSubcommand`, etc.).



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMCommands.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.admin.om;

Review Comment:
   Please move these reconfiguration-related classes to the `org.apache.hadoop.ozone.admin.reconfig` package.  (Don't forget to add a `package-info.java` in the new package.)



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMStartSubcommand.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.protocol.ReconfigureProtocol;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import java.util.concurrent.Callable;
+
+/**
+ * Handler of ozone admin om reconfig start command.
+ */
+@Command(
+    name = "start",
+    description = "Start reconfig asynchronously",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class)
+public class ReconfigureOMStartSubcommand implements Callable<Void> {
+
+  @CommandLine.ParentCommand
+  private ReconfigureOMCommands parent;
+
+  @Override
+  public Void call() throws Exception {
+    ReconfigureProtocol reconfigProxy = ReconfigureOMSubCommandUtil
+        .getSingleOMReconfigureProxy(parent.getAddress());
+    reconfigProxy.startReconfigure();
+    System.out.printf("Started OM reconfiguration task on node [%s].%n",

Review Comment:
   ```suggestion
       System.out.printf("Started reconfiguration task on node [%s].%n",
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMCommands.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.cli.SubcommandWithParent;
+import org.kohsuke.MetaInfServices;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Subcommand to group reconfigure OM related operations.
+ */
+@Command(
+    name = "reconfig",

Review Comment:
   ```suggestion
       name = "reconfigure", aliases = {"reconfig"}
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMSubCommandUtil.java:
##########
@@ -0,0 +1,46 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.protocol.ReconfigureProtocol;
+import org.apache.hadoop.hdds.protocolPB.ReconfigureProtocolClientSideTranslatorPB;
+import org.apache.hadoop.net.NetUtils;
+import org.apache.hadoop.security.UserGroupInformation;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+
+/**
+ * Reconfigure subcommand utils.
+ */
+public final class ReconfigureOMSubCommandUtil {

Review Comment:
   This can be package-private:
   
   ```suggestion
   final class ReconfigureOMSubCommandUtil {
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMPropertiesSubcommand.java:
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.protocol.ReconfigureProtocol;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import java.util.List;
+import java.util.concurrent.Callable;
+
+/**
+ * Handler of ozone admin om reconfigure properties command.
+ */
+@Command(
+    name = "properties",
+    description = "List reconfigurable properties",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class)
+public class ReconfigureOMPropertiesSubcommand implements Callable<Void> {
+
+  @CommandLine.ParentCommand
+  private ReconfigureOMCommands parent;
+
+  @Override
+  public Void call() throws Exception {
+    ReconfigureProtocol reconfigProxy = ReconfigureOMSubCommandUtil
+        .getSingleOMReconfigureProxy(parent.getAddress());
+    List<String> properties = reconfigProxy.listReconfigureProperties();
+    System.out.printf("OM Node [%s] Reconfigurable properties:%n",

Review Comment:
   ```suggestion
       System.out.printf("Node [%s] Reconfigurable properties:%n",
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMCommands.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.cli.SubcommandWithParent;
+import org.kohsuke.MetaInfServices;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Subcommand to group reconfigure OM related operations.
+ */
+@Command(
+    name = "reconfig",
+    description = "Dynamically reconfig OM without restarting server",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class,
+    subcommands = {
+        ReconfigureOMStartSubcommand.class, 
+        ReconfigureOMStatusSubcommand.class,
+        ReconfigureOMPropertiesSubcommand.class
+    })
+@MetaInfServices(SubcommandWithParent.class)
+public class ReconfigureOMCommands implements Callable<Void>,
+    SubcommandWithParent {
+
+  @CommandLine.ParentCommand
+  private OMAdmin parent;
+
+  @Spec
+  private CommandSpec spec;
+
+  @CommandLine.Option(names = {"-address"},
+      description = "om node address: <ip:port> or <hostname:port>",
+      required = true)
+  private String address;
+
+  @Override
+  public Void call() throws Exception {
+    GenericCli.missingSubcommand(spec);
+    return null;
+  }
+
+  public String getAddress() {
+    return address;
+  }
+
+  @Override
+  public Class<?> getParentType() {
+    return OMAdmin.class;

Review Comment:
   Please make this a subcommand of `ozone admin`, so that we can extend it to other services (e.g. SCM).
   
   ```suggestion
       return OzoneAdmin.class;
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMStatusSubcommand.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.conf.ReconfigurationTaskStatus;
+import org.apache.hadoop.conf.ReconfigurationUtil;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.protocol.ReconfigureProtocol;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.Callable;
+
+/**
+ * Handler of ozone admin om reconfig status command.
+ */
+@Command(
+    name = "status",
+    description = "Check reconfig status",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class)
+public class ReconfigureOMStatusSubcommand implements Callable<Void> {
+
+  @CommandLine.ParentCommand
+  private ReconfigureOMCommands parent;
+
+  @Override
+  public Void call() throws Exception {
+    ReconfigureProtocol reconfigProxy = ReconfigureOMSubCommandUtil
+        .getSingleOMReconfigureProxy(parent.getAddress());
+    ReconfigurationTaskStatus status = reconfigProxy.getReconfigureStatus();
+    System.out.printf("Reconfiguring status for node [%s]: ",
+        parent.getAddress());
+    printReconfigurationStatus(status);
+    return null;
+  }
+
+  private void printReconfigurationStatus(ReconfigurationTaskStatus status) {
+    if (!status.hasTask()) {
+      System.out.println("no task was found.");
+      return;
+    }
+    System.out.print("started at " + new Date(status.getStartTime()));
+    if (!status.stopped()) {
+      System.out.println(" and is still running.");
+      return;
+    }
+    System.out.printf(" and finished at %s.%n", new Date(status.getEndTime()));
+    if (status.getStatus() == null) {
+      // Nothing to report.
+      return;
+    }
+    for (Map.Entry<ReconfigurationUtil.PropertyChange, Optional<String>>
+        result : status.getStatus().entrySet()) {
+      if (!result.getValue().isPresent()) {
+        System.out.printf(
+            "SUCCESS: Changed OM property %s%n\tFrom: \"%s\"%n\tTo: \"%s\"%n",
+            result.getKey().prop, result.getKey().oldVal,
+            result.getKey().newVal);
+      } else {
+        final String errorMsg = result.getValue().get();
+        System.out.printf(
+            "FAILED: Change OM property %s%n\tFrom: \"%s\"%n\tTo: \"%s\"%n",

Review Comment:
   ```suggestion
               "FAILED: Change property %s%n\tFrom: \"%s\"%n\tTo: \"%s\"%n",
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMStatusSubcommand.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.conf.ReconfigurationTaskStatus;
+import org.apache.hadoop.conf.ReconfigurationUtil;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.protocol.ReconfigureProtocol;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.Callable;
+
+/**
+ * Handler of ozone admin om reconfig status command.
+ */
+@Command(
+    name = "status",
+    description = "Check reconfig status",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class)
+public class ReconfigureOMStatusSubcommand implements Callable<Void> {
+
+  @CommandLine.ParentCommand
+  private ReconfigureOMCommands parent;
+
+  @Override
+  public Void call() throws Exception {
+    ReconfigureProtocol reconfigProxy = ReconfigureOMSubCommandUtil
+        .getSingleOMReconfigureProxy(parent.getAddress());
+    ReconfigurationTaskStatus status = reconfigProxy.getReconfigureStatus();
+    System.out.printf("Reconfiguring status for node [%s]: ",
+        parent.getAddress());
+    printReconfigurationStatus(status);
+    return null;
+  }
+
+  private void printReconfigurationStatus(ReconfigurationTaskStatus status) {
+    if (!status.hasTask()) {
+      System.out.println("no task was found.");
+      return;
+    }
+    System.out.print("started at " + new Date(status.getStartTime()));
+    if (!status.stopped()) {
+      System.out.println(" and is still running.");
+      return;
+    }
+    System.out.printf(" and finished at %s.%n", new Date(status.getEndTime()));
+    if (status.getStatus() == null) {
+      // Nothing to report.
+      return;
+    }
+    for (Map.Entry<ReconfigurationUtil.PropertyChange, Optional<String>>
+        result : status.getStatus().entrySet()) {
+      if (!result.getValue().isPresent()) {
+        System.out.printf(
+            "SUCCESS: Changed OM property %s%n\tFrom: \"%s\"%n\tTo: \"%s\"%n",

Review Comment:
   ```suggestion
               "SUCCESS: Changed property %s%n\tFrom: \"%s\"%n\tTo: \"%s\"%n",
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/om/ReconfigureOMCommands.java:
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.admin.om;
+
+import org.apache.hadoop.hdds.cli.GenericCli;
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.cli.SubcommandWithParent;
+import org.kohsuke.MetaInfServices;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+/**
+ * Subcommand to group reconfigure OM related operations.
+ */
+@Command(
+    name = "reconfig",
+    description = "Dynamically reconfig OM without restarting server",
+    mixinStandardHelpOptions = true,
+    versionProvider = HddsVersionProvider.class,
+    subcommands = {
+        ReconfigureOMStartSubcommand.class, 
+        ReconfigureOMStatusSubcommand.class,
+        ReconfigureOMPropertiesSubcommand.class
+    })
+@MetaInfServices(SubcommandWithParent.class)
+public class ReconfigureOMCommands implements Callable<Void>,
+    SubcommandWithParent {
+
+  @CommandLine.ParentCommand
+  private OMAdmin parent;

Review Comment:
   ```suggestion
     private OzoneAdmin parent;
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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