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

Method newNode

query/outputnode.go:303–308  ·  view source on GitHub ↗

newNode returns a fastJsonNode with its attr set to attr, and all other meta set to their default value.

(attr uint16)

Source from the content-addressed store, hash-verified

301// newNode returns a fastJsonNode with its attr set to attr,
302// and all other meta set to their default value.
303func (enc *encoder) newNode(attr uint16) fastJsonNode {
304 b := enc.alloc.AllocateAligned(nodeSize)
305 n := (*node)(unsafe.Pointer(&b[0]))
306 enc.setAttr(n, attr)
307 return n
308}
309
310func (enc *encoder) setAttr(fj fastJsonNode, attr uint16) {
311 // There can be some cases where we change name of attr for fastJsoNode and

Callers 15

makeScalarNodeMethod · 0.95
makeUidNodeMethod · 0.95
makeCustomNodeMethod · 0.95
attachFacetsMethod · 0.95
copySingleNodeMethod · 0.95
TestEncodeFunction · 0.80
addGroupbyMethod · 0.80
addAggregationsMethod · 0.80
handleCountUIDNodesMethod · 0.80
processNodeUidsFunction · 0.80
toFastJSONMethod · 0.80
preTraverseMethod · 0.80

Calls 1

setAttrMethod · 0.95

Tested by 8

TestEncodeFunction · 0.64
TestEncodeMemoryFunction · 0.64
TestNormalizeJSONLimitFunction · 0.64
TestFastJsonNodeFunction · 0.64
buildTestTreeFunction · 0.64
TestChildrenOrderFunction · 0.64