rename mts to intvlGroups

Signed-off-by: codwu <wuhan9087@163.com>
This commit is contained in:
codwu 2018-07-10 21:24:13 +08:00
parent e4444ca48c
commit bc6ef0b94e
2 changed files with 7 additions and 7 deletions

View File

@ -557,7 +557,7 @@ func TestBlockQuerierDelete(t *testing.T) {
},
},
},
tombstones: &memTombstones{mts: map[uint64]Intervals{
tombstones: &memTombstones{intvlGroups: map[uint64]Intervals{
1: Intervals{{1, 3}},
2: Intervals{{1, 3}, {6, 10}},
3: Intervals{{6, 10}},

View File

@ -157,24 +157,24 @@ func readTombstones(dir string) (*memTombstones, error) {
}
type memTombstones struct {
mts map[uint64]Intervals
mtx sync.RWMutex
intvlGroups map[uint64]Intervals
mtx sync.RWMutex
}
func NewMemTombstones() *memTombstones {
return &memTombstones{mts: make(map[uint64]Intervals)}
return &memTombstones{intvlGroups: make(map[uint64]Intervals)}
}
func (t *memTombstones) Get(ref uint64) (Intervals, error) {
t.mtx.RLock()
defer t.mtx.RUnlock()
return t.mts[ref], nil
return t.intvlGroups[ref], nil
}
func (t *memTombstones) Iter(f func(uint64, Intervals) error) error {
t.mtx.RLock()
defer t.mtx.RUnlock()
for ref, ivs := range t.mts {
for ref, ivs := range t.intvlGroups {
if err := f(ref, ivs); err != nil {
return err
}
@ -187,7 +187,7 @@ func (t *memTombstones) addInterval(ref uint64, itvs ...Interval) {
t.mtx.Lock()
defer t.mtx.Unlock()
for _, itv := range itvs {
t.mts[ref] = t.mts[ref].add(itv)
t.intvlGroups[ref] = t.intvlGroups[ref].add(itv)
}
}