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