ygerzhedovich commented on code in PR #1501:
URL: https://github.com/apache/ignite-3/pull/1501#discussion_r1087834876
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/storage/InternalTableImpl.java:
##########
@@ -1010,6 +1079,30 @@ public List<String> assignments() {
.collect(Collectors.toList());
}
+ /** {@inheritDoc} */
+ // TODO: IGNITE-17256 Use a placement driver for getting a primary replica.
+ @Override
+ public List<IgniteBiTuple<String, Long>> leaderAssignmentsWithTerm() {
+ List<Entry<RaftGroupService>> entries = new
ArrayList<>(partitionMap.int2ObjectEntrySet());
+ List<CompletableFuture<LeaderWithTerm>> futs = new ArrayList<>();
+
+ entries.sort(Comparator.comparingInt(Entry::getIntKey));
Review Comment:
I see a few places in the class where we are sorting the map. Let's rewrite
it to use an already sorted map - Int2ObjectSortedMap
--
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]