feat(storage): Provide public MeasurementFields API
parent
a3dec4b120
commit
fe0ed6cb7e
|
@ -60,3 +60,21 @@ func (e *Engine) MeasurementTagKeys(ctx context.Context, orgID, bucketID influxd
|
|||
|
||||
return e.engine.MeasurementTagKeys(ctx, orgID, bucketID, measurement, start, end, predicate)
|
||||
}
|
||||
|
||||
// MeasurementFields returns an iterator which enumerates the field schema for the given
|
||||
// bucket and measurement, filtered using the optional the predicate and limited to the
|
||||
//// time range (start, end].
|
||||
//
|
||||
// MeasurementFields will always return a MeasurementFieldsIterator if there is no error.
|
||||
//
|
||||
// If the context is canceled before MeasurementFields has finished processing, a non-nil
|
||||
// error will be returned along with statistics for the already scanned data.
|
||||
func (e *Engine) MeasurementFields(ctx context.Context, orgID, bucketID influxdb.ID, measurement string, start, end int64, predicate influxql.Expr) (cursors.MeasurementFieldsIterator, error) {
|
||||
e.mu.RLock()
|
||||
defer e.mu.RUnlock()
|
||||
if e.closing == nil {
|
||||
return cursors.EmptyMeasurementFieldsIterator, nil
|
||||
}
|
||||
|
||||
return e.engine.MeasurementFields(ctx, orgID, bucketID, measurement, start, end, predicate)
|
||||
}
|
||||
|
|
|
@ -159,6 +159,14 @@ func (e *Engine) MeasurementTagKeys(ctx context.Context, orgID, bucketID influxd
|
|||
return e.tagKeysPredicate(ctx, orgID, bucketID, []byte(measurement), start, end, predicate)
|
||||
}
|
||||
|
||||
// MeasurementFields returns an iterator which enumerates the field schema for the given
|
||||
// bucket and measurement, filtered using the optional the predicate and limited to the
|
||||
//// time range (start, end].
|
||||
//
|
||||
// MeasurementFields will always return a MeasurementFieldsIterator if there is no error.
|
||||
//
|
||||
// If the context is canceled before MeasurementFields has finished processing, a non-nil
|
||||
// error will be returned along with statistics for the already scanned data.
|
||||
func (e *Engine) MeasurementFields(ctx context.Context, orgID, bucketID influxdb.ID, measurement string, start, end int64, predicate influxql.Expr) (cursors.MeasurementFieldsIterator, error) {
|
||||
if predicate == nil {
|
||||
return e.fieldsNoPredicate(ctx, orgID, bucketID, []byte(measurement), start, end)
|
||||
|
|
Loading…
Reference in New Issue