MCPcopy
hub / github.com/dgraph-io/badger / pickTable

Method pickTable

iterator.go:357–373  ·  view source on GitHub ↗
(t table.TableInterface)

Source from the content-addressed store, hash-verified

355}
356
357func (opt *IteratorOptions) pickTable(t table.TableInterface) bool {
358 if len(opt.Prefix) == 0 {
359 return true
360 }
361 if opt.compareToPrefix(t.Smallest()) > 0 {
362 return false
363 }
364 if opt.compareToPrefix(t.Biggest()) < 0 {
365 return false
366 }
367 // Bloom filter lookup would only work if opt.Prefix does NOT have the read
368 // timestamp as part of the key.
369 if opt.prefixIsKey && t.DoesNotHave(farm.Fingerprint64(opt.Prefix)) {
370 return false
371 }
372 return true
373}
374
375// pickTables picks the necessary table for the iterator. This function also assumes
376// that the tables are sorted in the right order.

Callers 2

TestPickTablesFunction · 0.80
appendIteratorsMethod · 0.80

Calls 4

compareToPrefixMethod · 0.95
SmallestMethod · 0.65
BiggestMethod · 0.65
DoesNotHaveMethod · 0.65

Tested by 1

TestPickTablesFunction · 0.64