ibessonov commented on code in PR #1016:
URL: https://github.com/apache/ignite-3/pull/1016#discussion_r958141742


##########
modules/affinity/src/main/java/org/apache/ignite/internal/affinity/AffinityUtils.java:
##########
@@ -17,15 +17,43 @@
 
 package org.apache.ignite.internal.affinity;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+import java.util.function.Function;
 import org.apache.ignite.network.ClusterNode;
 import org.jetbrains.annotations.NotNull;
 
 /**
  * Stateless affinity utils that produces helper methods for an affinity 
assignments calculation.
  */
 public class AffinityUtils {
+    /**
+     * Calculates affinity assignments.
+     *
+     * @param partitions Partitions count.
+     * @param replicas   Replicas count.

Review Comment:
   ```suggestion
        * @param replicas Replicas count.
   ```



##########
modules/affinity/src/main/java/org/apache/ignite/internal/affinity/AffinityUtils.java:
##########
@@ -17,15 +17,43 @@
 
 package org.apache.ignite.internal.affinity;
 
+import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
+import java.util.function.Function;
 import org.apache.ignite.network.ClusterNode;
 import org.jetbrains.annotations.NotNull;
 
 /**
  * Stateless affinity utils that produces helper methods for an affinity 
assignments calculation.
  */
 public class AffinityUtils {
+    /**
+     * Calculates affinity assignments.
+     *
+     * @param partitions Partitions count.
+     * @param replicas   Replicas count.
+     * @param aggregator Function that creates a collection for the partition 
assignments.
+     * @return List nodes by partition.
+     */
+    public static <T extends Collection<ClusterNode>> List<T> 
calculateAssignments(
+            @NotNull Collection<ClusterNode> baselineNodes,
+            int partitions,
+            int replicas,
+            Function<Integer, T> aggregator

Review Comment:
   There's an `IntFunction` in Java



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