Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify querier merge code #620

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Simplify querier merge code #620

wants to merge 1 commit into from

Conversation

yeya24
Copy link
Owner

@yeya24 yeya24 commented Mar 15, 2024

What this PR does:

Replaces querier.mergeSeriesSets with storage.NewMergeSeriesSet(result, storage.ChainedSeriesMerge) because basically they do the same thing.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@yeya24 yeya24 force-pushed the querier-merge-simplify branch from b21f293 to b632f04 Compare March 15, 2024 17:53
serieses = append(serieses, &storage.SeriesEntry{
Lset: ls,
SampleIteratorFn: func(iterator chunkenc.Iterator) chunkenc.Iterator {
return q.chunkIterFn(chunks, model.Time(minT), model.Time(maxT))
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also thinking about getting rid of this chunkIterFn completely so that we can remove a ton of code and just reuse upstream interfaces. It makes so much easier to support native histograms.

But this breaks the batch iterator we have.

		iterables := make([]chunkenc.Iterable, len(chunks))
		serieses = append(serieses, &storage.SeriesEntry{
			Lset: ls,
			SampleIteratorFn: func(iterator chunkenc.Iterator) chunkenc.Iterator {
				for i, c := range chunks {
					iterables[i] = c.Data.SampleIterable()
				}
				return storage.ChainSampleIteratorFromIterables(iterator, iterables)
			},
		})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant