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

Method updateCluster

controller/controller.go:222–235  ·  view source on GitHub ↗
(namespace, clusterName string)

Source from the content-addressed store, hash-verified

220}
221
222func (c *Controller) updateCluster(namespace, clusterName string) {
223 key := c.buildClusterKey(namespace, clusterName)
224 c.mu.Lock()
225 cluster, ok := c.clusters[key]
226 c.mu.Unlock()
227 if !ok {
228 logger.Get().With(
229 zap.String("namespace", namespace),
230 zap.String("clusterName", clusterName),
231 ).Error("Cluster not found")
232 return
233 }
234 cluster.sendSyncEvent()
235}
236
237func (c *Controller) Close() {
238 if !c.state.CompareAndSwap(stateRunning, stateClosed) {

Callers 1

leaderEventLoopMethod · 0.95

Calls 5

buildClusterKeyMethod · 0.95
GetFunction · 0.92
ErrorMethod · 0.80
sendSyncEventMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected