grom358 commented on code in PR #2625:
URL: https://github.com/apache/cassandra/pull/2625#discussion_r1328352615


##########
src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:
##########
@@ -45,6 +45,7 @@ private UnfilteredPartitionIterators() {}
 
     public interface MergeListener
     {
+        public default boolean preserveOrder() { return true; }

Review Comment:
   Updated NOOP and added javadoc comment



##########
src/java/org/apache/cassandra/db/partitions/UnfilteredPartitionIterators.java:
##########
@@ -120,9 +121,16 @@ public void reduce(int idx, UnfilteredRowIterator current)
                 partitionKey = current.partitionKey();
                 isReverseOrder = current.isReverseOrder();
 
-                // Note that because the MergeListener cares about it, we want 
to preserve the index of the iterator.
-                // Non-present iterator will thus be set to empty in 
getReduced.
-                toMerge.set(idx, current);
+                if (listener != null && listener.preserveOrder())

Review Comment:
   Completed



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to