szetszwo commented on code in PR #7170:
URL: https://github.com/apache/ozone/pull/7170#discussion_r1767107303


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/ratis/OzoneRatis.java:
##########
@@ -0,0 +1,58 @@
+/**
+ * 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.ratis;

Review Comment:
   Let's move this to the existing `org.apache.hadoop.ozone.shell` package 
instead of adding a new package.



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/ratis/OzoneRatis.java:
##########
@@ -0,0 +1,58 @@
+/**
+ * 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.ratis;
+
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.tracing.TracingUtil;
+import org.apache.hadoop.ozone.shell.Shell;
+import org.apache.ratis.shell.cli.sh.RatisShell;
+
+import picocli.CommandLine;
+
+/**
+ * Ozone Ratis Command line tool.
+ */
[email protected](name = "ozone ratis",
+        description = "Shell for Ozone Ratis Operations",

Review Comment:
   Let's update the it to `"Shell for running Ratis commands"`.



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/ratis/OzoneRatis.java:
##########
@@ -0,0 +1,58 @@
+/**
+ * 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.ratis;
+
+import org.apache.hadoop.hdds.cli.HddsVersionProvider;
+import org.apache.hadoop.hdds.tracing.TracingUtil;
+import org.apache.hadoop.ozone.shell.Shell;
+import org.apache.ratis.shell.cli.sh.RatisShell;
+
+import picocli.CommandLine;
+
+/**
+ * Ozone Ratis Command line tool.
+ */
[email protected](name = "ozone ratis",
+        description = "Shell for Ozone Ratis Operations",
+        versionProvider = HddsVersionProvider.class,
+        mixinStandardHelpOptions = true)
+public class OzoneRatis extends Shell {
+
+  public OzoneRatis() {
+    super(OzoneRatis.class);
+  }
+
+  /**
+   * Main for the OzoneRatis Command handling.
+   *
+   * @param argv - System Args Strings[]
+   */
+  public static void main(String[] argv) throws Exception {
+    new OzoneRatis().run(argv);
+  }
+
+  @Override
+  public int execute(String[] argv) {
+    TracingUtil.initTracing("shell", createOzoneConfiguration());
+    String spanName = "ozone ratis" + String.join(" ", argv);
+    return TracingUtil.executeInNewSpan(spanName, () -> {
+      final RatisShell shell = new RatisShell(System.out);

Review Comment:
   Could you add a TODO?
   ```java
   // TODO: When Ozone has RATIS-2155, update this line to use the 
RatisShell.Builder
   //       in order to setup TLS and other confs.
   ```



##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/ratis/package-info.java:
##########
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+/**
+ * Ozone Ratis tool.
+ */
+package org.apache.hadoop.ozone.ratis;

Review Comment:
   Let's don't create a new package since we won't expect to have many classes.



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