vdmitrienko commented on code in PR #7064:
URL: https://github.com/apache/ignite-3/pull/7064#discussion_r2565984612


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexBuildTask.java:
##########
@@ -221,9 +235,18 @@ private CompletableFuture<Void> handleNextBatch(@Nullable 
RowId highestRowId) {
 
         try {
             return createBatchToIndex(highestRowId)
-                    .thenCompose(batch -> {
-                        return replicaService.invoke(node, 
createBuildIndexReplicaRequest(batch, initialOperationTimestamp));
-                    })
+                    .thenCompose(batch ->
+                            replicaService.invoke(node, 
createBuildIndexReplicaRequest(batch, initialOperationTimestamp))
+                                    .whenComplete((unused, throwable) -> {
+                                        if (throwable == null) {
+                                            
taskListener.onRaftCallSuccess(taskId);
+                                        } else {
+                                            
taskListener.onRaftCallFailure(taskId);
+                                        }
+                                    })
+                                    .thenApply(unused -> batch)
+                    )
+                    .thenAccept(batch -> taskListener.onBatchProcessed(taskId, 
batch.rowIds.size()))

Review Comment:
   Extracted batch processing to a separate method: 
https://github.com/apache/ignite-3/pull/7064/commits/5c83ffe15e533991fa2759fac7435e1b82735ac5
   
   Done.



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