MCPcopy Create free account
hub / github.com/cortexproject/cortex / NewBlocksStoreQueryable

Function NewBlocksStoreQueryable

pkg/querier/blocks_store_queryable.go:153–185  ·  view source on GitHub ↗
(
	stores BlocksStoreSet,
	finder BlocksFinder,
	consistency *BlocksConsistencyChecker,
	limits BlocksStoreLimits,
	config Config,
	logger log.Logger,
	reg prometheus.Registerer,
)

Source from the content-addressed store, hash-verified

151}
152
153func NewBlocksStoreQueryable(
154 stores BlocksStoreSet,
155 finder BlocksFinder,
156 consistency *BlocksConsistencyChecker,
157 limits BlocksStoreLimits,
158 config Config,
159 logger log.Logger,
160 reg prometheus.Registerer,
161) (*BlocksStoreQueryable, error) {
162 manager, err := services.NewManager(stores, finder)
163 if err != nil {
164 return nil, errors.Wrap(err, "register blocks storage queryable subservices")
165 }
166
167 q := &BlocksStoreQueryable{
168 stores: stores,
169 finder: finder,
170 consistency: consistency,
171 queryStoreAfter: config.QueryStoreAfter,
172 logger: logger,
173 subservices: manager,
174 subservicesWatcher: services.NewFailureWatcher(),
175 metrics: newBlocksStoreQueryableMetrics(reg),
176 limits: limits,
177 storeGatewayQueryStatsEnabled: config.StoreGatewayQueryStatsEnabled,
178 storeGatewayConsistencyCheckMaxAttempts: config.StoreGatewayConsistencyCheckMaxAttempts,
179 storeGatewaySeriesBatchSize: config.StoreGatewaySeriesBatchSize,
180 }
181
182 q.Service = services.NewBasicService(q.starting, q.running, q.stopping)
183
184 return q, nil
185}
186
187func NewBlocksStoreQueryableFromConfig(querierCfg Config, gatewayCfg storegateway.Config, storageCfg cortex_tsdb.BlocksStorageConfig, limits BlocksStoreLimits, logger log.Logger, reg prometheus.Registerer) (*BlocksStoreQueryable, error) {
188 var stores BlocksStoreSet

Calls 5

NewManagerFunction · 0.92
NewFailureWatcherFunction · 0.92
NewBasicServiceFunction · 0.92
WrapMethod · 0.65

Tested by 1