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/06/23 12:39:54 UTC

[GitHub] [ignite-3] valepakh opened a new pull request, #895: IGNITE-17162 Fix init cluster command options

valepakh opened a new pull request, #895:
URL: https://github.com/apache/ignite-3/pull/895

   In addition to changing --node-endpoint to the --cluster-url option in the cluster init command, this PR actually rewrites this command to use CLI execution pipeline and generated REST client. Since we can't easily mock the HttpClient for the generated client, mock-server was used to test this and other commands. mock-server has an ability to test against the generated OpenAPI spec but it was found that it's not enough, for example, it's impossible to verify the request payload in this case.


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


[GitHub] [ignite-3] sk0x50 commented on a diff in pull request #895: IGNITE-17162 Fix init cluster command options

Posted by GitBox <gi...@apache.org>.
sk0x50 commented on code in PR #895:
URL: https://github.com/apache/ignite-3/pull/895#discussion_r906212125


##########
modules/cli/src/main/java/org/apache/ignite/cli/commands/cluster/ClusterInitReplSubCommand.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.ignite.cli.commands.cluster;
+
+import static picocli.CommandLine.Command;
+
+import jakarta.inject.Inject;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.cli.call.cluster.ClusterInitCall;
+import org.apache.ignite.cli.call.cluster.ClusterInitCallInput;
+import org.apache.ignite.cli.call.cluster.ClusterInitCallInput.ClusterInitCallInputBuilder;
+import org.apache.ignite.cli.commands.BaseCommand;
+import org.apache.ignite.cli.core.call.CallExecutionPipeline;
+import org.apache.ignite.cli.core.repl.Session;
+import picocli.CommandLine.Option;
+
+/**
+ * Initializes an Ignite cluster.
+ */
+@Command(name = "init", description = "Initializes an Ignite cluster.")
+public class ClusterInitReplSubCommand extends BaseCommand implements Runnable {
+
+    /**
+     * Node url option.
+     */
+    @Option(
+            names = {"--cluster-url"}, description = "Url to ignite node.",

Review Comment:
   IMHO, `cluster-url` is not obvious parameter/name. I would like to rename it to `cluster-endpoint-url` or something like that. Cluster has multiple nodes/endpoints that have its own url, there is no one dedicated URL for whole cluster. What do you think?



##########
modules/cli/src/main/java/org/apache/ignite/cli/commands/cluster/ClusterInitReplSubCommand.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.ignite.cli.commands.cluster;
+
+import static picocli.CommandLine.Command;
+
+import jakarta.inject.Inject;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.cli.call.cluster.ClusterInitCall;
+import org.apache.ignite.cli.call.cluster.ClusterInitCallInput;
+import org.apache.ignite.cli.call.cluster.ClusterInitCallInput.ClusterInitCallInputBuilder;
+import org.apache.ignite.cli.commands.BaseCommand;
+import org.apache.ignite.cli.core.call.CallExecutionPipeline;
+import org.apache.ignite.cli.core.repl.Session;
+import picocli.CommandLine.Option;
+
+/**
+ * Initializes an Ignite cluster.
+ */
+@Command(name = "init", description = "Initializes an Ignite cluster.")
+public class ClusterInitReplSubCommand extends BaseCommand implements Runnable {
+
+    /**
+     * Node url option.
+     */
+    @Option(
+            names = {"--cluster-url"}, description = "Url to ignite node.",
+            descriptionKey = "ignite.cluster-url", defaultValue = "http://localhost:10300"
+    )
+    private String clusterUrl;
+
+    /**
+     * List of names of the nodes (each represented by a separate command line argument) that will host the Metastorage Raft group. If the
+     * "--cmg-nodes" parameter is omitted, the same nodes will also host the Cluster Management Raft group.
+     */
+    @Option(names = "--meta-storage-node", required = true, description = {
+            "Name of the node (repeat like '--meta-storage-node node1 --meta-storage-node node2' to specify more than one node)",
+            "that will host the Meta Storage Raft group.",

Review Comment:
   Let's remove `raft` from the description. I would prefer `Meta Storage` ( or `Meta Storage service`) instead of `Meta Storage Raft group`. The same for the `CMG` -> `Cluster Management Service`.



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


[GitHub] [ignite-3] valepakh commented on a diff in pull request #895: IGNITE-17162 Fix init cluster command options

Posted by GitBox <gi...@apache.org>.
valepakh commented on code in PR #895:
URL: https://github.com/apache/ignite-3/pull/895#discussion_r907102175


##########
modules/cli/src/main/java/org/apache/ignite/cli/commands/cluster/ClusterInitReplSubCommand.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.ignite.cli.commands.cluster;
+
+import static picocli.CommandLine.Command;
+
+import jakarta.inject.Inject;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.ignite.cli.call.cluster.ClusterInitCall;
+import org.apache.ignite.cli.call.cluster.ClusterInitCallInput;
+import org.apache.ignite.cli.call.cluster.ClusterInitCallInput.ClusterInitCallInputBuilder;
+import org.apache.ignite.cli.commands.BaseCommand;
+import org.apache.ignite.cli.core.call.CallExecutionPipeline;
+import org.apache.ignite.cli.core.repl.Session;
+import picocli.CommandLine.Option;
+
+/**
+ * Initializes an Ignite cluster.
+ */
+@Command(name = "init", description = "Initializes an Ignite cluster.")
+public class ClusterInitReplSubCommand extends BaseCommand implements Runnable {
+
+    /**
+     * Node url option.
+     */
+    @Option(
+            names = {"--cluster-url"}, description = "Url to ignite node.",
+            descriptionKey = "ignite.cluster-url", defaultValue = "http://localhost:10300"
+    )
+    private String clusterUrl;
+
+    /**
+     * List of names of the nodes (each represented by a separate command line argument) that will host the Metastorage Raft group. If the
+     * "--cmg-nodes" parameter is omitted, the same nodes will also host the Cluster Management Raft group.
+     */
+    @Option(names = "--meta-storage-node", required = true, description = {
+            "Name of the node (repeat like '--meta-storage-node node1 --meta-storage-node node2' to specify more than one node)",
+            "that will host the Meta Storage Raft group.",

Review Comment:
   Maybe we should use the same terminology as in the [IEP-77](https://cwiki.apache.org/confluence/display/IGNITE/IEP-77%3A+Node+Join+Protocol+and+Initialization+for+Ignite+3#IEP77:NodeJoinProtocolandInitializationforIgnite3-MetaStorage)? That is, `Meta Storage` and `Cluster Management Group`.



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


[GitHub] [ignite-3] asfgit closed pull request #895: IGNITE-17162 Fix init cluster command options

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #895: IGNITE-17162 Fix init cluster command options
URL: https://github.com/apache/ignite-3/pull/895


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