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

Function createValueEdge

dgraph/cmd/live/batch.go:217–233  ·  view source on GitHub ↗
(nq *api.NQuad, sid uint64)

Source from the content-addressed store, hash-verified

215}
216
217func createValueEdge(nq *api.NQuad, sid uint64) (*pb.DirectedEdge, error) {
218 p := &pb.DirectedEdge{
219 Entity: sid,
220 Attr: nq.Predicate,
221 Namespace: nq.Namespace,
222 Lang: nq.Lang,
223 Facets: nq.Facets,
224 }
225 val, err := getTypeVal(nq.ObjectValue)
226 if err != nil {
227 return p, err
228 }
229
230 p.Value = val.Value.([]byte)
231 p.ValueType = val.Tid.Enum()
232 return p, nil
233}
234
235func fingerprintEdge(t *pb.DirectedEdge, pred *Predicate) uint64 {
236 var id uint64 = math.MaxUint64

Callers 1

conflictKeysForNQuadMethod · 0.85

Calls 2

getTypeValFunction · 0.85
EnumMethod · 0.45

Tested by

no test coverage detected