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

Method checkRunning

pkg/ingester/ingester.go:1240–1246  ·  view source on GitHub ↗

Using block store, the ingester is only available when it is in a Running state. The ingester is not available when stopping to prevent any read or writes to the TSDB after the ingester has closed them.

()

Source from the content-addressed store, hash-verified

1238// Using block store, the ingester is only available when it is in a Running state. The ingester is not available
1239// when stopping to prevent any read or writes to the TSDB after the ingester has closed them.
1240func (i *Ingester) checkRunning() error {
1241 s := i.State()
1242 if s == services.Running {
1243 return nil
1244 }
1245 return status.Error(codes.Unavailable, s.String())
1246}
1247
1248// GetRef() is an extra method added to TSDB to let Cortex check before calling Add()
1249type extendedAppender interface {

Callers 9

PushMethod · 0.95
QueryExemplarsMethod · 0.95
labelsValuesCommonMethod · 0.95
labelNamesCommonMethod · 0.95
UserStatsMethod · 0.95
AllUserStatsMethod · 0.95
QueryStreamMethod · 0.95
getMemorySeriesMetricMethod · 0.95

Implementers 1

Ingesterpkg/ingester/ingester.go

Calls 3

StateMethod · 0.65
StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected