Fixes #8138
parent
ddcea1c322
commit
7d997d508a
|
@ -18,6 +18,7 @@ import (
|
|||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/influxdata/influxdb/influxql"
|
||||
"github.com/influxdata/influxdb/models"
|
||||
"github.com/influxdata/influxdb/pkg/estimator"
|
||||
internal "github.com/influxdata/influxdb/tsdb/internal"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
@ -487,6 +488,20 @@ func (s *Shard) SeriesN() int64 {
|
|||
return s.engine.SeriesN()
|
||||
}
|
||||
|
||||
// SeriesSketches returns the series sketches for the shard.
|
||||
func (s *Shard) SeriesSketches() (estimator.Sketch, estimator.Sketch, error) {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
return s.engine.SeriesSketches()
|
||||
}
|
||||
|
||||
// MeasurementsSketches returns the measurement sketches for the shard.
|
||||
func (s *Shard) MeasurementsSketches() (estimator.Sketch, estimator.Sketch, error) {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
return s.engine.MeasurementsSketches()
|
||||
}
|
||||
|
||||
func (s *Shard) createFieldsAndMeasurements(fieldsToCreate []*FieldCreate) error {
|
||||
if len(fieldsToCreate) == 0 {
|
||||
return nil
|
||||
|
|
|
@ -714,7 +714,7 @@ func (s *Store) SeriesCardinality(database string) (int64, error) {
|
|||
if sh == nil {
|
||||
return nil, nil, errors.New("shard nil, can't get cardinality")
|
||||
}
|
||||
return sh.engine.SeriesSketches()
|
||||
return sh.SeriesSketches()
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -725,7 +725,7 @@ func (s *Store) MeasurementsCardinality(database string) (int64, error) {
|
|||
if sh == nil {
|
||||
return nil, nil, errors.New("shard nil, can't get cardinality")
|
||||
}
|
||||
return sh.engine.MeasurementsSketches()
|
||||
return sh.MeasurementsSketches()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue