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

Function New

controller/controller.go:56–66  ·  view source on GitHub ↗
(s *store.ClusterStore, config *config.ControllerConfig)

Source from the content-addressed store, hash-verified

54}
55
56func New(s *store.ClusterStore, config *config.ControllerConfig) (*Controller, error) {
57 c := &Controller{
58 config: config,
59 clusterStore: s,
60 clusters: make(map[string]*ClusterChecker),
61 readyCh: make(chan struct{}, 1),
62 closeCh: make(chan struct{}),
63 }
64 c.state.Store(stateInit)
65 return c, nil
66}
67
68func (c *Controller) Start(ctx context.Context) error {
69 if !c.state.CompareAndSwap(stateInit, stateRunning) {

Callers 4

NewServerFunction · 0.92
TestClusterFailoverFunction · 0.92
TestClusterMigrateDataFunction · 0.92
TestController_BasicsFunction · 0.70

Calls

no outgoing calls

Tested by 3

TestClusterFailoverFunction · 0.74
TestClusterMigrateDataFunction · 0.74
TestController_BasicsFunction · 0.56