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

Method SetRaft

conn/node.go:166–171  ·  view source on GitHub ↗

SetRaft would set the provided raft.Node to this node. It would check fail if the node is already set.

(r raft.Node)

Source from the content-addressed store, hash-verified

164// SetRaft would set the provided raft.Node to this node.
165// It would check fail if the node is already set.
166func (n *Node) SetRaft(r raft.Node) {
167 n.Lock()
168 defer n.Unlock()
169 x.AssertTrue(n._raft == nil)
170 n._raft = r
171}
172
173// Raft would return back the raft.Node stored in the node.
174func (n *Node) Raft() raft.Node {

Callers 3

TestProposalFunction · 0.95
initAndStartNodeMethod · 0.80
InitAndStartNodeMethod · 0.80

Calls 3

AssertTrueFunction · 0.92
LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1

TestProposalFunction · 0.76