worryg0d commented on code in PR #1793:
URL:
https://github.com/apache/cassandra-gocql-driver/pull/1793#discussion_r1850776329
##########
query_executor.go:
##########
@@ -83,7 +83,28 @@ func (q *queryExecutor) speculate(ctx context.Context, qry
ExecutableQuery, sp S
}
func (q *queryExecutor) executeQuery(qry ExecutableQuery) (*Iter, error) {
- hostIter := q.policy.Pick(qry)
+ type hostGetter interface {
Review Comment:
I don't mind extending `ExecutableQuery` interface, but adding private
methods is not the best thing to me. The driver exposes `HostSelectionPolicy`
interface and allows user to provide their own implementations, but users
cannot properly test them because `Pick()` accepts `ExecutableQuery` that
cannot be mocked for testing purposes due to private methods inside... Ofc they
can just pass `Query` and `Batch` objects, but I'm unsure if it is enough for
testing
--
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]