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)
| 77 | // ScanTagValueIDs scans grouping context by high key/container of series ids, |
| 78 | // then returns grouped tag value ids for each tag key |
| 79 | func (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. |
nothing calls this directly
no test coverage detected