From bc6ef0b94e0a58d302480550635a2d4e7c01bf78 Mon Sep 17 00:00:00 2001 From: codwu Date: Tue, 10 Jul 2018 21:24:13 +0800 Subject: [PATCH] rename `mts` to `intvlGroups` Signed-off-by: codwu --- querier_test.go | 2 +- tombstones.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/querier_test.go b/querier_test.go index d3ddec407..fd8c7dec5 100644 --- a/querier_test.go +++ b/querier_test.go @@ -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}}, diff --git a/tombstones.go b/tombstones.go index 03389de72..d4a3d0ef1 100644 --- a/tombstones.go +++ b/tombstones.go @@ -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) } }