Documentation ¶
Index ¶
- Constants
- func InjectFlagsFromContext(ctx context.Context) context.Context
- func NewMetrics(ctxLabelKeys []string) *metrics
- func ReadFilterSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadFilterSpec, ...) execute.Source
- func ReadGroupSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadGroupSpec, ...) execute.Source
- func ReadTagKeysSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadTagKeysSpec, ...) execute.Source
- func ReadTagValuesSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadTagValuesSpec, ...) execute.Source
- func ReadWindowAggregateSource(id execute.DatasetID, r query.StorageReader, ...) execute.Source
- func ToStoragePredicate(n semantic.Expression, objectName string) (*datatypes.Predicate, error)
- type AllBucketLookup
- type BucketDependencies
- type BucketLookup
- type BucketsDecoder
- type Config
- type Dependencies
- type FluxDepOption
- type FromDependencies
- type FromOpSpec
- type FromStorageProcedureSpec
- type FromStorageRule
- type GroupWindowAggregateTransposeRule
- type HostLookup
- type LocalBucketsProcedureSpec
- type LocalBucketsRule
- type MergeFiltersRule
- type NameOrID
- type OrganizationLookup
- type Predicate
- type PredicateSet
- type Provider
- type PushDownAggregateWindowRule
- type PushDownBareAggregateRule
- type PushDownFilterRule
- type PushDownGroupAggregateRule
- type PushDownGroupRule
- type PushDownRangeRule
- type PushDownReadTagKeysRule
- type PushDownReadTagValuesRule
- type PushDownWindowAggregateByTimeRule
- type PushDownWindowAggregateRule
- type PushDownWindowForceAggregateRule
- type ReadGroupPhysSpec
- type ReadRangePhysSpec
- func (s *ReadRangePhysSpec) Copy() plan.ProcedureSpec
- func (s *ReadRangePhysSpec) Kind() plan.ProcedureKind
- func (s *ReadRangePhysSpec) LookupBucketID(ctx context.Context, orgID platform.ID, buckets BucketLookup) (platform.ID, error)
- func (s *ReadRangePhysSpec) TimeBounds(predecessorBounds *plan.Bounds) *plan.Bounds
- type ReadTagKeysPhysSpec
- type ReadTagValuesPhysSpec
- type ReadWindowAggregatePhysSpec
- type SortedPivotRule
- type Source
- type StaticLookup
- type StorageDependencies
- type ToDependencies
Constants ¶
const ( ReadRangePhysKind = "ReadRangePhysKind" ReadGroupPhysKind = "ReadGroupPhysKind" ReadWindowAggregatePhysKind = "ReadWindowAggregatePhysKind" ReadTagKeysPhysKind = "ReadTagKeysPhysKind" ReadTagValuesPhysKind = "ReadTagValuesPhysKind" )
const BucketsKind = "influxdata/influxdb.localBuckets"
const FromKind = "influxDBFrom"
Variables ¶
This section is empty.
Functions ¶
func InjectFlagsFromContext ¶ added in v2.2.0
InjectFlagsFromContext will take the idpe feature flags from the context and wrap them in a flux feature flagger for the flux engine.
func NewMetrics ¶
func NewMetrics(ctxLabelKeys []string) *metrics
NewMetrics produces a new metrics objects for an influxdb source. Currently it just collects the duration of read requests into a histogram. ctxLabelKeys is a list of labels to add to the produced metrics. The value for a given key will be read off the context. The context value must be a string or an implementation of the Stringer interface. In addition, produced metrics will be labeled with the orgID and type of operation requested.
func ReadFilterSource ¶
func ReadFilterSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadFilterSpec, a execute.Administration) execute.Source
func ReadGroupSource ¶
func ReadGroupSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadGroupSpec, a execute.Administration) execute.Source
func ReadTagKeysSource ¶
func ReadTagKeysSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadTagKeysSpec, a execute.Administration) execute.Source
func ReadTagValuesSource ¶
func ReadTagValuesSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadTagValuesSpec, a execute.Administration) execute.Source
func ReadWindowAggregateSource ¶
func ReadWindowAggregateSource(id execute.DatasetID, r query.StorageReader, readSpec query.ReadWindowAggregateSpec, a execute.Administration) execute.Source
func ToStoragePredicate ¶
ToStoragePredicate will convert a FunctionExpression into a predicate that can be sent down to the storage layer.
Types ¶
type AllBucketLookup ¶
type BucketDependencies ¶
type BucketDependencies AllBucketLookup
type BucketLookup ¶
type BucketsDecoder ¶
type BucketsDecoder struct {
// contains filtered or unexported fields
}
func (*BucketsDecoder) Close ¶
func (bd *BucketsDecoder) Close() error
type Dependencies ¶
type Dependencies struct { StorageDeps StorageDependencies FluxDeps flux.Dependencies }
func NewDependencies ¶
func NewDependencies( reader query.StorageReader, writer storage.PointsWriter, bucketSvc influxdb.BucketService, orgSvc influxdb.OrganizationService, ss influxdb.SecretService, metricLabelKeys []string, fluxopts ...FluxDepOption, ) (Dependencies, error)
func (Dependencies) PrometheusCollectors ¶
func (d Dependencies) PrometheusCollectors() []prometheus.Collector
PrometheusCollectors satisfies the prom.PrometheusCollector interface.
type FluxDepOption ¶ added in v2.2.0
func WithURLValidator ¶ added in v2.2.0
func WithURLValidator(v url.Validator) FluxDepOption
type FromDependencies ¶
type FromDependencies struct { Reader query.StorageReader BucketLookup BucketLookup OrganizationLookup OrganizationLookup Metrics *metrics }
func (FromDependencies) PrometheusCollectors ¶
func (d FromDependencies) PrometheusCollectors() []prometheus.Collector
PrometheusCollectors satisfies the PrometheusCollector interface.
func (FromDependencies) Validate ¶
func (d FromDependencies) Validate() error
type FromOpSpec ¶
type FromOpSpec = influxdb.FromOpSpec
type FromStorageProcedureSpec ¶
func (*FromStorageProcedureSpec) Copy ¶
func (s *FromStorageProcedureSpec) Copy() plan.ProcedureSpec
func (*FromStorageProcedureSpec) Kind ¶
func (s *FromStorageProcedureSpec) Kind() plan.ProcedureKind
func (*FromStorageProcedureSpec) PostPhysicalValidate ¶
func (s *FromStorageProcedureSpec) PostPhysicalValidate(id plan.NodeID) error
type FromStorageRule ¶
type FromStorageRule struct{}
func (FromStorageRule) Name ¶
func (rule FromStorageRule) Name() string
func (FromStorageRule) Pattern ¶
func (rule FromStorageRule) Pattern() plan.Pattern
type GroupWindowAggregateTransposeRule ¶
type GroupWindowAggregateTransposeRule struct{}
GroupWindowAggregateTransposeRule will match the given pattern. ReadGroupPhys |> window |> { min, max, count, sum }
This pattern will use the PushDownWindowAggregateRule to determine if the ReadWindowAggregatePhys operation is available before it will rewrite the above. This rewrites the above to:
ReadWindowAggregatePhys |> group(columns: ["_start", "_stop", ...]) |> { min, max, sum }
The count aggregate uses sum to merge the results.
func (GroupWindowAggregateTransposeRule) Name ¶
func (p GroupWindowAggregateTransposeRule) Name() string
func (GroupWindowAggregateTransposeRule) Pattern ¶
func (p GroupWindowAggregateTransposeRule) Pattern() plan.Pattern
type HostLookup ¶
type HostLookup interface { Hosts() []string Watch() <-chan struct{} }
type LocalBucketsProcedureSpec ¶
type LocalBucketsProcedureSpec struct {
plan.DefaultCost
}
func (*LocalBucketsProcedureSpec) Copy ¶
func (s *LocalBucketsProcedureSpec) Copy() plan.ProcedureSpec
func (*LocalBucketsProcedureSpec) Kind ¶
func (s *LocalBucketsProcedureSpec) Kind() plan.ProcedureKind
type LocalBucketsRule ¶
type LocalBucketsRule struct{}
func (LocalBucketsRule) Name ¶
func (rule LocalBucketsRule) Name() string
func (LocalBucketsRule) Pattern ¶
func (rule LocalBucketsRule) Pattern() plan.Pattern
type MergeFiltersRule ¶
type MergeFiltersRule struct{}
func (MergeFiltersRule) Name ¶
func (MergeFiltersRule) Name() string
func (MergeFiltersRule) Pattern ¶
func (MergeFiltersRule) Pattern() plan.Pattern
type OrganizationLookup ¶
type PredicateSet ¶ added in v2.0.9
type PredicateSet = influxdb.PredicateSet
type Provider ¶ added in v2.0.9
type Provider struct { influxdb.HttpProvider Reader query.StorageReader BucketLookup BucketLookup }
Provider is an implementation of influxdb.Provider that exposes the query.StorageReader to flux and, if a host or org were specified, it delegates to the influxdb.HttpProvider.
func (Provider) SeriesCardinalityReaderFor ¶ added in v2.0.9
type PushDownAggregateWindowRule ¶ added in v2.4.0
type PushDownAggregateWindowRule struct{}
func (PushDownAggregateWindowRule) Name ¶ added in v2.4.0
func (p PushDownAggregateWindowRule) Name() string
func (PushDownAggregateWindowRule) Pattern ¶ added in v2.4.0
func (p PushDownAggregateWindowRule) Pattern() plan.Pattern
type PushDownBareAggregateRule ¶
type PushDownBareAggregateRule struct{}
PushDownBareAggregateRule is a rule that allows pushing down of aggregates that are directly over a ReadRange source.
func (PushDownBareAggregateRule) Name ¶
func (p PushDownBareAggregateRule) Name() string
func (PushDownBareAggregateRule) Pattern ¶
func (p PushDownBareAggregateRule) Pattern() plan.Pattern
type PushDownFilterRule ¶
type PushDownFilterRule struct{}
PushDownFilterRule is a rule that pushes filters into from procedures to be evaluated in the storage layer. This rule is likely to be replaced by a more generic rule when we have a better framework for pushing filters, etc into sources.
func (PushDownFilterRule) Name ¶
func (PushDownFilterRule) Name() string
func (PushDownFilterRule) Pattern ¶
func (PushDownFilterRule) Pattern() plan.Pattern
type PushDownGroupAggregateRule ¶
type PushDownGroupAggregateRule struct{}
Push Down of group aggregates. ReadGroupPhys |> { count }
func (PushDownGroupAggregateRule) Name ¶
func (PushDownGroupAggregateRule) Name() string
func (PushDownGroupAggregateRule) Pattern ¶
func (rule PushDownGroupAggregateRule) Pattern() plan.Pattern
type PushDownGroupRule ¶
type PushDownGroupRule struct{}
PushDownGroupRule pushes down a group operation to storage
func (PushDownGroupRule) Name ¶
func (rule PushDownGroupRule) Name() string
func (PushDownGroupRule) Pattern ¶
func (rule PushDownGroupRule) Pattern() plan.Pattern
type PushDownRangeRule ¶
type PushDownRangeRule struct{}
PushDownRangeRule pushes down a range filter to storage
func (PushDownRangeRule) Name ¶
func (rule PushDownRangeRule) Name() string
func (PushDownRangeRule) Pattern ¶
func (rule PushDownRangeRule) Pattern() plan.Pattern
Pattern matches 'from |> range'
type PushDownReadTagKeysRule ¶
type PushDownReadTagKeysRule struct{}
PushDownReadTagKeysRule matches 'ReadRange |> keys() |> keep() |> distinct()'. The 'from()' must have already been merged with 'range' and, optionally, may have been merged with 'filter'. If any other properties have been set on the from procedure, this rule will not rewrite anything.
func (PushDownReadTagKeysRule) Name ¶
func (rule PushDownReadTagKeysRule) Name() string
func (PushDownReadTagKeysRule) Pattern ¶
func (rule PushDownReadTagKeysRule) Pattern() plan.Pattern
type PushDownReadTagValuesRule ¶
type PushDownReadTagValuesRule struct{}
PushDownReadTagValuesRule matches 'ReadRange |> keep(columns: [tag]) |> group() |> distinct(column: tag)'. The 'from()' must have already been merged with 'range' and, optionally, may have been merged with 'filter'. If any other properties have been set on the from procedure, this rule will not rewrite anything.
func (PushDownReadTagValuesRule) Name ¶
func (rule PushDownReadTagValuesRule) Name() string
func (PushDownReadTagValuesRule) Pattern ¶
func (rule PushDownReadTagValuesRule) Pattern() plan.Pattern
type PushDownWindowAggregateByTimeRule ¶
type PushDownWindowAggregateByTimeRule struct{}
PushDownWindowAggregateByTimeRule will match the given pattern. ReadWindowAggregatePhys |> duplicate |> window(every: inf)
If this pattern matches and the arguments to duplicate are matching time column names, it will set the time column on the spec.
func (PushDownWindowAggregateByTimeRule) Name ¶
func (PushDownWindowAggregateByTimeRule) Name() string
func (PushDownWindowAggregateByTimeRule) Pattern ¶
func (PushDownWindowAggregateByTimeRule) Pattern() plan.Pattern
type PushDownWindowAggregateRule ¶
type PushDownWindowAggregateRule struct{}
Push Down of window aggregates. ReadRangePhys |> window |> { min, max, mean, count, sum }
func (PushDownWindowAggregateRule) Name ¶
func (PushDownWindowAggregateRule) Name() string
func (PushDownWindowAggregateRule) Pattern ¶
func (rule PushDownWindowAggregateRule) Pattern() plan.Pattern
type PushDownWindowForceAggregateRule ¶ added in v2.0.7
type PushDownWindowForceAggregateRule struct{}
PushDownWindowForceAggregateRule will match the given pattern. ReadWindowAggregatePhys |> table.fill()
If this pattern matches, then the ForceAggregate switch will be enabled on the ReadWindowAggregate which will force selectors to return a null value.
This pattern is idempotent and may be applied multiple times with the same effect.
func (PushDownWindowForceAggregateRule) Name ¶ added in v2.0.7
func (PushDownWindowForceAggregateRule) Name() string
func (PushDownWindowForceAggregateRule) Pattern ¶ added in v2.0.7
func (PushDownWindowForceAggregateRule) Pattern() plan.Pattern
type ReadGroupPhysSpec ¶
type ReadGroupPhysSpec struct { plan.DefaultCost ReadRangePhysSpec GroupMode flux.GroupMode GroupKeys []string AggregateMethod string }
func (*ReadGroupPhysSpec) Copy ¶
func (s *ReadGroupPhysSpec) Copy() plan.ProcedureSpec
func (*ReadGroupPhysSpec) Kind ¶
func (s *ReadGroupPhysSpec) Kind() plan.ProcedureKind
func (*ReadGroupPhysSpec) PlanDetails ¶
func (s *ReadGroupPhysSpec) PlanDetails() string
type ReadRangePhysSpec ¶
type ReadRangePhysSpec struct { plan.DefaultCost Bucket string BucketID string // Filter is the filter to use when calling into // storage. It must be possible to push down this // filter. Filter *datatypes.Predicate Bounds flux.Bounds }
func (*ReadRangePhysSpec) Copy ¶
func (s *ReadRangePhysSpec) Copy() plan.ProcedureSpec
func (*ReadRangePhysSpec) Kind ¶
func (s *ReadRangePhysSpec) Kind() plan.ProcedureKind
func (*ReadRangePhysSpec) LookupBucketID ¶
func (s *ReadRangePhysSpec) LookupBucketID(ctx context.Context, orgID platform.ID, buckets BucketLookup) (platform.ID, error)
func (*ReadRangePhysSpec) TimeBounds ¶
func (s *ReadRangePhysSpec) TimeBounds(predecessorBounds *plan.Bounds) *plan.Bounds
TimeBounds implements plan.BoundsAwareProcedureSpec.
type ReadTagKeysPhysSpec ¶
type ReadTagKeysPhysSpec struct {
ReadRangePhysSpec
}
func (*ReadTagKeysPhysSpec) Copy ¶
func (s *ReadTagKeysPhysSpec) Copy() plan.ProcedureSpec
func (*ReadTagKeysPhysSpec) Kind ¶
func (s *ReadTagKeysPhysSpec) Kind() plan.ProcedureKind
type ReadTagValuesPhysSpec ¶
type ReadTagValuesPhysSpec struct { ReadRangePhysSpec TagKey string }
func (*ReadTagValuesPhysSpec) Copy ¶
func (s *ReadTagValuesPhysSpec) Copy() plan.ProcedureSpec
func (*ReadTagValuesPhysSpec) Kind ¶
func (s *ReadTagValuesPhysSpec) Kind() plan.ProcedureKind
type ReadWindowAggregatePhysSpec ¶
type ReadWindowAggregatePhysSpec struct { plan.DefaultCost ReadRangePhysSpec WindowEvery flux.Duration Offset flux.Duration Aggregates []plan.ProcedureKind CreateEmpty bool TimeColumn string // ForceAggregate forces the aggregates to be treated as // aggregates even if they are selectors. ForceAggregate bool }
func (*ReadWindowAggregatePhysSpec) Copy ¶
func (s *ReadWindowAggregatePhysSpec) Copy() plan.ProcedureSpec
func (*ReadWindowAggregatePhysSpec) Kind ¶
func (s *ReadWindowAggregatePhysSpec) Kind() plan.ProcedureKind
func (*ReadWindowAggregatePhysSpec) PlanDetails ¶
func (s *ReadWindowAggregatePhysSpec) PlanDetails() string
type SortedPivotRule ¶
type SortedPivotRule struct{}
SortedPivotRule is a rule that optimizes a pivot when it is directly after an influxdb from.
func (SortedPivotRule) Name ¶
func (SortedPivotRule) Name() string
func (SortedPivotRule) Pattern ¶
func (SortedPivotRule) Pattern() plan.Pattern
type Source ¶
type Source struct { execute.ExecutionNode // contains filtered or unexported fields }
func (*Source) AddTransformation ¶
func (s *Source) AddTransformation(t execute.Transformation)
type StaticLookup ¶
type StaticLookup struct {
// contains filtered or unexported fields
}
func NewStaticLookup ¶
func NewStaticLookup(hosts []string) StaticLookup
func (StaticLookup) Hosts ¶
func (l StaticLookup) Hosts() []string
func (StaticLookup) Watch ¶
func (l StaticLookup) Watch() <-chan struct{}
type StorageDependencies ¶
type StorageDependencies struct { FromDeps FromDependencies BucketDeps BucketDependencies ToDeps ToDependencies }
func GetStorageDependencies ¶
func GetStorageDependencies(ctx context.Context) StorageDependencies
func (StorageDependencies) Inject ¶
func (d StorageDependencies) Inject(ctx context.Context) context.Context
func (StorageDependencies) PrometheusCollectors ¶
func (d StorageDependencies) PrometheusCollectors() []prometheus.Collector
PrometheusCollectors satisfies the prom.PrometheusCollector interface.
type ToDependencies ¶
type ToDependencies struct { BucketLookup BucketLookup OrganizationLookup OrganizationLookup PointsWriter storage.PointsWriter }
ToDependencies contains the dependencies for executing the `to` function.
func (ToDependencies) Validate ¶
func (d ToDependencies) Validate() error
Validate returns an error if any required field is unset.