prometheus/tsdb/chunkenc
Fiona Liao 5bee0cfce2
Change ChunkReader.Chunk() to ChunkOrIterable()
The ChunkReader interface's Chunk() has been changed to ChunkOrIterable(). 

This is a precursor to OOO native histogram support - with OOO native histograms, the chunks.Meta passed to Chunk() can result in multiple chunks being returned rather than just a single chunk (e.g. if oooMergedChunk has a counter reset in the middle). 

To support this, ChunkOrIterable() requires either a single chunk or an iterable to be returned. If an iterable is returned, the caller has the responsibility of converting the samples from the iterable into possibly multiple chunks. The OOOHeadChunkReader now returns an iterable rather than a chunk to prepare for the native histograms case. Also as a beneficial side effect, oooMergedChunk and boundedChunk has been simplified as they only need to implement the Iterable interface now, not the full Chunk interface.

---------

Signed-off-by: Fiona Liao <fiona.y.liao@gmail.com>
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
2023-11-28 11:14:29 +01:00
..
bstream.go enable gocritic, unconvert and unused linters 2023-04-13 19:20:22 +00:00
bstream_test.go Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
chunk.go Change ChunkReader.Chunk() to ChunkOrIterable() 2023-11-28 11:14:29 +01:00
chunk_test.go tsdb: Rework iterators (#9877) 2021-11-29 13:24:23 +05:30
float_histogram.go ci(lint): enable nolintlint and remove redundant comments (#12926) 2023-10-31 12:35:13 +01:00
float_histogram_test.go ci(lint): enable nolintlint and remove redundant comments (#12926) 2023-10-31 12:35:13 +01:00
histogram.go ci(lint): enable nolintlint and remove redundant comments (#12926) 2023-10-31 12:35:13 +01:00
histogram_meta.go ci(lint): enable godot; append dot at the end of comments 2023-10-31 19:53:38 +02:00
histogram_meta_test.go histograms: General readability tweaks 2023-01-19 13:26:42 +01:00
histogram_test.go ci(lint): enable nolintlint and remove redundant comments (#12926) 2023-10-31 12:35:13 +01:00
varbit.go tsdb/chunkenc: use Go standard errors package 2023-11-08 08:38:57 +00:00
varbit_test.go Use more varbit in histogram chunks 2021-10-13 20:03:35 +02:00
xor.go ci(lint): enable nolintlint and remove redundant comments (#12926) 2023-10-31 12:35:13 +01:00
xor_test.go chunkenc: Slightly optimize xorWrite/xoRead (#11476) 2022-10-20 15:08:01 +05:30