You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "smiklosovic (via GitHub)" <gi...@apache.org> on 2023/02/24 11:37:44 UTC

[GitHub] [cassandra] smiklosovic commented on a diff in pull request #1683: CASSANDRA-14715 3.11

smiklosovic commented on code in PR #1683:
URL: https://github.com/apache/cassandra/pull/1683#discussion_r1116869157


##########
src/java/org/apache/cassandra/service/DataResolver.java:
##########
@@ -56,10 +58,16 @@ public class DataResolver extends ResponseResolver
     private final boolean enforceStrictLiveness;
 
     DataResolver(Keyspace keyspace, ReadCommand command, ConsistencyLevel consistency, int maxResponseCount, long queryStartNanoTime)
+    {
+        this(keyspace, command, consistency, maxResponseCount, queryStartNanoTime, command.metadata().enforceStrictLiveness());
+    }
+
+    @VisibleForTesting
+    DataResolver(Keyspace keyspace, ReadCommand command, ConsistencyLevel consistency, int maxResponseCount, long queryStartNanoTime, boolean enforceStrictLiveness)

Review Comment:
   ReadCommand is quite hard to mock / initialize in test, it just needs too much stuff. When command is null, for the sake of the test to have something there for `DataResolver` constructor, it would fail on `command.metadata().enforceStrictLiveness`. So I did one more constructor which might be called from the test where we set it without going through (null) `command`.



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org