MCPcopy
hub / github.com/google/seesaw / ClusterStatus

Method ClusterStatus

engine/ipc.go:216–241  ·  view source on GitHub ↗

ClusterStatus returns status information about this Seesaw Cluster.

(ctx *ipc.Context, reply *seesaw.ClusterStatus)

Source from the content-addressed store, hash-verified

214
215// ClusterStatus returns status information about this Seesaw Cluster.
216func (s *SeesawEngine) ClusterStatus(ctx *ipc.Context, reply *seesaw.ClusterStatus) error {
217 s.trace("ClusterStatus", ctx)
218 if ctx == nil {
219 return errContext
220 }
221
222 if !ctx.CanRead() {
223 return errAccess
224 }
225
226 s.engine.clusterLock.RLock()
227 cluster := s.engine.cluster
228 s.engine.clusterLock.RUnlock()
229
230 if cluster == nil {
231 return errors.New("no cluster configuration loaded")
232 }
233
234 reply.Version = seesaw.SeesawVersion
235 reply.Site = cluster.Site
236 reply.Nodes = make([]*seesaw.Node, 0, len(cluster.Nodes))
237 for _, node := range cluster.Nodes {
238 reply.Nodes = append(reply.Nodes, node.Clone())
239 }
240 return nil
241}
242
243// ConfigStatus returns status information about this Seesaw's current configuration.
244func (s *SeesawEngine) ConfigStatus(ctx *ipc.Context, reply *seesaw.ConfigStatus) error {

Callers

nothing calls this directly

Calls 3

traceMethod · 0.95
CanReadMethod · 0.80
CloneMethod · 0.45

Tested by

no test coverage detected