Skip to content

Commit

Permalink
Make isScyllaConn() a Conn method
Browse files Browse the repository at this point in the history
  • Loading branch information
sylwiaszunejko committed Dec 9, 2024
1 parent dacf696 commit 3d1d7a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion connectionpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func (pool *hostConnPool) initConnPicker(conn *Conn) {
return
}

if isScyllaConn(conn) {
if conn.isScyllaConn() {
pool.connPicker = newScyllaConnPicker(conn)
return
}
Expand Down
2 changes: 1 addition & 1 deletion scylla.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func parseCQLProtocolExtensions(supported map[string][]string) []cqlProtocolExte
}

// isScyllaConn checks if conn is suitable for scyllaConnPicker.
func isScyllaConn(conn ConnInterface) bool {
func (conn *Conn) isScyllaConn() bool {
return conn.getScyllaSupported().nrShards != 0
}

Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func (s *Session) init() error {
conn := s.control.getConn().conn.(*Conn)
conn.mu.Lock()
s.tabletsRoutingV1 = conn.isTabletSupported()
if s.cfg.MetadataSchemaRequestTimeout > time.Duration(0) && isScyllaConn(conn) {
if s.cfg.MetadataSchemaRequestTimeout > time.Duration(0) && conn.isScyllaConn() {
s.usingTimeoutClause = " USING TIMEOUT " + strconv.FormatInt(int64(s.cfg.MetadataSchemaRequestTimeout.Milliseconds()), 10) + "ms"
}
conn.mu.Unlock()
Expand Down

0 comments on commit 3d1d7a4

Please sign in to comment.