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

Function newEncoder

query/outputnode.go:125–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123var nodeSize = int(unsafe.Sizeof(node{}))
124
125func newEncoder() *encoder {
126 idSlice := make([]string, 1)
127
128 a := (arenaPool.Get()).(*arena)
129 a.reset()
130
131 e := &encoder{
132 attrMap: make(map[string]uint16),
133 idSlice: idSlice,
134 arena: a,
135 alloc: z.NewAllocator(4<<10, "OutputNode.Encoder"),
136 buf: &bytes.Buffer{},
137 }
138 e.uidAttr = e.idForAttr("uid")
139 return e
140}
141
142// Sort the given fastJson list
143func (enc *encoder) MergeSort(headRef *fastJsonNode) {

Callers 8

TestEncodeFunction · 0.85
toFastJSONMethod · 0.85
TestEncodeMemoryFunction · 0.85
TestNormalizeJSONLimitFunction · 0.85
TestFastJsonNodeFunction · 0.85
TestChildrenOrderFunction · 0.85

Calls 3

idForAttrMethod · 0.95
GetMethod · 0.65
resetMethod · 0.45

Tested by 7

TestEncodeFunction · 0.68
TestEncodeMemoryFunction · 0.68
TestNormalizeJSONLimitFunction · 0.68
TestFastJsonNodeFunction · 0.68
TestChildrenOrderFunction · 0.68