MCPcopy
hub / github.com/dgraph-io/dgraph / SetZeroMyAddr

Method SetZeroMyAddr

dgraphtest/local_cluster.go:631–637  ·  view source on GitHub ↗

SetZeroMyAddr overrides the --my flag for the specified Zero node. The next time the container is recreated (via RecreateZero), this address will be used instead of the default container alias.

(id int, addr string)

Source from the content-addressed store, hash-verified

629// time the container is recreated (via RecreateZero), this address will be
630// used instead of the default container alias.
631func (c *LocalCluster) SetZeroMyAddr(id int, addr string) error {
632 if id >= c.conf.numZeros {
633 return fmt.Errorf("invalid id of zero: %v", id)
634 }
635 c.zeros[id].myAddrOverride = addr
636 return nil
637}
638
639// RecreateZero destroys the Zero container and creates a new one with the
640// current command-line flags (e.g. a different --my address). The Zero's data

Callers 3

ChangeZeroAddressMethod · 0.95

Calls 1

ErrorfMethod · 0.45

Tested by 2