Skip to content

Commit 7347d45

Browse files
committed
fixes merge conflicts
Signed-off-by: Owen Diehl <[email protected]>
1 parent a4dcfff commit 7347d45

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

pkg/querier/block.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/weaveworks/common/user"
1919
"google.golang.org/grpc/metadata"
2020

21+
"github.com/cortexproject/cortex/pkg/querier/series"
2122
"github.com/cortexproject/cortex/pkg/storage/tsdb"
2223
"github.com/cortexproject/cortex/pkg/util"
2324
"github.com/cortexproject/cortex/pkg/util/spanlogger"
@@ -244,15 +245,15 @@ func (bqs *blockQuerierSeries) Labels() labels.Labels {
244245
func (bqs *blockQuerierSeries) Iterator() storage.SeriesIterator {
245246
if len(bqs.chunks) == 0 {
246247
// should not happen in practice, but we have a unit test for it
247-
return errIterator{err: errors.New("no chunks")}
248+
return series.NewErrIterator(errors.New("no chunks"))
248249
}
249250

250251
its := make([]chunkenc.Iterator, 0, len(bqs.chunks))
251252

252253
for _, c := range bqs.chunks {
253254
ch, err := chunkenc.FromData(chunkenc.EncXOR, c.Raw.Data)
254255
if err != nil {
255-
return errIterator{err: errors.Wrapf(err, "failed to initialize chunk from XOR encoded raw data (series: %v min time: %d max time: %d)", bqs.Labels(), c.MinTime, c.MaxTime)}
256+
return series.NewErrIterator(errors.Wrapf(err, "failed to initialize chunk from XOR encoded raw data (series: %v min time: %d max time: %d)", bqs.Labels(), c.MinTime, c.MaxTime))
256257
}
257258

258259
it := ch.Iterator(nil)

pkg/querier/distributor_queryable.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (q *distributorQuerier) Select(sp *storage.SelectParams, matchers ...*label
5555
if err != nil {
5656
return nil, nil, err
5757
}
58-
return metricsToSeriesSet(ms), nil, nil
58+
return series.MetricsToSeriesSet(ms), nil, nil
5959
}
6060

6161
mint, maxt := sp.Start, sp.End
@@ -108,7 +108,7 @@ func (q *distributorQuerier) streamingSelect(sp storage.SelectParams, matchers [
108108
serieses = append(serieses, series)
109109
}
110110

111-
return newConcreteSeriesSet(serieses), nil, nil
111+
return series.NewConcreteSeriesSet(serieses), nil, nil
112112
}
113113

114114
func (q *distributorQuerier) LabelValues(name string) ([]string, storage.Warnings, error) {

pkg/querier/lazyquery/lazyquery.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ func (l LazyQuerier) Get(ctx context.Context, userID string, from, through model
8686
return store.Get(ctx, userID, from, through, matchers...)
8787
}
8888

89+
func NewErrSeriesSet(err error) storage.SeriesSet {
90+
return errSeriesSet{err}
91+
}
92+
8993
// errSeriesSet implements storage.SeriesSet, just returning an error.
9094
type errSeriesSet struct {
9195
err error

pkg/querier/querier.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
"github.com/cortexproject/cortex/pkg/chunk"
1616
"github.com/cortexproject/cortex/pkg/querier/batch"
17+
"github.com/cortexproject/cortex/pkg/querier/chunkstore"
1718
"github.com/cortexproject/cortex/pkg/querier/iterators"
1819
"github.com/cortexproject/cortex/pkg/querier/lazyquery"
1920
"github.com/cortexproject/cortex/pkg/util"
@@ -84,7 +85,7 @@ func getChunksIteratorFunction(cfg Config) chunkIteratorFunc {
8485
return mergeChunks
8586
}
8687

87-
func NewChunkStoreQueryable(cfg Config, chunkStore ChunkStore) storage.Queryable {
88+
func NewChunkStoreQueryable(cfg Config, chunkStore chunkstore.ChunkStore) storage.Queryable {
8889
return newChunkStoreQueryable(chunkStore, getChunksIteratorFunction(cfg))
8990
}
9091

@@ -234,7 +235,7 @@ func (q querier) mergeSeriesSets(sets []storage.SeriesSet) storage.SeriesSet {
234235
// If there is error, we better report it.
235236
err := set.Err()
236237
if err != nil {
237-
otherSets = append(otherSets, errSeriesSet{err: err})
238+
otherSets = append(otherSets, lazyquery.NewErrSeriesSet(err))
238239
}
239240
continue
240241
}

0 commit comments

Comments
 (0)