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

Function fetchValue

worker/sort.go:824–843  ·  view source on GitHub ↗

fetchValue gets the value for a given UID.

(uid uint64, attr string, langs []string, scalar types.TypeID,
	readTs uint64)

Source from the content-addressed store, hash-verified

822
823// fetchValue gets the value for a given UID.
824func fetchValue(uid uint64, attr string, langs []string, scalar types.TypeID,
825 readTs uint64) (types.Val, error) {
826 // Don't put the values in memory
827 pl, err := posting.GetNoStore(x.DataKey(attr, uid), readTs)
828 if err != nil {
829 return types.Val{}, err
830 }
831
832 src, err := pl.ValueFor(readTs, langs)
833
834 if err != nil {
835 return types.Val{}, err
836 }
837 dst, err := types.Convert(src, scalar)
838 if err != nil {
839 return types.Val{}, err
840 }
841
842 return dst, nil
843}

Callers 1

sortByValueFunction · 0.85

Calls 4

GetNoStoreFunction · 0.92
DataKeyFunction · 0.92
ConvertFunction · 0.92
ValueForMethod · 0.80

Tested by

no test coverage detected