chainSampleIterator is responsible to iterate over samples from different iterators of the same time series in timestamps order. If one or more samples overlap, one sample from random overlapped ones is kept and all others with the same timestamp are dropped. It's optimized for non-overlap cases as
| 474 | // order. If one or more samples overlap, one sample from random overlapped ones is kept and all others with the same |
| 475 | // timestamp are dropped. It's optimized for non-overlap cases as well. |
| 476 | type chainSampleIterator struct { |
| 477 | iterators []chunkenc.Iterator |
| 478 | h samplesIteratorHeap |
| 479 | |
| 480 | curr chunkenc.Iterator |
| 481 | lastT int64 |
| 482 | |
| 483 | // Whether the previous and the current sample are direct neighbors |
| 484 | // within the same base iterator. |
| 485 | consecutive bool |
| 486 | } |
| 487 | |
| 488 | // Return a chainSampleIterator initialized for length entries, re-using the memory from it if possible. |
| 489 | func getChainSampleIterator(it chunkenc.Iterator, length int) *chainSampleIterator { |
nothing calls this directly
no outgoing calls
no test coverage detected