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

Method GetCluster

store/store.go:155–161  ·  view source on GitHub ↗
(ctx context.Context, ns, cluster string)

Source from the content-addressed store, hash-verified

153}
154
155func (s *ClusterStore) GetCluster(ctx context.Context, ns, cluster string) (*Cluster, error) {
156 lock := s.getLock(ns, cluster)
157 lock.RLock()
158 defer lock.RUnlock()
159
160 return s.getClusterWithoutLock(ctx, ns, cluster)
161}
162
163func (s *ClusterStore) getClusterWithoutLock(ctx context.Context, ns, cluster string) (*Cluster, error) {
164 value, err := s.e.Get(ctx, buildClusterKey(ns, cluster))

Callers 3

CheckNewNodesMethod · 0.95
TestClusterStoreFunction · 0.95
TestClusterMigrateDataFunction · 0.95

Calls 2

getLockMethod · 0.95
getClusterWithoutLockMethod · 0.95

Tested by 2

TestClusterStoreFunction · 0.76
TestClusterMigrateDataFunction · 0.76