denis-chudov commented on code in PR #6641:
URL: https://github.com/apache/ignite-3/pull/6641#discussion_r2387945630
##########
modules/placement-driver/src/main/java/org/apache/ignite/internal/placementdriver/AssignmentsTracker.java:
##########
@@ -156,6 +184,124 @@ public CompletableFuture<List<TokenizedAssignments>>
getAssignments(
}));
}
+ @Override
+ public CompletableFuture<List<TokenizedAssignments>>
awaitNonEmptyAssignments(
+ List<? extends ReplicationGroupId> replicationGroupIds,
+ HybridTimestamp clusterTimeToAwait,
+ long timeoutMillis
+ ) {
+ return msManager
+ .clusterTime()
+ .waitFor(clusterTimeToAwait)
+ .thenCompose(ignored -> inBusyLock(busyLock, () -> {
+ long now = coarseCurrentTimeMillis();
+ return
awaitNonEmptyAssignmentsWithCheckMostRecent(replicationGroupIds, now,
timeoutMillis);
+ }))
+ .thenApply(identity());
+ }
+
+ private CompletableFuture<List<TokenizedAssignments>>
awaitNonEmptyAssignmentsWithCheckMostRecent(
+ List<? extends ReplicationGroupId> replicationGroupIds,
+ long startTime,
+ long timeoutMillis
+ ) {
+ Map<ReplicationGroupId, TokenizedAssignments> assignmentsMap =
stableAssignments();
+
+ Map<Integer, CompletableFuture<TokenizedAssignments>> futures = new
HashMap<>();
+ List<TokenizedAssignments> result = new
ArrayList<>(replicationGroupIds.size());
+
+ for (int i = 0; i < replicationGroupIds.size(); i++) {
+ ReplicationGroupId groupId = replicationGroupIds.get(i);
+
+ TokenizedAssignments a = assignmentsMap.get(groupId);
+ result.add(a);
+
+ if (a.nodes().isEmpty()) {
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]