Skip to content

Commit db6d7a9

Browse files
committed
rename method
Signed-off-by: Alan Protasio <[email protected]>
1 parent c4af0e4 commit db6d7a9

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

pkg/querier/batch/batch.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ type iterator interface {
4242
// AtTime returns the start time of the next batch. Must only be called after
4343
// Seek or Next have returned true.
4444
AtTime() int64
45-
MaxTime() int64
45+
46+
// MaxCurrentChunkTime returns the max time on the current chunk
47+
MaxCurrentChunkTime() int64
4648

4749
// Batch returns the current batch. Must only be called after Seek or Next
4850
// have returned true.
@@ -99,7 +101,7 @@ func (a *iteratorAdapter) Seek(t int64) bool {
99101
a.curr.Index++
100102
}
101103
return true
102-
} else if t <= a.underlying.MaxTime() {
104+
} else if t <= a.underlying.MaxCurrentChunkTime() {
103105
// In this case, some timestamp inside the current underlying chunk can fulfill the seek.
104106
// In this case we will call next until we find the sample as it will be faster than calling seek directly.
105107
for a.underlying.Next(promchunk.BatchSize) {

pkg/querier/batch/chunk.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func (i *chunkIterator) reset(chunk GenericChunk) {
2121
i.batch.Index = 0
2222
}
2323

24-
func (i *chunkIterator) MaxTime() int64 {
24+
func (i *chunkIterator) MaxCurrentChunkTime() int64 {
2525
return i.chunk.MaxTime
2626
}
2727

pkg/querier/batch/merge.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ type mergeIterator struct {
2121
currErr error
2222
}
2323

24-
func (c *mergeIterator) MaxTime() int64 {
24+
func (c *mergeIterator) MaxCurrentChunkTime() int64 {
2525
if len(c.h) < 1 {
2626
return -1
2727
}
2828

29-
return c.h[0].MaxTime()
29+
return c.h[0].MaxCurrentChunkTime()
3030
}
3131

3232
func newMergeIterator(cs []GenericChunk) *mergeIterator {

pkg/querier/batch/non_overlapping.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ func (it *nonOverlappingIterator) Seek(t int64, size int) bool {
3232
}
3333
}
3434

35-
func (it *nonOverlappingIterator) MaxTime() int64 {
36-
return it.iter.MaxTime()
35+
func (it *nonOverlappingIterator) MaxCurrentChunkTime() int64 {
36+
return it.iter.MaxCurrentChunkTime()
3737
}
3838

3939
func (it *nonOverlappingIterator) Next(size int) bool {

0 commit comments

Comments
 (0)