tkalkirill commented on code in PR #1384:
URL: https://github.com/apache/ignite-3/pull/1384#discussion_r1035609657


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/ActionOnTerm.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.internal.cluster.management.raft;
+
+/**
+ * Action executed with a given RAFT term.
+ */
+@FunctionalInterface
+public interface ActionOnTerm {

Review Comment:
   It seems that either there is not enough description, or it is enough to use 
**java.util.function.LongConsumer**



##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/CmgRaftService.java:
##########
@@ -206,4 +215,29 @@ private ClusterNodeMessage nodeMessage(ClusterNode node) {
                 .port(node.address().port())
                 .build();
     }
+
+    /**
+     * Issues {@code changePeersAsync} request with same peers; learners are 
recalculated based on the current peers (which is same as
+     * CMG nodes) and known logical topology. Any node in the logical topology 
that is not a CMG node constitutes a learner.
+     *
+     * @param term RAFT term in which we operate (used to avoid races when 
changing peers/learners).
+     * @return Future that completes when the request is processed.
+     */
+    public CompletableFuture<Void> updateLearners(long term) {
+        List<Peer> currentPeers = raftService.peers();

Review Comment:
   Is it possible to use LinkedHashSet instead of a 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to