Expose a Querier with manually passed in readers.

Allows people to not copy the querying code.

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
pull/5805/head
Goutham Veeramachaneni 8 years ago
parent 7438ed7035
commit 5b242f35ba
  1. 12
      querier.go

@ -128,6 +128,18 @@ func (q *querier) Close() error {
return merr.Err()
}
// NewBlockQuerier returns a queries against the readers.
func NewBlockQuerier(ir IndexReader, cr ChunkReader, tr TombstoneReader, mint, maxt int64) Querier {
return &blockQuerier{
index: ir,
chunks: cr,
tombstones: tr,
mint: mint,
maxt: maxt,
}
}
// blockQuerier provides querying access to a single block database.
type blockQuerier struct {
index IndexReader

Loading…
Cancel
Save