-
Notifications
You must be signed in to change notification settings - Fork 277
/
interface.go
50 lines (43 loc) · 2.14 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Licensed to LinDB under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. LinDB licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package series
import (
"github.com/lindb/roaring"
"github.com/lindb/lindb/series/tag"
)
//go:generate mockgen -source ./interface.go -destination=./interface_mock.go -package=series
// MetricMetaSuggester represents to suggest ability for metricNames and tagKeys.
// default max limit of suggestions is set in constants
type MetricMetaSuggester interface {
// SuggestMetrics returns suggestions from a given prefix of metricName
SuggestMetrics(namespace, metricPrefix string, limit int) ([]string, error)
}
// TagValueSuggester represents to suggest ability for tagValues.
// default max limit of suggestions is set in constants
type TagValueSuggester interface {
// SuggestTagValues returns suggestions from given tag key id and prefix of tagValue
SuggestTagValues(tagKeyID tag.KeyID, tagValuePrefix string, limit int) []string
}
// Filter represents the query ability for filtering seriesIDs by expr from an index of tags.
type Filter interface {
// GetSeriesIDsByTagValueIDs gets series ids by tag value ids for spec tag key of metric
GetSeriesIDsByTagValueIDs(tagKeyID tag.KeyID, tagValueIDs *roaring.Bitmap) (*roaring.Bitmap, error)
// GetSeriesIDsForTag gets series ids for spec tag key of metric
GetSeriesIDsForTag(tagKeyID tag.KeyID) (*roaring.Bitmap, error)
// GetSeriesIDsForMetric gets series ids for spec metric name
GetSeriesIDsForMetric(namespace, metricName string) (*roaring.Bitmap, error)
}