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

Method NewIterator

pkg/chunk/chunk.go:30–42  ·  view source on GitHub ↗
(iterator Iterator)

Source from the content-addressed store, hash-verified

28}
29
30func (c *Chunk) NewIterator(iterator Iterator) Iterator {
31 if c.Data == nil {
32 return errorIterator("Prometheus chunk is not set")
33 }
34
35 if pit, ok := iterator.(*prometheusChunkIterator); ok {
36 pit.c = c.Data
37 pit.it = c.Data.Iterator(pit.it)
38 return pit
39 }
40
41 return &prometheusChunkIterator{c: c.Data, it: c.Data.Iterator(nil)}
42}
43
44type prometheusChunkIterator struct {
45 c chunkenc.Chunk // we need chunk, because FindAtOrAfter needs to start with fresh iterator.

Callers

nothing calls this directly

Calls 2

errorIteratorTypeAlias · 0.85
IteratorMethod · 0.45

Tested by

no test coverage detected