Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Commit

Permalink
Return not implemented error on vertical iterators for not used chunk…
Browse files Browse the repository at this point in the history
… method.

Signed-off-by: Bartek Plotka <[email protected]>
  • Loading branch information
bwplotka committed Aug 1, 2019
1 parent 4ed00e1 commit d097d3f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,12 +990,10 @@ func (s *verticalChainedSeries) Iterator() SeriesIterator {
return newVerticalMergeSeriesIterator(s.series...)
}

// ChunkIterator is currently not implemented.
// TODO(bwplotka): Implement once we will want to use chunks in vertical compaction.
func (s *verticalChainedSeries) ChunkIterator() ChunkIterator {
ch := &chainedChunkIterator{chain: make([]ChunkIterator, 0, len(s.series))}
for _, s := range s.series {
ch.chain = append(ch.chain, s.ChunkIterator())
}
return ch
return errChunkIterator{err: errors.New("Not Implemented")}
}

// verticalMergeSeriesIterator implements a series iterater over a list
Expand Down Expand Up @@ -1244,6 +1242,14 @@ type ChunkIterator interface {
Err() error
}

type errChunkIterator struct {
err error
}

func (s errChunkIterator) Next() bool { return false }
func (s errChunkIterator) At() chunks.Meta { return chunks.Meta{} }
func (s errChunkIterator) Err() error { return s.err }

type chunkIterator struct {
chunks []chunks.Meta // series in time order
i int
Expand Down

0 comments on commit d097d3f

Please sign in to comment.