Documentation ¶
Index ¶
- Constants
- type FileIndexDatabase
- type ForwardStore
- func (m *ForwardStore) Get(key uint32) (uint32, bool)
- func (m *ForwardStore) Keys() *roaring.Bitmap
- func (m *ForwardStore) Put(key uint32, value uint32)
- func (m *ForwardStore) Size() int
- func (m *ForwardStore) Values() [][]uint32
- func (m *ForwardStore) WalkEntry(fn func(key uint32, value uint32) error) error
- type IDMappingBackend
- type IndexDatabase
- type InvertedIndex
- type InvertedStore
- func (m *InvertedStore) Get(key uint32) (*roaring.Bitmap, bool)
- func (m *InvertedStore) Keys() *roaring.Bitmap
- func (m *InvertedStore) Put(key uint32, value *roaring.Bitmap)
- func (m *InvertedStore) Size() int
- func (m *InvertedStore) Values() [][]*roaring.Bitmap
- func (m *InvertedStore) WalkEntry(fn func(key uint32, value *roaring.Bitmap) error) error
- type MetricIDMapping
- type TagIndex
- type TagIndexStore
- func (m *TagIndexStore) Get(key uint32) (TagIndex, bool)
- func (m *TagIndexStore) Keys() *roaring.Bitmap
- func (m *TagIndexStore) Put(key uint32, value TagIndex)
- func (m *TagIndexStore) Size() int
- func (m *TagIndexStore) Values() [][]TagIndex
- func (m *TagIndexStore) WalkEntry(fn func(key uint32, value TagIndex) error) error
Constants ¶
const SeriesDB = "series"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileIndexDatabase ¶
type FileIndexDatabase interface { series.Filter series.TagValueSuggester }
FileIndexDatabase represents a database of index files, it is shard-level it provides the abilities to filter seriesID from the index. See `tsdb/doc` for index file layout.
type ForwardStore ¶
type ForwardStore struct {
// contains filtered or unexported fields
}
ForwardStore represents int map using roaring bitmap
func (*ForwardStore) Get ¶
func (m *ForwardStore) Get(key uint32) (uint32, bool)
Get returns value by key, if exist returns it, else returns 0, false
func (*ForwardStore) Put ¶
func (m *ForwardStore) Put(key uint32, value uint32)
Put puts the value by key
func (*ForwardStore) Values ¶
func (m *ForwardStore) Values() [][]uint32
Values returns the all values
type IDMappingBackend ¶
IDMappingBackend represents the id mapping backend storage, save series data(tags hash => series id) under metric
type IndexDatabase ¶
type IndexDatabase interface { io.Closer flow.GroupingBuilder series.TagValueSuggester series.Filter // GetOrCreateSeriesID gets series by tags hash, if not exist generate new series id in memory, // if generate a new series id returns isCreate is true // if generate fail return err GetOrCreateSeriesID(namespace, metricName string, metricID metric.ID, tagsHash uint64, limits *models.Limits) (seriesID uint32, isCreated bool, err error) // BuildInvertIndex builds the inverted index for tag value => series ids, // the tags is considered as an empty key-value pair while tags is nil. BuildInvertIndex(namespace, metricName string, tagIterator *metric.KeyValueIterator, seriesID uint32, limits *models.Limits) // Flush flushes index data to disk Flush() error }
IndexDatabase represents a index database includes memory/file storage, it is shard level. index database will generate series id if tags hash not exist in mapping storage, and builds inverted index for tags => series id
type InvertedIndex ¶
type InvertedIndex 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) // GetSeriesIDsForTags gets series ids for spec tag keys of metric GetSeriesIDsForTags(tagKeyIDs []tag.KeyID) (*roaring.Bitmap, error) // GetGroupingContext returns the context of group by GetGroupingContext(ctx *flow.ShardExecuteContext) error // Flush flushes the inverted-index of tag value id=>series ids under tag key Flush() error // contains filtered or unexported methods }
InvertedIndex represents the tag's inverted index (tag values => series id list)
type InvertedStore ¶
type InvertedStore struct {
// contains filtered or unexported fields
}
InvertedStore represents int map using roaring bitmap
func (*InvertedStore) Get ¶
func (m *InvertedStore) Get(key uint32) (*roaring.Bitmap, bool)
Get returns value by key, if exist returns it, else returns nil, false
func (*InvertedStore) Keys ¶
func (m *InvertedStore) Keys() *roaring.Bitmap
Keys returns the all keys
func (*InvertedStore) Put ¶
func (m *InvertedStore) Put(key uint32, value *roaring.Bitmap)
Put puts the value by key
func (*InvertedStore) Values ¶
func (m *InvertedStore) Values() [][]*roaring.Bitmap
Values returns the all values
type MetricIDMapping ¶
type MetricIDMapping interface { // GetMetricID return the metric id. GetMetricID() metric.ID // GetSeriesID gets series id by tags hash, if exist return true. GetSeriesID(tagsHash uint64) (seriesID uint32, ok bool) // GenSeriesID generates series id by tags hash, then cache new series id. GenSeriesID(namespace, metricName string, tagsHash uint64, limit *models.Limits) (seriesID uint32, err error) // AddSeriesID adds the series id init cache. AddSeriesID(tagsHash uint64, seriesID uint32) // SeriesSequence returns series sequence. SeriesSequence() unique.Sequence }
MetricIDMapping represents the metric id mapping, tag hash code => series id
type TagIndex ¶
type TagIndex interface { // GetGroupingScanner returns the grouping scanners based on series ids GetGroupingScanner(seriesIDs *roaring.Bitmap, withLock func() (release func())) ([]flow.GroupingScanner, error) // contains filtered or unexported methods }
TagIndex represents the tag inverted index
type TagIndexStore ¶
type TagIndexStore struct {
// contains filtered or unexported fields
}
TagIndexStore represents int map using roaring bitmap
func (*TagIndexStore) Get ¶
func (m *TagIndexStore) Get(key uint32) (TagIndex, bool)
Get returns value by key, if exist returns it, else returns nil, false
func (*TagIndexStore) Keys ¶
func (m *TagIndexStore) Keys() *roaring.Bitmap
Keys returns the all keys
func (*TagIndexStore) Put ¶
func (m *TagIndexStore) Put(key uint32, value TagIndex)
Put puts the value by key
func (*TagIndexStore) Values ¶
func (m *TagIndexStore) Values() [][]TagIndex
Values returns the all values