MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / GetClient

Method GetClient

store/cluster_node.go:145–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143}
144
145func (n *ClusterNode) GetClient() *redis.Client {
146 if client, ok := clients.Load(n.ID()); ok {
147 if rdsClient, ok := client.(*redis.Client); ok {
148 return rdsClient
149 }
150 }
151
152 client := redis.NewClient(&redis.Options{
153 Addr: n.addr,
154 Password: n.password,
155 DialTimeout: dialTimeout,
156 ReadTimeout: readTimeout,
157 WriteTimeout: writeTimeout,
158 MaxRetries: -1, // don't retry inside the client
159 MinIdleConns: minIdleConns,
160 })
161 clients.Store(n.ID(), client)
162 return client
163}
164
165func (n *ClusterNode) CheckClusterMode(ctx context.Context) (int64, error) {
166 clusterInfo, err := n.GetClusterInfo(ctx)

Callers 8

GetClusterInfoMethod · 0.95
GetClusterNodeInfoMethod · 0.95
GetClusterNodesStringMethod · 0.95
SyncClusterInfoMethod · 0.95
ResetMethod · 0.95
MigrateSlotMethod · 0.95
TestClusterNodeFunction · 0.95
SetSlotMethod · 0.80

Calls 1

IDMethod · 0.95

Tested by 1

TestClusterNodeFunction · 0.76