sergeyuttsel commented on code in PR #1572:
URL: https://github.com/apache/ignite-3/pull/1572#discussion_r1093435552
##########
modules/affinity/src/main/java/org/apache/ignite/internal/affinity/AffinityUtils.java:
##########
@@ -48,32 +47,32 @@ public static List<Set<Assignment>>
calculateAssignments(Collection<ClusterNode>
HashSet::new
);
- return
affinityNodes.stream().map(AffinityUtils::clusterNodesToAssignments).collect(toList());
+ return
affinityNodes.stream().map(AffinityUtils::consistentIdsToAssignments).collect(toList());
}
/**
* Calculates affinity assignments for a single partition.
*
- * @param baselineNodes Nodes.
+ * @param consistentIds Consistent ids of nodes.
* @param partition Partition id.
* @param replicas Replicas count.
- * @return List of assignments.
+ * @return Set of assignments.
*/
- public static Set<Assignment>
calculateAssignmentForPartition(Collection<ClusterNode> baselineNodes, int
partition, int replicas) {
- Set<ClusterNode> affinityNodes =
RendezvousAffinityFunction.assignPartition(
+ public static Set<Assignment>
calculateAssignmentForPartition(Collection<String> consistentIds, int
partition, int replicas) {
+ Set<String> affinityNodes = RendezvousAffinityFunction.assignPartition(
partition,
- new ArrayList<>(baselineNodes),
+ new ArrayList<>(consistentIds),
replicas,
null,
false,
null,
HashSet::new
);
- return clusterNodesToAssignments(affinityNodes);
+ return consistentIdsToAssignments(affinityNodes);
}
- private static Set<Assignment>
clusterNodesToAssignments(Collection<ClusterNode> nodes) {
- return nodes.stream().map(node ->
Assignment.forPeer(node.name())).collect(toSet());
+ private static Set<Assignment>
consistentIdsToAssignments(Collection<String> nodes) {
+ return nodes.stream().map(node ->
Assignment.forPeer(node)).collect(toSet());
Review Comment:
Fixed.
--
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]