prometheus/storage/remote
Bartlomiej Plotka d5c33877f9
storage: Added Chunks{Queryable/Querier/SeriesSet/Series/Iteratable. Added generic Merge{SeriesSet/Querier} implementation. (#7005)
* storage: Added Chunks{Queryable/Querier/SeriesSet/Series/Iteratable. Added generic Merge{SeriesSet/Querier} implementation.

## Rationales:

In many places (e.g. chunk Remote read, Thanos Receive fetching chunk from TSDB), we operate on encoded chunks not samples.
This means that we unnecessary decode/encode, wasting CPU, time and memory.
This PR adds chunk iterator interfaces and makes the merge code to be reused between both seriesSets

I will make the use of it in following PR inside tsdb itself. For now fanout implements it and mergers.

All merges now also allows passing series mergers. This opens doors for custom deduplications other than TSDB vertical ones (e.g. offline one we have in Thanos).

## Changes

* Added Chunk versions of all iterating methods. It all starts in Querier/ChunkQuerier. The plan is that
Storage will implement both chunked and samples.
* Added Seek to chunks.Iterator interface for iterating over chunks.
* NewMergeChunkQuerier was added; Both this and NewMergeQuerier are now using generigMergeQuerier to share the code. Generic code was added.
* Improved tests.
* Added some TODO for further simplifications in next PRs.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Addressed Brian's comments.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Moved s/Labeled/SeriesLabels as per Krasi suggestion.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Addressed Krasi's comments.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Second iteration of Krasi comments.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>

* Another round of comments.

Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
2020-03-24 20:15:47 +00:00
..
chunked_test.go remote-read: streamed chunked server side; Extended protobuf; Added chunked, checksumed reader (#5703) 2019-08-19 21:16:10 +01:00
chunked.go remote-read: streamed chunked server side; Extended protobuf; Added chunked, checksumed reader (#5703) 2019-08-19 21:16:10 +01:00
client_test.go Improve testutil.ErrorEqual (#6471) 2019-12-17 21:11:33 +00:00
client.go Make remote client Store use passed context (#6673) 2020-01-27 07:43:20 -07:00
codec_test.go storage: Removed SelectSorted method; Simplified interface; Added requirement for remote read to sort response. 2020-03-20 21:14:43 +01:00
codec.go storage: Removed SelectSorted method; Simplified interface; Added requirement for remote read to sort response. 2020-03-20 21:14:43 +01:00
ewma.go Merge the 2.13 release branch to master (#6117) 2019-10-09 17:41:46 +02:00
intern_test.go Fix order of testutil.Equals (#6695) 2020-01-27 12:21:59 +00:00
intern.go Merge the 2.13 release branch to master (#6117) 2019-10-09 17:41:46 +02:00
max_gauge.go resolve race condition in maxGauge (#5647) 2019-06-13 20:55:08 +01:00
queue_manager_test.go Fix bug with WAL watcher and Live Reader metrics usage. (#6998) 2020-03-20 17:34:15 +01:00
queue_manager.go Fix bug with WAL watcher and Live Reader metrics usage. (#6998) 2020-03-20 17:34:15 +01:00
read_test.go storage: Removed SelectSorted method; Simplified interface; Added requirement for remote read to sort response. 2020-03-20 21:14:43 +01:00
read.go storage: Removed SelectSorted method; Simplified interface; Added requirement for remote read to sort response. 2020-03-20 21:14:43 +01:00
storage_test.go pass registerer from storage to queue manager for its metrics (#6728) 2020-02-03 13:47:03 -08:00
storage.go storage: Added Chunks{Queryable/Querier/SeriesSet/Series/Iteratable. Added generic Merge{SeriesSet/Querier} implementation. (#7005) 2020-03-24 20:15:47 +00:00
write_test.go pass registerer from storage to queue manager for its metrics (#6728) 2020-02-03 13:47:03 -08:00
write.go Fix bug with WAL watcher and Live Reader metrics usage. (#6998) 2020-03-20 17:34:15 +01:00