Documentation ¶
Index ¶
- Variables
- func DoParallelQueries(ctx context.Context, doSingleQuery DoSingleQuery, queries []chunk.IndexQuery, ...) error
- func EnsureDirectory(dir string) error
- func GetParallelChunks(ctx context.Context, chunks []chunk.Chunk, ...) ([]chunk.Chunk, error)
- func NewReadCloserWithContextCancelFunc(readCloser io.ReadCloser, cancel context.CancelFunc) io.ReadCloser
- type Callback
- type DoSingleQuery
- type ReadCloserWithContextCancelFunc
Constants ¶
This section is empty.
Variables ¶
var QueryParallelism = 100
QueryParallelism is the maximum number of subqueries run in parallel per higher-level query
Functions ¶
func DoParallelQueries ¶
func DoParallelQueries( ctx context.Context, doSingleQuery DoSingleQuery, queries []chunk.IndexQuery, callback Callback, ) error
DoParallelQueries translates between our interface for query batching, and indexes that don't yet support batching.
func EnsureDirectory ¶ added in v0.7.0
EnsureDirectory makes sure directory is there, if not creates it if not
func GetParallelChunks ¶
func GetParallelChunks(ctx context.Context, chunks []chunk.Chunk, f func(context.Context, *chunk.DecodeContext, chunk.Chunk) (chunk.Chunk, error)) ([]chunk.Chunk, error)
GetParallelChunks fetches chunks in parallel (up to maxParallel).
func NewReadCloserWithContextCancelFunc ¶ added in v1.5.0
func NewReadCloserWithContextCancelFunc(readCloser io.ReadCloser, cancel context.CancelFunc) io.ReadCloser
Types ¶
type Callback ¶
type Callback func(chunk.IndexQuery, chunk.ReadBatch) bool
Callback from an IndexQuery.
func QueryFilter ¶
QueryFilter wraps a callback to ensure the results are filtered correctly; useful for the cache and Bigtable backend, which only ever fetches the whole row.
type DoSingleQuery ¶
DoSingleQuery is the interface for indexes that don't support batching yet.
type ReadCloserWithContextCancelFunc ¶ added in v1.5.0
type ReadCloserWithContextCancelFunc struct { io.ReadCloser // contains filtered or unexported fields }
ReadCloserWithContextCancelFunc helps with cancelling the context when closing a ReadCloser. NOTE: The consumer of ReadCloserWithContextCancelFunc should always call the Close method when it is done reading which otherwise could cause a resource leak.
func (ReadCloserWithContextCancelFunc) Close ¶ added in v1.5.0
func (r ReadCloserWithContextCancelFunc) Close() error