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

Function readPostingListFromDisk

worker/sort_test.go:24–37  ·  view source on GitHub ↗
(key []byte, pstore *badger.DB, readTs uint64)

Source from the content-addressed store, hash-verified

22)
23
24func readPostingListFromDisk(key []byte, pstore *badger.DB, readTs uint64) (*posting.List, error) {
25 txn := pstore.NewTransactionAt(readTs, false)
26 defer txn.Discard()
27
28 // When we do rollups, an older version would go to the top of the LSM tree, which can cause
29 // issues during txn.Get. Therefore, always iterate.
30 iterOpts := badger.DefaultIteratorOptions
31 iterOpts.AllVersions = true
32 iterOpts.PrefetchValues = false
33 itr := txn.NewKeyIterator(key, iterOpts)
34 defer itr.Close()
35 itr.Seek(key)
36 return posting.ReadPostingList(key, itr)
37}
38
39func rollup(t *testing.T, key []byte, pstore *badger.DB, readTs uint64) {
40 ol, err := readPostingListFromDisk(key, pstore, readTs)

Callers 2

rollupFunction · 0.70
TestLangExactFunction · 0.70

Calls 3

ReadPostingListFunction · 0.92
SeekMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected