prometheus/tsdb/chunks
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
..
chunk_write_queue.go Fix: getting rid of EncOOOXOR chunk encoding (#12111) 2023-03-16 15:53:47 +05:30
chunk_write_queue_test.go Fix: getting rid of EncOOOXOR chunk encoding (#12111) 2023-03-16 15:53:47 +05:30
chunks.go Change ChunkReader.Chunk() to ChunkOrIterable() 2023-11-28 11:14:29 +01:00
chunks_test.go Change ChunkReader.Chunk() to ChunkOrIterable() 2023-11-28 11:14:29 +01:00
head_chunks.go tsdb/chunk: use Go standard errors package 2023-11-08 09:19:44 +00:00
head_chunks_other.go tsdb/chunks: preallocate at least some space on non-Windows systems (#9581) 2021-11-09 13:47:00 +05:30
head_chunks_test.go Fix race condition in ChunkDiskMapper.Truncate() (#12500) 2023-06-30 18:29:59 +05:30
head_chunks_windows.go Format Go source files using 'gofumpt -w -s -extra' 2021-11-02 19:52:34 +01:00
queue.go Reduce chunk write queue memory usage 2 (#10874) 2022-06-29 17:51:27 +05:30
queue_test.go Reduce chunk write queue memory usage 2 (#10874) 2022-06-29 17:51:27 +05:30
samples.go Add a chunk size limit in bytes (#12054) 2023-08-24 15:21:17 +02:00