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

Function _joinCluster

devtools/tutils/node.go:704–721  ·  view source on GitHub ↗

formerly, devtools

(ctx *Ctx, proxyURL string, node *cluster.Snode, timeout time.Duration)

Source from the content-addressed store, hash-verified

702// formerly, devtools
703//
704func _joinCluster(ctx *Ctx, proxyURL string, node *cluster.Snode, timeout time.Duration) (rebID string, err error) {
705 baseParams := api.BaseParams{Client: ctx.Client, URL: proxyURL, Token: LoggedUserToken}
706 smap, err := api.GetClusterMap(baseParams)
707 if err != nil {
708 return "", err
709 }
710 if rebID, _, err = api.JoinCluster(baseParams, node); err != nil {
711 return
712 }
713
714 // If node is already in cluster we should not wait for map version
715 // sync because update will not be scheduled
716 if node := smap.GetNode(node.ID()); node == nil {
717 err = _waitMapVersionSync(baseParams, ctx, time.Now().Add(timeout), smap, smap.Version, cos.NewStringSet())
718 return
719 }
720 return
721}
722
723func _nextNode(smap *cluster.Smap, idsToIgnore cos.StringSet) (string, string, bool) {
724 for _, d := range smap.Pmap {

Callers 1

JoinClusterFunction · 0.85

Calls 7

GetClusterMapFunction · 0.92
JoinClusterFunction · 0.92
NewStringSetFunction · 0.92
_waitMapVersionSyncFunction · 0.85
GetNodeMethod · 0.80
IDMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected