joao-r-reis commented on code in PR #1868:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1868#discussion_r2044794228


##########
query_executor.go:
##########
@@ -27,33 +27,51 @@ package gocql
 import (
        "context"
        "sync"
+       "sync/atomic"
        "time"
 )
 
-type ExecutableQuery interface {
-       borrowForExecution()    // Used to ensure that the query stays alive 
for lifetime of a particular execution goroutine.
-       releaseAfterExecution() // Used when a goroutine finishes its execution 
attempts, either with ok result or an error.
-       execute(ctx context.Context, conn *Conn) *Iter
-       attempt(keyspace string, end, start time.Time, iter *Iter, host 
*HostInfo)
-       retryPolicy() RetryPolicy
-       speculativeExecutionPolicy() SpeculativeExecutionPolicy
+// Deprecated: Will be removed in a future major release. Also Query and Batch 
no longer implement this interface.
+//
+// Please use Statement (for Query / Batch objects) or ExecutableStatement (in 
HostSelectionPolicy implementations) instead.
+type ExecutableQuery = ExecutableStatement
+
+// ExecutableStatement is an interface that represents a query or batch 
statement that
+// exposes the correct functions for the HostSelectionPolicy to operate 
correctly.
+type ExecutableStatement interface {
        GetRoutingKey() ([]byte, error)
        Keyspace() string
        Table() string
        IsIdempotent() bool
        GetHostID() string
+       Statement() Statement
+}
 
-       withContext(context.Context) ExecutableQuery
+// Statement is an interface that represents a CQL statement that the driver 
can execute
+// (currently Query and Batch via Session.Query and Session.Batch)
+type Statement interface {
+       Iter() *Iter
+       Exec() error
+}

Review Comment:
   good suggestion 👍 done



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