index

package
v0.0.0-...-034a78d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotFoundTagsID uint32 = math.MaxInt32

	NotFoundMetricID uint32 = math.MaxUint32

	MetricSequenceIDKey = 0

	NotFoundFieldID uint32 = math.MaxUint32
)

Variables

View Source
var ErrNotExist = errors.New("not exist")

Functions

func MapToString

func MapToString(tagsMap map[string]string) string

func StringToMap

func StringToMap(tags string) map[string]string

Types

type FieldReader

type FieldReader struct {
	// contains filtered or unexported fields
}

FieldReader represents parses byte arrays for reading

type FieldUID

type FieldUID struct {
	// contains filtered or unexported fields
}

FieldUID represents field unique under the metric name.

func NewFieldUID

func NewFieldUID(f kv.Family) *FieldUID

NewFieldUID creation requires kvFamily

func (*FieldUID) Flush

func (f *FieldUID) Flush() error

Flush represents forces a flush of in-memory data, and clear it

func (*FieldUID) GetFieldID

func (f *FieldUID) GetFieldID(metricID uint32, field string) uint32

GetFieldID returns get fieldID by fieldName within the metric name

func (*FieldUID) GetFields

func (f *FieldUID) GetFields(metricID uint32, limit int16) map[string]struct{}

GetFields returns get all fields within the metric name

func (*FieldUID) GetOrCreateFieldID

func (f *FieldUID) GetOrCreateFieldID(metricID uint32, fieldName string, fieldType field.Type) (uint32, error)

GetOrCreateFieldID returns find the ID associated with a given field name and field type or create it.

type IDGenerator

type IDGenerator interface {
	// GenMetricID generates ID(uint32) from metricName
	GenMetricID(metricName string) uint32
	// GenFieldID generates ID(uint32) from metricID and fieldName
	GenFieldID(metricID uint32, fieldName string, fieldType field.Type) (uint16, error)
}

IDGenerator generates unique ID numbers for metric, tag and field.

type MetadataGetter

type MetadataGetter interface {
	// GetMetricID returns metric ID(uint32), if not exist return ErrNotExist error
	GetMetricID(metricName string) (uint32, error)
	// GetFieldID returns field id and type by given metricID and field name,
	// if not exist return ErrNotExist error
	GetFieldID(metricID uint32, fieldName string) (fieldID uint16, fieldType field.Type, err error)
	// GetTagValues returns tag values by tag keys and spec version for metric level
	GetTagValues(metricID uint32, tagKeys []string, version int64) (tagValues []string, err error)
}

MetadataGetter represents the query ability for metric level metadata, such as metric id, field meta etc.

type MetricUID

type MetricUID struct {
	// contains filtered or unexported fields
}

MetricUid represents metric name unique id under the database

func NewMetricUID

func NewMetricUID(metricFamily kv.Family) *MetricUID

NewMetricUID creation requires kvFamily

func (*MetricUID) Flush

func (m *MetricUID) Flush() error

Flush represents forces a flush of in-memory data, and clear it

func (*MetricUID) GetOrCreateMetricID

func (m *MetricUID) GetOrCreateMetricID(metricName string, create bool) (uint32, bool)

GetOrCreateMetricID returns find the metric ID associated with a given name or create it.

func (*MetricUID) SuggestMetrics

func (m *MetricUID) SuggestMetrics(prefix string, limit int16) map[string]struct{}

SuggestMetrics returns suggestions of metric names given a search prefix.

type SeriesIDsFilter

type SeriesIDsFilter interface {
	// FindSeriesIDsByExpr finds series ids by tag filter expr for metric id
	FindSeriesIDsByExpr(metricID uint32, expr stmt.TagFilter,
		timeRange timeutil.TimeRange) (*series.MultiVerSeriesIDSet, error)
	// GetSeriesIDsForTag get series ids for spec metric's tag key
	GetSeriesIDsForTag(metricID uint32, tagKey string,
		timeRange timeutil.TimeRange) (*series.MultiVerSeriesIDSet, error)
}

SeriesIDsFilter represents the query ability for filtering seriesIDs by expr from an index of tags. to support multi-version based on timestamp, time range for filtering spec version is necessary

type TagsReader

type TagsReader struct {
	// contains filtered or unexported fields
}

TagsReader represents parses tags byte arrays for reading

type TagsUID

type TagsUID struct {
	// contains filtered or unexported fields
}

TagsUID represents tags unique id under the metric name.

func NewTagsUID

func NewTagsUID(f kv.Family) *TagsUID

NewTagsUID creation requires kvFamily

func (*TagsUID) Flush

func (t *TagsUID) Flush() error

Flush represents forces a flush of in-memory data, and clear it

func (*TagsUID) GetOrCreateTagsID

func (t *TagsUID) GetOrCreateTagsID(metricID uint32, tags string) (uint32, error)

GetOrCreateTagsID returns find the tags ID associated with given tags or create it.

func (*TagsUID) GetTagNames

func (t *TagsUID) GetTagNames(metricID uint32, limit int16) map[string]struct{}

GetTagNames return get all tag names within the metric name

func (*TagsUID) GetTagValueBitmap

func (t *TagsUID) GetTagValueBitmap(metricID uint32, tagName string, tagValue string) *roaring.Bitmap

GetTagValueBitmap returns find bitmap associated with a given tag value

func (*TagsUID) SuggestTagValues

func (t *TagsUID) SuggestTagValues(metricID uint32, tagName string, tagValuePrefix string,
	limit uint16) map[string]struct{}

SuggestTagValues returns suggestions of tag values given a search prefix

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL