Add comments for clarity
parent
9fb04a2636
commit
9ec210f7f9
|
@ -70,7 +70,7 @@ type Server struct {
|
|||
errors map[uint64]error // message errors
|
||||
|
||||
meta *metastore // metadata store
|
||||
metaIndexes map[string]*TagIndex // metadata in-memory index
|
||||
metaIndexes map[string]*TagIndex // map databases to tag indexes
|
||||
|
||||
databases map[string]*database // databases by name
|
||||
databasesByShard map[uint64]*database // databases by shard id
|
||||
|
@ -942,6 +942,7 @@ func (s *Server) createSeriesIfNotExists(database, name string, tags map[string]
|
|||
s.mu.RLock()
|
||||
idx := s.metaIndexes[database]
|
||||
s.mu.RUnlock()
|
||||
|
||||
if _, series := idx.MeasurementAndSeries(name, tags); series != nil {
|
||||
return series.ID, nil
|
||||
}
|
||||
|
|
|
@ -11,9 +11,9 @@ import (
|
|||
// and series within a database.
|
||||
type TagIndex struct {
|
||||
mu sync.RWMutex
|
||||
measurementIndex map[string]*measurementIndex
|
||||
seriesToMeasurement map[uint32]*Measurement
|
||||
series map[uint32]*Series
|
||||
measurementIndex map[string]*measurementIndex // map measurement name to its tag index
|
||||
seriesToMeasurement map[uint32]*Measurement // map series id to its measurement
|
||||
series map[uint32]*Series // map series id to the Series object
|
||||
}
|
||||
|
||||
func NewTagIndex() *TagIndex {
|
||||
|
|
Loading…
Reference in New Issue