pull/8172/head
Edd Robinson 2017-03-15 12:16:28 +00:00
parent ddcea1c322
commit 7d997d508a
2 changed files with 17 additions and 2 deletions

View File

@ -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

View File

@ -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()
})
}