MCPcopy Index your code
hub / github.com/dgraph-io/badger / sortTables

Method sortTables

level_handler.go:159–166  ·  view source on GitHub ↗

sortTables sorts tables of levelHandler based on table.Smallest. Normally it should be called after all addTable calls.

()

Source from the content-addressed store, hash-verified

157// sortTables sorts tables of levelHandler based on table.Smallest.
158// Normally it should be called after all addTable calls.
159func (s *levelHandler) sortTables() {
160 s.RLock()
161 defer s.RUnlock()
162
163 sort.Slice(s.tables, func(i, j int) bool {
164 return y.CompareKeys(s.tables[i].Smallest(), s.tables[j].Smallest()) < 0
165 })
166}
167
168func decrRefs(tables []*table.Table) error {
169 for _, table := range tables {

Callers 1

FlushMethod · 0.80

Calls 2

CompareKeysFunction · 0.92
SmallestMethod · 0.65

Tested by

no test coverage detected