Skip to content

Commit

Permalink
Merge pull request #13309 from influxdata/sgc/feat/13241
Browse files Browse the repository at this point in the history
Stub implementation of storage schema APIs
  • Loading branch information
stuartcarnie authored Apr 12, 2019
2 parents 4d2de08 + 5a224c7 commit cc199fb
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions storage/engine_schema.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package storage

import (
"github.com/influxdata/influxdb"
"github.com/influxdata/influxql"
)

// StringIterator describes the behavior for enumerating a sequence of
// string values.
type StringIterator interface {
// Next advances the StringIterator to the next value. It returns false
// when there are no more values.
Next() bool

// Value returns the current value.
Value() string
}

// TagKeys returns an iterator where the values are tag keys for the bucket
// matching the predicate within the time range (start, end].
func (e *Engine) TagKeys(orgID, bucketID influxdb.ID, start, end int64, predicate influxql.Expr) StringIterator {
// This method would be invoked when the consumer wants to get the following schema information for an arbitrary
// time range in a single bucket:
//
// * All tag keys;
// * All tag keys filtered by an arbitrary predicate, e.g., tag keys for a measurement or tag keys appearing alongside another tag key pair.
//
return nullStringIterator
}

// TagValues returns an iterator which enumerates the values for the specific
// tagKey in the given bucket matching the predicate within the
// time range (start, end].
func (e *Engine) TagValues(orgID, bucketID influxdb.ID, tagKey string, start, end int64, predicate influxql.Expr) StringIterator {
// This method would be invoked when the consumer wants to get the following schema information for an arbitrary
// time range in a single bucket:
//
// * All measurement names, i.e. tagKey == _measurement);
// * All field names for a specific measurement using a predicate
// * i.e. tagKey is "_field", predicate _measurement == "<measurement>"
//
return nullStringIterator
}

var nullStringIterator StringIterator = &emptyStringIterator{}

type emptyStringIterator struct{}

func (*emptyStringIterator) Next() bool { return false }
func (*emptyStringIterator) Value() string { return "" }

0 comments on commit cc199fb

Please sign in to comment.