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

Function PopulateList

posting/size_test.go:104–129  ·  view source on GitHub ↗

run this test manually for the verfication.

(l *List, t *testing.T)

Source from the content-addressed store, hash-verified

102
103// run this test manually for the verfication.
104func PopulateList(l *List, t *testing.T) {
105 kvOpt := badger.DefaultOptions("p")
106 ps, err := badger.OpenManaged(kvOpt)
107 require.NoError(t, err)
108 txn := ps.NewTransactionAt(math.MaxUint64, false)
109 defer txn.Discard()
110 iopts := badger.DefaultIteratorOptions
111 iopts.AllVersions = true
112 iopts.PrefetchValues = false
113 itr := txn.NewIterator(iopts)
114 defer itr.Close()
115 var i uint64
116 for itr.Rewind(); itr.Valid(); itr.Next() {
117 item := itr.Item()
118 if item.ValueSize() < 512 || item.UserMeta() == BitSchemaPosting {
119 continue
120 }
121 pl, err := ReadPostingList(item.Key(), itr)
122 if err == ErrInvalidKey {
123 continue
124 }
125 require.NoError(t, err)
126 l.mutationMap.committedEntries[i] = pl.plist
127 i++
128 }
129}
130
131// Test21MillionDataSet populate the list and do size calculation and profiling
132// size calculation and write it to file.

Callers 1

Test21MillionDataSetFunction · 0.85

Calls 7

ReadPostingListFunction · 0.85
NewIteratorMethod · 0.80
ValidMethod · 0.80
ItemMethod · 0.80
CloseMethod · 0.65
NextMethod · 0.45
KeyMethod · 0.45

Tested by

no test coverage detected