buildL0Table builds a new table from the memtable.
(ft flushTask, bopts table.Options)
| 970 | |
| 971 | // buildL0Table builds a new table from the memtable. |
| 972 | func buildL0Table(ft flushTask, bopts table.Options) []byte { |
| 973 | iter := ft.mt.NewIterator() |
| 974 | defer iter.Close() |
| 975 | b := table.NewTableBuilder(bopts) |
| 976 | defer b.Close() |
| 977 | var vp valuePointer |
| 978 | for iter.SeekToFirst(); iter.Valid(); iter.Next() { |
| 979 | if len(ft.dropPrefixes) > 0 && hasAnyPrefixes(iter.Key(), ft.dropPrefixes) { |
| 980 | continue |
| 981 | } |
| 982 | vs := iter.Value() |
| 983 | if vs.Meta&bitValuePointer > 0 { |
| 984 | vp.Decode(vs.Value) |
| 985 | } |
| 986 | b.Add(iter.Key(), iter.Value(), vp.Len) |
| 987 | } |
| 988 | return b.Finish() |
| 989 | } |
| 990 | |
| 991 | type flushTask struct { |
| 992 | mt *skl.Skiplist |
no test coverage detected
searching dependent graphs…