You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/08/01 10:18:44 UTC

[GitHub] [ignite-3] PakhomovAlexander commented on a diff in pull request #961: IGNITE-17347 Add port parameters to Ignite3 CLI node start command

PakhomovAlexander commented on code in PR #961:
URL: https://github.com/apache/ignite-3/pull/961#discussion_r934361402


##########
modules/cli/src/main/java/org/apache/ignite/cli/deprecated/spec/NodeCommandSpec.java:
##########
@@ -100,12 +123,36 @@ public Integer call() {
             out.println(tbl);
             return 0;
         }
+
+        private Path getConfigPath() {
+            return configOptions != null ? configOptions.configPath : null;
+        }
+
+        private String getConfigStr() {
+            if (configOptions == null || configOptions.configPath != null) {
+                return null;
+            }
+            // port is required
+            StringBuilder sb = new StringBuilder();

Review Comment:
   I think it is better to use `Config` class from `typesafe` lib to construct a configuration representation.



##########
modules/cli/src/main/java/org/apache/ignite/cli/deprecated/spec/NodeCommandSpec.java:
##########
@@ -62,12 +65,31 @@ public static class StartNodeCommandSpec extends BaseCommand implements Callable
         private NodeManager nodeMgr;
 
         /** Consistent id, which will be used by new node. */
-        @CommandLine.Parameters(paramLabel = "name", description = "Name of the new node")
+        @Parameters(paramLabel = "name", description = "Name of the new node")
         public String nodeName;
 
-        /** Path to node config. */
-        @CommandLine.Option(names = "--config", description = "Configuration file to start the node with")
-        private Path configPath;
+        @ArgGroup
+        private ConfigOptions configOptions;
+
+        private static class ConfigOptions {
+            @ArgGroup(exclusive = false)

Review Comment:
   Could you add an unit test to verify that it is truly exclusive?
   



-- 
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: notifications-unsubscribe@ignite.apache.org

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