You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "rpuch (via GitHub)" <gi...@apache.org> on 2023/06/08 08:11:48 UTC

[GitHub] [ignite-3] rpuch opened a new pull request, #2168: IGNITE-19685 Treat Scalecube's LEAVING event as 'node left' in the physical topology

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

   https://issues.apache.org/jira/browse/IGNITE-19685


-- 
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] rpuch commented on a diff in pull request #2168: IGNITE-19685 Treat Scalecube's LEAVING event as 'node left' in the physical topology

Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #2168:
URL: https://github.com/apache/ignite-3/pull/2168#discussion_r1223097131


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/Cluster.java:
##########
@@ -135,12 +135,28 @@ public void startAndInit(int nodeCount) {
      * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
      */
     public void startAndInit(int nodeCount, Consumer<InitParametersBuilder> initParametersConfigurator) {
+        startAndInit(nodeCount, defaultNodeBootstrapConfigTemplate, initParametersConfigurator);
+    }
+
+    /**
+     * Starts the cluster with the given number of nodes and initializes it.
+     *
+     * @param nodeCount Number of nodes in the cluster.
+     * @param nodeBootstrapConfigTemplate Node bootstrap config template to be used for each node started
+     *     with this call.
+     * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
+     */
+    public void startAndInit(
+            int nodeCount,
+            String nodeBootstrapConfigTemplate,

Review Comment:
   Why? Usually it is more convenient to have 'closure-like' arguments last in the arg list



-- 
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] tkalkirill commented on a diff in pull request #2168: IGNITE-19685 Treat Scalecube's LEAVING event as 'node left' in the physical topology

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2168:
URL: https://github.com/apache/ignite-3/pull/2168#discussion_r1223109458


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/Cluster.java:
##########
@@ -135,12 +135,28 @@ public void startAndInit(int nodeCount) {
      * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
      */
     public void startAndInit(int nodeCount, Consumer<InitParametersBuilder> initParametersConfigurator) {
+        startAndInit(nodeCount, defaultNodeBootstrapConfigTemplate, initParametersConfigurator);
+    }
+
+    /**
+     * Starts the cluster with the given number of nodes and initializes it.
+     *
+     * @param nodeCount Number of nodes in the cluster.
+     * @param nodeBootstrapConfigTemplate Node bootstrap config template to be used for each node started
+     *     with this call.
+     * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
+     */
+    public void startAndInit(
+            int nodeCount,
+            String nodeBootstrapConfigTemplate,

Review Comment:
   It just looks better to me when two (or more) methods/constructors have the same order of arguments.
   
   Up to you.



-- 
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] rpuch commented on a diff in pull request #2168: IGNITE-19685 Treat Scalecube's LEAVING event as 'node left' in the physical topology

Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #2168:
URL: https://github.com/apache/ignite-3/pull/2168#discussion_r1223097131


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/Cluster.java:
##########
@@ -135,12 +135,28 @@ public void startAndInit(int nodeCount) {
      * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
      */
     public void startAndInit(int nodeCount, Consumer<InitParametersBuilder> initParametersConfigurator) {
+        startAndInit(nodeCount, defaultNodeBootstrapConfigTemplate, initParametersConfigurator);
+    }
+
+    /**
+     * Starts the cluster with the given number of nodes and initializes it.
+     *
+     * @param nodeCount Number of nodes in the cluster.
+     * @param nodeBootstrapConfigTemplate Node bootstrap config template to be used for each node started
+     *     with this call.
+     * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
+     */
+    public void startAndInit(
+            int nodeCount,
+            String nodeBootstrapConfigTemplate,

Review Comment:
   Why? Usually it is more convenient to have 'closure-like' arguments last in the arg list, because, if the corresponding closure takes a few lines, it's bearable for the last argument, but for a non-last argument it looks not so pretty.



-- 
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] tkalkirill merged pull request #2168: IGNITE-19685 Treat Scalecube's LEAVING event as 'node left' in the physical topology

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill merged PR #2168:
URL: https://github.com/apache/ignite-3/pull/2168


-- 
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] tkalkirill commented on a diff in pull request #2168: IGNITE-19685 Treat Scalecube's LEAVING event as 'node left' in the physical topology

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2168:
URL: https://github.com/apache/ignite-3/pull/2168#discussion_r1223011659


##########
modules/network/src/test/java/org/apache/ignite/network/scalecube/ScaleCubeTopologyServiceTest.java:
##########
@@ -0,0 +1,70 @@
+/*
+ * 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.network.scalecube;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.hasSize;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.nullValue;
+
+import io.scalecube.cluster.Member;
+import io.scalecube.cluster.membership.MembershipEvent;
+import io.scalecube.net.Address;
+import org.junit.jupiter.api.Test;
+
+class ScaleCubeTopologyServiceTest {
+    private final ScaleCubeTopologyService topologyService = new ScaleCubeTopologyService();
+
+    private final Member member1 = new Member("id1", "first", Address.create("host", 1001), "default");
+    private final Member member2 = new Member("id2", "second", Address.create("host", 1002), "default");
+
+    @Test
+    void addedEventAddsNodeToTopology() {
+        topologyService.onMembershipEvent(MembershipEvent.createAdded(member1, null, 1));
+        topologyService.onMembershipEvent(MembershipEvent.createAdded(member2, null, 2));

Review Comment:
   ```suggestion
           addTwoMembers();
   ```



##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/Cluster.java:
##########
@@ -135,12 +135,28 @@ public void startAndInit(int nodeCount) {
      * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
      */
     public void startAndInit(int nodeCount, Consumer<InitParametersBuilder> initParametersConfigurator) {
+        startAndInit(nodeCount, defaultNodeBootstrapConfigTemplate, initParametersConfigurator);
+    }
+
+    /**
+     * Starts the cluster with the given number of nodes and initializes it.
+     *
+     * @param nodeCount Number of nodes in the cluster.
+     * @param nodeBootstrapConfigTemplate Node bootstrap config template to be used for each node started
+     *     with this call.
+     * @param initParametersConfigurator Configure {@link InitParameters} before initializing the cluster.
+     */
+    public void startAndInit(
+            int nodeCount,
+            String nodeBootstrapConfigTemplate,

Review Comment:
   I propose to move this argument below.



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