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

Method Peer

conn/node.go:223–228  ·  view source on GitHub ↗

Peer returns the address of the peer with the given id.

(pid uint64)

Source from the content-addressed store, hash-verified

221
222// Peer returns the address of the peer with the given id.
223func (n *Node) Peer(pid uint64) (string, bool) {
224 n.RLock()
225 defer n.RUnlock()
226 addr, ok := n.peers[pid]
227 return addr, ok
228}
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) {

Callers 6

doSendMessageMethod · 0.95
ConnectMethod · 0.95
ProposePeerRemovalMethod · 0.95
joinClusterMethod · 0.95
applyStateMethod · 0.80

Calls 2

RLockMethod · 0.80
RUnlockMethod · 0.80

Tested by

no test coverage detected