jameshartig commented on code in PR #1793:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1793#discussion_r1945905041


##########
session.go:
##########
@@ -1430,6 +1435,22 @@ func (q *Query) releaseAfterExecution() {
        q.decRefCount()
 }
 
+// SetHostID allows to define on which host the query should be executed.
+// If hostID is not set, then the HostSelectionPolicy will be used to pick a 
host.
+// It is recommended to get host id from HostInfo.HostID(), but it is not 
required.
+// It is strongly recommended to use WithContext() with this option because
+// if the specified host goes down during execution, the driver will try to 
send the query to this host until it succeeds
+// which may lead to an endless execution.
+func (q *Query) SetHostID(hostID string) *Query {
+       q.hostID = hostID

Review Comment:
   The comments for this method are getting lengthly. How about:
   
   
   ```go
   // SetHostID allows to define the host the query should be executed against. 
If the
   // host was filtered or otherwise unavailable, then the query will error. If 
an empty
   // string is sent, the default behavior, using the configured 
HostSelectionPolicy will
   // be used. A hostID can be obtained from HostInfo.HostID() after calling 
GetHosts().
   ```
   
   I removed the WithContext part because we plan to fix that in a follow-up 
issue.



-- 
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-unsubscr...@cassandra.apache.org

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


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

Reply via email to