MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / SetNodeEx

Method SetNodeEx

cmd/cqld/adapter.go:155–173  ·  view source on GitHub ↗

SetNodeEx is used by gossip service to broadcast to other nodes.

(node *proto.Node, ttl uint32, origin proto.NodeID)

Source from the content-addressed store, hash-verified

153
154// SetNodeEx is used by gossip service to broadcast to other nodes.
155func (s *KVServer) SetNodeEx(node *proto.Node, ttl uint32, origin proto.NodeID) (err error) {
156 log.WithFields(log.Fields{
157 "node": node.ID,
158 "ttl": ttl,
159 "origin": origin,
160 }).Debug("update node to kv storage")
161
162 // set local
163 if err = s.storage.SetNode(node); err != nil {
164 err = errors.Wrap(err, "set node failed")
165 return
166 }
167
168 if ttl > 0 {
169 s.nonBlockingSync(node, origin, ttl-1)
170 }
171
172 return
173}
174
175// DelNode implements consistent.Persistence.
176func (s *KVServer) DelNode(nodeID proto.NodeID) (err error) {

Callers 2

SetNodeMethod · 0.95
SetNodeMethod · 0.80

Calls 4

nonBlockingSyncMethod · 0.95
WithFieldsFunction · 0.92
DebugMethod · 0.80
SetNodeMethod · 0.65

Tested by

no test coverage detected