MCPcopy
hub / github.com/lindb/lindb / ScanTagValueIDs

Method ScanTagValueIDs

flow/grouping.go:79–105  ·  view source on GitHub ↗

ScanTagValueIDs scans grouping context by high key/container of series ids, then returns grouped tag value ids for each tag key

(highKey uint16, container roaring.Container)

Source from the content-addressed store, hash-verified

77// ScanTagValueIDs scans grouping context by high key/container of series ids,
78// then returns grouped tag value ids for each tag key
79func (g *groupingContext) ScanTagValueIDs(highKey uint16, container roaring.Container) []*roaring.Bitmap {
80 result := make([]*roaring.Bitmap, len(g.tagKeys))
81 for i, tagKey := range g.tagKeys {
82 scanners := g.scanners[tagKey]
83 tagValues := roaring.New()
84 result[i] = tagValues
85 for _, scanner := range scanners {
86 // get series ids/tag value ids mapping by high key
87 lowContainer, tagValueIDs := scanner.GetSeriesAndTagValue(highKey)
88 if lowContainer == nil {
89 // high key not exist
90 continue
91 }
92 // iterator all series ids after filtering
93 it := lowContainer.PeekableIterator()
94 idx := 0
95 for it.HasNext() {
96 seriesID := it.Next()
97 if container.Contains(seriesID) {
98 tagValues.Add(tagValueIDs[idx])
99 }
100 idx++
101 }
102 }
103 }
104 return result
105}
106
107// BuildGroup builds the grouped series ids by the high key of series id
108// and the container includes low keys of series id.

Callers

nothing calls this directly

Calls 5

GetSeriesAndTagValueMethod · 0.65
HasNextMethod · 0.65
NextMethod · 0.65
AddMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected