adelapena commented on code in PR #2935:
URL: https://github.com/apache/cassandra/pull/2935#discussion_r1496278069


##########
test/unit/org/apache/cassandra/index/sai/cql/intersection/RandomIntersectionTester.java:
##########
@@ -80,7 +80,8 @@ protected void runRestrictedQueries() throws Throwable
         Map<Integer, List<TestRow>> testRowMap = buildAndLoadTestRows();
 
         beforeAndAfterFlush(() -> {
-            for (int queryCount = 0; queryCount < nextInt(10, 100); 
queryCount++)
+            int queryCount = nextInt(10, 80);

Review Comment:
   Why 10-80 instead of the previous 10-100?



##########
src/java/org/apache/cassandra/service/reads/DataResolver.java:
##########
@@ -311,6 +312,27 @@ private PartitionIterator resolveInternal(ResolveContext 
context,
         return Transformation.apply(counted, new EmptyPartitionsDiscarder());
     }
 
+    private PartitionIterator resolveWithoutCounter(ResolveContext 
firstPhaseContext,

Review Comment:
   It seems there is a lot of code duplication between `resolveInternal` and 
`resolveWithoutCounter`. We should probably extract the common part and maybe 
rename `resolveInternal` to `resolveWithCounter` or something like that. 
   
   Alternatively, we can simply pass a null counter to the old 
`resolveInternal`:
   ```java
   PartitionIterator counted = preCountFilter == null 
                               ? filtered 
                               : 
Transformation.apply(preCountFilter.apply(filtered), 
context.mergedResultCounter);
   ```



##########
src/java/org/apache/cassandra/service/reads/DataResolver.java:
##########
@@ -149,6 +149,11 @@ private class ResolveContext
         private final DataLimits.Counter mergedResultCounter;
 
         private ResolveContext(E replicas)
+        {
+            this(replicas, true);
+        }
+
+        private ResolveContext(E replicas, boolean enforceLimits)

Review Comment:
   Maybe its better to have a single constructor and be explicit about 
`enforceLimits` (there are only three usages).



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