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


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/replicator/PartitionReplicaListener.java:
##########
@@ -974,6 +997,42 @@ private CompletableFuture<List<BinaryRow>> 
retrieveExactEntriesUntilCursorEmpty(
         });
     }
 
+    private static void mergeRowsWithResolvedWriteIntents(
+            List<BinaryRow> rows,
+            Int2ObjectMap<CompletableFuture<TimedBinaryRow>> resolutionFutures,
+            List<BinaryRow> result
+    ) {
+        int curIndex = 0;
+        int rowsIndex = 0;
+
+        for (Entry<CompletableFuture<TimedBinaryRow>> entry : 
resolutionFutures.int2ObjectEntrySet()) {

Review Comment:
   What if we pre-inserted `null` into an original list, and then instead of 
joining sub-lists we would just do a `set` in a loop? Such an algorithm seems 
much more simple to me.
   Why have you decided to make it this complicated?
   
   Another option, even more efficient one (edit: questionable statement, I 
know). Have a `List<Object>`. When we're done, replace each completable future 
value with its result, and cast this list to `List<BinaryRow>`. A little bit 
dirty, but with a good comment it might be the best solution



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