Rebase fixes.

pull/7913/head
Ben Johnson 2016-10-21 09:48:00 -06:00
parent 992e651588
commit afce53e81b
No known key found for this signature in database
GPG Key ID: 81741CD251883081
5 changed files with 15 additions and 5 deletions

View File

@ -23,6 +23,12 @@ type Index struct {
// TODO(benbjohnson): Add write ahead log.
}
// Open opens the index.
func (i *Index) Open() error { panic("TODO") }
// Close closes the index.
func (i *Index) Close() error { panic("TODO") }
// SetFile explicitly sets a file in the index.
func (i *Index) SetFile(f *IndexFile) { i.file = f }
@ -295,3 +301,6 @@ func (i *Index) SeriesSketches() (estimator.Sketch, estimator.Sketch, error) {
func (i *Index) MeasurementsSketches() (estimator.Sketch, estimator.Sketch, error) {
panic("TODO")
}
// Dereference is a nop.
func (i *Index) Dereference([]byte) {}

View File

@ -1359,7 +1359,7 @@ func (e *Engine) createVarRefIterator(opt influxql.IteratorOptions, aggregate bo
for _, mm := range mms {
// Determine tagsets for this measurement based on dimensions and filters.
tagSets, err := mm.TagSets(e.id, opt.Dimensions, opt.Condition)
tagSets, err := mm.TagSets(opt.Dimensions, opt.Condition)
if err != nil {
return err
}

View File

@ -9,6 +9,9 @@ import (
)
type Index interface {
Open() error
Close() error
CreateMeasurementIndexIfNotExists(name string) (*Measurement, error)
Measurement(name []byte) (*Measurement, error)
Measurements() (Measurements, error)
@ -26,4 +29,5 @@ type Index interface {
MeasurementsSketches() (estimator.Sketch, estimator.Sketch, error)
TagsForSeries(key string) (models.Tags, error)
Dereference(b []byte)
}

View File

@ -728,9 +728,6 @@ func (m *Measurement) TagSets(dimensions []string, condition influxql.Expr) ([]*
tagSets := make(map[string]*influxql.TagSet, 64)
for _, id := range ids {
s := m.seriesByID[id]
if !s.Assigned(shardID) {
continue
}
tags := make(map[string]string, len(dimensions))
// Build the TagSet for this series.

View File

@ -104,7 +104,7 @@ func TestMeasurement_AppendSeriesKeysByID_Missing(t *testing.T) {
func TestMeasurement_AppendSeriesKeysByID_Exists(t *testing.T) {
m := tsdb.NewMeasurement("cpu")
s := tsdb.NewSeries("cpu,host=foo", models.Tags{models.Tag{Key: []byte("host"), Value: []byte("foo")}})
s := tsdb.NewSeries([]byte("cpu,host=foo"), models.Tags{models.Tag{Key: []byte("host"), Value: []byte("foo")}})
s.ID = 1
m.AddSeries(s)