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

Method SetPeer

conn/node.go:231–236  ·  view source on GitHub ↗

SetPeer sets the address of the peer with the given id. The address must not be empty.

(pid uint64, addr string)

Source from the content-addressed store, hash-verified

229
230// SetPeer sets the address of the peer with the given id. The address must not be empty.
231func (n *Node) SetPeer(pid uint64, addr string) {
232 x.AssertTruef(addr != "", "SetPeer for peer %d has empty addr.", pid)
233 n.Lock()
234 defer n.Unlock()
235 n.peers[pid] = addr
236}
237
238// Send sends the given RAFT message from this node.
239func (n *Node) Send(msg *raftpb.Message) {

Callers 1

ConnectMethod · 0.95

Calls 3

AssertTruefFunction · 0.92
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected