MCPcopy
hub / github.com/NVIDIA/aistore / joinCluster

Method joinCluster

ais/proxy.go:237–257  ·  view source on GitHub ↗
(action string, primaryURLs ...string)

Source from the content-addressed store, hash-verified

235}
236
237func (p *proxy) joinCluster(action string, primaryURLs ...string) (status int, err error) {
238 var query url.Values
239 if smap := p.owner.smap.get(); smap.isPrimary(p.si) {
240 return 0, fmt.Errorf("%s should not be joining: is primary, %s", p, smap.StringEx())
241 }
242 if cmn.GCO.Get().Proxy.NonElectable {
243 query = url.Values{apc.QparamNonElectable: []string{"true"}}
244 }
245 res := p.join(query, primaryURLs...)
246 defer freeCR(res)
247 if res.err != nil {
248 status, err = res.status, res.err
249 return
250 }
251 // not being sent at cluster startup and keepalive
252 if len(res.bytes) == 0 {
253 return
254 }
255 err = p.recvCluMetaBytes(action, res.bytes, "")
256 return
257}
258
259func (p *proxy) recvCluMetaBytes(action string, body []byte, caller string) error {
260 var cm cluMeta

Callers 1

secondaryStartupMethod · 0.95

Calls 7

recvCluMetaBytesMethod · 0.95
freeCRFunction · 0.85
joinMethod · 0.80
getMethod · 0.65
GetMethod · 0.65
isPrimaryMethod · 0.45
StringExMethod · 0.45

Tested by

no test coverage detected