NewQueryable creates a new Queryable for cortex.
(distributor QueryableWithFilter, stores []QueryableWithFilter, cfg Config, limits *validation.Overrides)
| 306 | |
| 307 | // NewQueryable creates a new Queryable for cortex. |
| 308 | func NewQueryable(distributor QueryableWithFilter, stores []QueryableWithFilter, cfg Config, limits *validation.Overrides) storage.Queryable { |
| 309 | return storage.QueryableFunc(func(mint, maxt int64) (storage.Querier, error) { |
| 310 | q := querier{ |
| 311 | now: time.Now(), |
| 312 | mint: mint, |
| 313 | maxt: maxt, |
| 314 | limits: limits, |
| 315 | maxQueryIntoFuture: cfg.MaxQueryIntoFuture, |
| 316 | ignoreMaxQueryLength: cfg.IgnoreMaxQueryLength, |
| 317 | honorProjectionHints: cfg.HonorProjectionHints, |
| 318 | distributor: distributor, |
| 319 | stores: stores, |
| 320 | limiterHolder: &limiterHolder{}, |
| 321 | } |
| 322 | |
| 323 | return q, nil |
| 324 | }) |
| 325 | } |
| 326 | |
| 327 | type querier struct { |
| 328 | now time.Time |
no outgoing calls