Package influxql
Overview ▹
Index ▹
Constants
const ( // MinTime is used as the minimum time value when computing an unbounded range. // This time is one less than the MinNanoTime so that the first minimum // time can be used as a sentinel value to signify that it is the default // value rather than explicitly set by the user. MinTime = models.MinNanoTime - 1 // MaxTime is used as the maximum time value when computing an unbounded range. // This time is 2262-04-11 23:47:16.854775806 +0000 UTC MaxTime = models.MaxNanoTime )
const ( // DateFormat represents the format for date literals. DateFormat = "2006-01-02" // DateTimeFormat represents the format for date time literals. DateTimeFormat = "2006-01-02 15:04:05.999999" )
const ( // DefaultQueryTimeout is the default timeout for executing a query. // A value of zero will have no query timeout. DefaultQueryTimeout = time.Duration(0) )
DefaultStatsInterval is the default value for IteratorEncoder.StatsInterval.
const DefaultStatsInterval = 10 * time.Second
const (
// WarningLevel is the message level for a warning.
WarningLevel = "warning"
)
ZeroTime is the Unix nanosecond timestamp for no time. This time is not used by the query engine or the storage engine as a valid time.
const ZeroTime = int64(math.MinInt64)
Variables
var ( // ErrInvalidQuery is returned when executing an unknown query type. ErrInvalidQuery = errors.New("invalid query") // ErrNotExecuted is returned when a statement is not executed in a query. // This can occur when a previous statement in the same query has errored. ErrNotExecuted = errors.New("not executed") // ErrQueryInterrupted is an error returned when the query is interrupted. ErrQueryInterrupted = errors.New("query interrupted") // ErrQueryAborted is an error returned when the query is aborted. ErrQueryAborted = errors.New("query aborted") // ErrQueryEngineShutdown is an error sent when the query cannot be // created because the query engine was shutdown. ErrQueryEngineShutdown = errors.New("query engine shutdown") // ErrQueryTimeoutLimitExceeded is an error when a query hits the max time allowed to run. ErrQueryTimeoutLimitExceeded = errors.New("query-timeout limit exceeded") )
ErrInvalidDuration is returned when parsing a malformed duration.
var ErrInvalidDuration = errors.New("invalid duration")
var ( // ErrInvalidTime is returned when the timestamp string used to // compare against time field is invalid. ErrInvalidTime = errors.New("invalid timestamp string") )
ErrUnknownCall is returned when operating on an unknown function call.
var ErrUnknownCall = errors.New("unknown call")
func AggregateBooleanPoints ¶
func AggregateBooleanPoints(a BooleanPointAggregator, points []BooleanPoint)
AggregateBooleanPoints feeds a slice of BooleanPoint into an aggregator. If the aggregator is a BooleanBulkPointAggregator, it will use the AggregateBulk method.
func AggregateFloatPoints ¶
func AggregateFloatPoints(a FloatPointAggregator, points []FloatPoint)
AggregateFloatPoints feeds a slice of FloatPoint into an aggregator. If the aggregator is a FloatBulkPointAggregator, it will use the AggregateBulk method.
func AggregateIntegerPoints ¶
func AggregateIntegerPoints(a IntegerPointAggregator, points []IntegerPoint)
AggregateIntegerPoints feeds a slice of IntegerPoint into an aggregator. If the aggregator is a IntegerBulkPointAggregator, it will use the AggregateBulk method.
func AggregateStringPoints ¶
func AggregateStringPoints(a StringPointAggregator, points []StringPoint)
AggregateStringPoints feeds a slice of StringPoint into an aggregator. If the aggregator is a StringBulkPointAggregator, it will use the AggregateBulk method.
func BinaryExprName ¶
func BinaryExprName(expr *BinaryExpr) string
BinaryExprName returns the name of a binary expression by concatenating the variables in the binary expression with underscores.
func BooleanCountReduce ¶
func BooleanCountReduce(prev *IntegerPoint, curr *BooleanPoint) (int64, int64, []interface{})
BooleanCountReduce returns the count of points.
func BooleanFirstReduce ¶
func BooleanFirstReduce(prev, curr *BooleanPoint) (int64, bool, []interface{})
BooleanFirstReduce returns the first point sorted by time.
func BooleanLastReduce ¶
func BooleanLastReduce(prev, curr *BooleanPoint) (int64, bool, []interface{})
BooleanLastReduce returns the first point sorted by time.
func BooleanMaxReduce ¶
func BooleanMaxReduce(prev, curr *BooleanPoint) (int64, bool, []interface{})
BooleanMaxReduce returns the minimum value between prev & curr.
func BooleanMinReduce ¶
func BooleanMinReduce(prev, curr *BooleanPoint) (int64, bool, []interface{})
BooleanMinReduce returns the minimum value between prev & curr.
func BooleanModeReduceSlice ¶
func BooleanModeReduceSlice(a []BooleanPoint) []BooleanPoint
BooleanModeReduceSlice returns the mode value within a window.
func ContainsVarRef ¶
func ContainsVarRef(expr Expr) bool
ContainsVarRef returns true if expr is a VarRef or contains one.
func DrainIterator ¶
func DrainIterator(itr Iterator)
DrainIterator reads and discards all points from itr.
func DrainIterators ¶
func DrainIterators(itrs []Iterator)
DrainIterators reads and discards all points from itrs.
func ErrDatabaseNotFound ¶
func ErrDatabaseNotFound(name string) error
ErrDatabaseNotFound returns a database not found error for the given database name.
func ErrMaxConcurrentQueriesLimitExceeded ¶
func ErrMaxConcurrentQueriesLimitExceeded(n, limit int) error
ErrMaxConcurrentQueriesLimitExceeded is an error when a query cannot be run because the maximum number of queries has been reached.
func ErrMaxSelectPointsLimitExceeded ¶
func ErrMaxSelectPointsLimitExceeded(n, limit int) error
ErrMaxSelectPointsLimitExceeded is an error when a query hits the maximum number of points.
func ErrMeasurementNotFound ¶
func ErrMeasurementNotFound(name string) error
ErrMeasurementNotFound returns a measurement not found error for the given measurement name.
func Eval ¶
func Eval(expr Expr, m map[string]interface{}) interface{}
Eval evaluates expr against a map.
func EvalBool ¶
func EvalBool(expr Expr, m map[string]interface{}) bool
EvalBool evaluates expr and returns true if result is a boolean true. Otherwise returns false.
func ExprNames ¶
func ExprNames(expr Expr) []VarRef
ExprNames returns a list of non-"time" field names from an expression.
func FieldDimensions ¶
func FieldDimensions(sources Sources, m FieldMapper) (fields map[string]DataType, dimensions map[string]struct{}, err error)
func FloatCountReduce ¶
func FloatCountReduce(prev *IntegerPoint, curr *FloatPoint) (int64, int64, []interface{})
FloatCountReduce returns the count of points.
func FloatFirstReduce ¶
func FloatFirstReduce(prev, curr *FloatPoint) (int64, float64, []interface{})
FloatFirstReduce returns the first point sorted by time.
func FloatLastReduce ¶
func FloatLastReduce(prev, curr *FloatPoint) (int64, float64, []interface{})
FloatLastReduce returns the last point sorted by time.
func FloatMaxReduce ¶
func FloatMaxReduce(prev, curr *FloatPoint) (int64, float64, []interface{})
FloatMaxReduce returns the maximum value between prev & curr.
func FloatMedianReduceSlice ¶
func FloatMedianReduceSlice(a []FloatPoint) []FloatPoint
FloatMedianReduceSlice returns the median value within a window.
func FloatMinReduce ¶
func FloatMinReduce(prev, curr *FloatPoint) (int64, float64, []interface{})
FloatMinReduce returns the minimum value between prev & curr.
func FloatModeReduceSlice ¶
func FloatModeReduceSlice(a []FloatPoint) []FloatPoint
FloatModeReduceSlice returns the mode value within a window.
func FloatSpreadReduceSlice ¶
func FloatSpreadReduceSlice(a []FloatPoint) []FloatPoint
FloatSpreadReduceSlice returns the spread value within a window.
func FloatStddevReduceSlice ¶
func FloatStddevReduceSlice(a []FloatPoint) []FloatPoint
FloatStddevReduceSlice returns the stddev value within a window.
func FloatSumReduce ¶
func FloatSumReduce(prev, curr *FloatPoint) (int64, float64, []interface{})
FloatSumReduce returns the sum prev value & curr value.
func FormatDuration ¶
func FormatDuration(d time.Duration) string
FormatDuration formats a duration to a string.
func HasTimeExpr ¶
func HasTimeExpr(expr Expr) bool
HasTimeExpr returns true if the expression has a time term.
func IdentNeedsQuotes ¶
func IdentNeedsQuotes(ident string) bool
IdentNeedsQuotes returns true if the ident string given would require quotes.
func InspectDataTypes ¶
func InspectDataTypes(a []interface{}) []DataType
InspectDataTypes returns all of the data types for an interface slice.
func IntegerCountReduce ¶
func IntegerCountReduce(prev, curr *IntegerPoint) (int64, int64, []interface{})
IntegerCountReduce returns the count of points.
func IntegerFirstReduce ¶
func IntegerFirstReduce(prev, curr *IntegerPoint) (int64, int64, []interface{})
IntegerFirstReduce returns the first point sorted by time.
func IntegerLastReduce ¶
func IntegerLastReduce(prev, curr *IntegerPoint) (int64, int64, []interface{})
IntegerLastReduce returns the last point sorted by time.
func IntegerMaxReduce ¶
func IntegerMaxReduce(prev, curr *IntegerPoint) (int64, int64, []interface{})
IntegerMaxReduce returns the maximum value between prev & curr.
func IntegerMedianReduceSlice ¶
func IntegerMedianReduceSlice(a []IntegerPoint) []FloatPoint
IntegerMedianReduceSlice returns the median value within a window.
func IntegerMinReduce ¶
func IntegerMinReduce(prev, curr *IntegerPoint) (int64, int64, []interface{})
IntegerMinReduce returns the minimum value between prev & curr.
func IntegerModeReduceSlice ¶
func IntegerModeReduceSlice(a []IntegerPoint) []IntegerPoint
IntegerModeReduceSlice returns the mode value within a window.
func IntegerSpreadReduceSlice ¶
func IntegerSpreadReduceSlice(a []IntegerPoint) []IntegerPoint
IntegerSpreadReduceSlice returns the spread value within a window.
func IntegerStddevReduceSlice ¶
func IntegerStddevReduceSlice(a []IntegerPoint) []FloatPoint
IntegerStddevReduceSlice returns the stddev value within a window.
func IntegerSumReduce ¶
func IntegerSumReduce(prev, curr *IntegerPoint) (int64, int64, []interface{})
IntegerSumReduce returns the sum prev value & curr value.
func IsRegexOp ¶
func IsRegexOp(t Token) bool
IsRegexOp returns true if the operator accepts a regex operand.
func IsSelector ¶
func IsSelector(expr Expr) bool
func IsSystemName ¶
func IsSystemName(name string) bool
IsSystemName returns true if name is an internal system name.
func LimitTagSets ¶
func LimitTagSets(a []*TagSet, slimit, soffset int) []*TagSet
LimitTagSets returns a tag set list with SLIMIT and SOFFSET applied.
func MatchSource ¶
func MatchSource(sources Sources, name string) string
MatchSource returns the source name that matches a field name. It returns a blank string if no sources match.
func OnlyTimeExpr ¶
func OnlyTimeExpr(expr Expr) bool
OnlyTimeExpr returns true if the expression only has time constraints.
func ParseDuration ¶
func ParseDuration(s string) (time.Duration, error)
ParseDuration parses a time duration from a string. This is needed instead of time.ParseDuration because this will support the full syntax that InfluxQL supports for specifying durations including weeks and days.
func QuoteIdent ¶
func QuoteIdent(segments ...string) string
QuoteIdent returns a quoted identifier from multiple bare identifiers.
func QuoteString ¶
func QuoteString(s string) string
QuoteString returns a quoted string.
func Sanitize ¶
func Sanitize(query string) string
Sanitize attempts to sanitize passwords out of a raw query. It looks for patterns that may be related to the SET PASSWORD and CREATE USER statements and will redact the password that should be there. It will attempt to redact information from common invalid queries too, but it's not guaranteed to succeed on improper queries.
This function works on the raw query and attempts to retain the original input as much as possible.
func ScanBareIdent ¶
func ScanBareIdent(r io.RuneScanner) string
ScanBareIdent reads bare identifier from a rune reader.
func ScanDelimited ¶
func ScanDelimited(r io.RuneScanner, start, end rune, escapes map[rune]rune, escapesPassThru bool) ([]byte, error)
ScanDelimited reads a delimited set of runes
func ScanString ¶
func ScanString(r io.RuneScanner) (string, error)
ScanString reads a quoted string from a rune reader.
func Select ¶
func Select(stmt *SelectStatement, ic IteratorCreator, sopt *SelectOptions) ([]Iterator, error)
Select executes stmt against ic and returns a list of iterators to stream from.
Statements should have all rewriting performed before calling select(). This includes wildcard and source expansion.
func StringCountReduce ¶
func StringCountReduce(prev *IntegerPoint, curr *StringPoint) (int64, int64, []interface{})
StringCountReduce returns the count of points.
func StringFirstReduce ¶
func StringFirstReduce(prev, curr *StringPoint) (int64, string, []interface{})
StringFirstReduce returns the first point sorted by time.
func StringLastReduce ¶
func StringLastReduce(prev, curr *StringPoint) (int64, string, []interface{})
StringLastReduce returns the first point sorted by time.
func StringModeReduceSlice ¶
func StringModeReduceSlice(a []StringPoint) []StringPoint
StringModeReduceSlice returns the mode value within a window.
func TimeRange ¶
func TimeRange(expr Expr) (min, max time.Time, err error)
TimeRange returns the minimum and maximum times specified by an expression. It returns zero times if there is no bound.
func TimeRangeAsEpochNano ¶
func TimeRangeAsEpochNano(expr Expr) (min, max int64, err error)
TimeRangeAsEpochNano returns the minimum and maximum times, as epoch nano, specified by an expression. If there is no lower bound, the minimum time is returned for minimum. If there is no higher bound, now is returned for maximum.
func Walk ¶
func Walk(v Visitor, node Node)
Walk traverses a node hierarchy in depth-first order.
func WalkFunc ¶
func WalkFunc(node Node, fn func(Node))
WalkFunc traverses a node hierarchy in depth-first order.
type AlterRetentionPolicyStatement ¶
AlterRetentionPolicyStatement represents a command to alter an existing retention policy.
type AlterRetentionPolicyStatement struct { // Name of policy to alter. Name string // Name of the database this policy belongs to. Database string // Duration data written to this policy will be retained. Duration *time.Duration // Replication factor for data written to this policy. Replication *int // Should this policy be set as defalut for the database? Default bool // Duration of the Shard. ShardGroupDuration *time.Duration }
func (*AlterRetentionPolicyStatement) DefaultDatabase ¶
func (s *AlterRetentionPolicyStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*AlterRetentionPolicyStatement) RequiredPrivileges ¶
func (s *AlterRetentionPolicyStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute an AlterRetentionPolicyStatement.
func (*AlterRetentionPolicyStatement) String ¶
func (s *AlterRetentionPolicyStatement) String() string
String returns a string representation of the alter retention policy statement.
type AuxIterator ¶
AuxIterator represents an iterator that can split off separate auxiliary iterators.
type AuxIterator interface { Iterator // Auxilary iterator Iterator(name string, typ DataType) Iterator // Start starts writing to the created iterators. Start() // Backgrounds the iterator so that, when start is called, it will // continuously read from the iterator. Background() }
func NewAuxIterator ¶
func NewAuxIterator(input Iterator, opt IteratorOptions) AuxIterator
NewAuxIterator returns a new instance of AuxIterator.
type BinaryExpr ¶
BinaryExpr represents an operation between two expressions.
type BinaryExpr struct { Op Token LHS Expr RHS Expr }
func (*BinaryExpr) String ¶
func (e *BinaryExpr) String() string
String returns a string representation of the binary expression.
type BooleanBulkPointAggregator ¶
BooleanBulkPointAggregator aggregates multiple points at a time.
type BooleanBulkPointAggregator interface { AggregateBooleanBulk(points []BooleanPoint) }
type BooleanDistinctReducer ¶
BooleanDistinctReducer returns the distinct points in a series.
type BooleanDistinctReducer struct {
// contains filtered or unexported fields
}
func NewBooleanDistinctReducer ¶
func NewBooleanDistinctReducer() *BooleanDistinctReducer
NewBooleanDistinctReducer creates a new BooleanDistinctReducer.
func (*BooleanDistinctReducer) AggregateBoolean ¶
func (r *BooleanDistinctReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean aggregates a point into the reducer.
func (*BooleanDistinctReducer) Emit ¶
func (r *BooleanDistinctReducer) Emit() []BooleanPoint
Emit emits the distinct points that have been aggregated into the reducer.
type BooleanElapsedReducer ¶
BooleanElapsedReducer calculates the elapsed of the aggregated points.
type BooleanElapsedReducer struct {
// contains filtered or unexported fields
}
func NewBooleanElapsedReducer ¶
func NewBooleanElapsedReducer(interval Interval) *BooleanElapsedReducer
NewBooleanElapsedReducer creates a new BooleanElapsedReducer.
func (*BooleanElapsedReducer) AggregateBoolean ¶
func (r *BooleanElapsedReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean aggregates a point into the reducer and updates the current window.
func (*BooleanElapsedReducer) Emit ¶
func (r *BooleanElapsedReducer) Emit() []IntegerPoint
Emit emits the elapsed of the reducer at the current point.
type BooleanFuncFloatReducer ¶
BooleanFuncFloatReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type BooleanFuncFloatReducer struct {
// contains filtered or unexported fields
}
func NewBooleanFuncFloatReducer ¶
func NewBooleanFuncFloatReducer(fn BooleanReduceFloatFunc, prev *FloatPoint) *BooleanFuncFloatReducer
NewBooleanFuncFloatReducer creates a new BooleanFuncFloatReducer.
func (*BooleanFuncFloatReducer) AggregateBoolean ¶
func (r *BooleanFuncFloatReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean takes a BooleanPoint and invokes the reduce function with the current and new point to modify the current point.
func (*BooleanFuncFloatReducer) Emit ¶
func (r *BooleanFuncFloatReducer) Emit() []FloatPoint
Emit emits the point that was generated when reducing the points fed in with AggregateBoolean.
type BooleanFuncIntegerReducer ¶
BooleanFuncIntegerReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type BooleanFuncIntegerReducer struct {
// contains filtered or unexported fields
}
func NewBooleanFuncIntegerReducer ¶
func NewBooleanFuncIntegerReducer(fn BooleanReduceIntegerFunc, prev *IntegerPoint) *BooleanFuncIntegerReducer
NewBooleanFuncIntegerReducer creates a new BooleanFuncIntegerReducer.
func (*BooleanFuncIntegerReducer) AggregateBoolean ¶
func (r *BooleanFuncIntegerReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean takes a BooleanPoint and invokes the reduce function with the current and new point to modify the current point.
func (*BooleanFuncIntegerReducer) Emit ¶
func (r *BooleanFuncIntegerReducer) Emit() []IntegerPoint
Emit emits the point that was generated when reducing the points fed in with AggregateBoolean.
type BooleanFuncReducer ¶
BooleanFuncReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type BooleanFuncReducer struct {
// contains filtered or unexported fields
}
func NewBooleanFuncReducer ¶
func NewBooleanFuncReducer(fn BooleanReduceFunc, prev *BooleanPoint) *BooleanFuncReducer
NewBooleanFuncReducer creates a new BooleanFuncBooleanReducer.
func (*BooleanFuncReducer) AggregateBoolean ¶
func (r *BooleanFuncReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean takes a BooleanPoint and invokes the reduce function with the current and new point to modify the current point.
func (*BooleanFuncReducer) Emit ¶
func (r *BooleanFuncReducer) Emit() []BooleanPoint
Emit emits the point that was generated when reducing the points fed in with AggregateBoolean.
type BooleanFuncStringReducer ¶
BooleanFuncStringReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type BooleanFuncStringReducer struct {
// contains filtered or unexported fields
}
func NewBooleanFuncStringReducer ¶
func NewBooleanFuncStringReducer(fn BooleanReduceStringFunc, prev *StringPoint) *BooleanFuncStringReducer
NewBooleanFuncStringReducer creates a new BooleanFuncStringReducer.
func (*BooleanFuncStringReducer) AggregateBoolean ¶
func (r *BooleanFuncStringReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean takes a BooleanPoint and invokes the reduce function with the current and new point to modify the current point.
func (*BooleanFuncStringReducer) Emit ¶
func (r *BooleanFuncStringReducer) Emit() []StringPoint
Emit emits the point that was generated when reducing the points fed in with AggregateBoolean.
type BooleanIterator ¶
BooleanIterator represents a stream of boolean points.
type BooleanIterator interface { Iterator Next() (*BooleanPoint, error) }
type BooleanLiteral ¶
BooleanLiteral represents a boolean literal.
type BooleanLiteral struct { Val bool }
func (*BooleanLiteral) String ¶
func (l *BooleanLiteral) String() string
String returns a string representation of the literal.
type BooleanPoint ¶
BooleanPoint represents a point with a bool value. DO NOT ADD ADDITIONAL FIELDS TO THIS STRUCT. See TestPoint_Fields in influxql/point_test.go for more details.
type BooleanPoint struct { Name string Tags Tags Time int64 Nil bool Value bool Aux []interface{} // Total number of points that were combined into this point from an aggregate. // If this is zero, the point is not the result of an aggregate function. Aggregated uint32 }
func (*BooleanPoint) Clone ¶
func (v *BooleanPoint) Clone() *BooleanPoint
Clone returns a copy of v.
func (*BooleanPoint) CopyTo ¶
func (v *BooleanPoint) CopyTo(other *BooleanPoint)
CopyTo makes a deep copy into the point.
type BooleanPointAggregator ¶
BooleanPointAggregator aggregates points to produce a single point.
type BooleanPointAggregator interface { AggregateBoolean(p *BooleanPoint) }
type BooleanPointDecoder ¶
BooleanPointDecoder decodes BooleanPoint points from a reader.
type BooleanPointDecoder struct {
// contains filtered or unexported fields
}
func NewBooleanPointDecoder ¶
func NewBooleanPointDecoder(r io.Reader) *BooleanPointDecoder
NewBooleanPointDecoder returns a new instance of BooleanPointDecoder that reads from r.
func (*BooleanPointDecoder) DecodeBooleanPoint ¶
func (dec *BooleanPointDecoder) DecodeBooleanPoint(p *BooleanPoint) error
DecodeBooleanPoint reads from the underlying reader and unmarshals into p.
func (*BooleanPointDecoder) Stats ¶
func (dec *BooleanPointDecoder) Stats() IteratorStats
Stats returns iterator stats embedded within the stream.
type BooleanPointEmitter ¶
BooleanPointEmitter produces a single point from an aggregate.
type BooleanPointEmitter interface { Emit() []BooleanPoint }
type BooleanPointEncoder ¶
BooleanPointEncoder encodes BooleanPoint points to a writer.
type BooleanPointEncoder struct {
// contains filtered or unexported fields
}
func NewBooleanPointEncoder ¶
func NewBooleanPointEncoder(w io.Writer) *BooleanPointEncoder
NewBooleanPointEncoder returns a new instance of BooleanPointEncoder that writes to w.
func (*BooleanPointEncoder) EncodeBooleanPoint ¶
func (enc *BooleanPointEncoder) EncodeBooleanPoint(p *BooleanPoint) error
EncodeBooleanPoint marshals and writes p to the underlying writer.
type BooleanReduceFloatFunc ¶
BooleanReduceFloatFunc is the function called by a BooleanPoint reducer.
type BooleanReduceFloatFunc func(prev *FloatPoint, curr *BooleanPoint) (t int64, v float64, aux []interface{})
type BooleanReduceFloatSliceFunc ¶
BooleanReduceFloatSliceFunc is the function called by a BooleanPoint reducer.
type BooleanReduceFloatSliceFunc func(a []BooleanPoint) []FloatPoint
type BooleanReduceFunc ¶
BooleanReduceFunc is the function called by a BooleanPoint reducer.
type BooleanReduceFunc func(prev *BooleanPoint, curr *BooleanPoint) (t int64, v bool, aux []interface{})
type BooleanReduceIntegerFunc ¶
BooleanReduceIntegerFunc is the function called by a BooleanPoint reducer.
type BooleanReduceIntegerFunc func(prev *IntegerPoint, curr *BooleanPoint) (t int64, v int64, aux []interface{})
type BooleanReduceIntegerSliceFunc ¶
BooleanReduceIntegerSliceFunc is the function called by a BooleanPoint reducer.
type BooleanReduceIntegerSliceFunc func(a []BooleanPoint) []IntegerPoint
type BooleanReduceSliceFunc ¶
BooleanReduceSliceFunc is the function called by a BooleanPoint reducer.
type BooleanReduceSliceFunc func(a []BooleanPoint) []BooleanPoint
type BooleanReduceStringFunc ¶
BooleanReduceStringFunc is the function called by a BooleanPoint reducer.
type BooleanReduceStringFunc func(prev *StringPoint, curr *BooleanPoint) (t int64, v string, aux []interface{})
type BooleanReduceStringSliceFunc ¶
BooleanReduceStringSliceFunc is the function called by a BooleanPoint reducer.
type BooleanReduceStringSliceFunc func(a []BooleanPoint) []StringPoint
type BooleanSampleReducer ¶
BooleanSampleReducer implements a reservoir sampling to calculate a random subset of points
type BooleanSampleReducer struct {
// contains filtered or unexported fields
}
func NewBooleanSampleReducer ¶
func NewBooleanSampleReducer(size int) *BooleanSampleReducer
NewBooleanSampleReducer creates a new BooleanSampleReducer
func (*BooleanSampleReducer) AggregateBoolean ¶
func (r *BooleanSampleReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean aggregates a point into the reducer.
func (*BooleanSampleReducer) Emit ¶
func (r *BooleanSampleReducer) Emit() []BooleanPoint
Emit emits the reservoir sample as many points.
type BooleanSliceFuncFloatReducer ¶
BooleanSliceFuncFloatReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type BooleanSliceFuncFloatReducer struct {
// contains filtered or unexported fields
}
func NewBooleanSliceFuncFloatReducer ¶
func NewBooleanSliceFuncFloatReducer(fn BooleanReduceFloatSliceFunc) *BooleanSliceFuncFloatReducer
NewBooleanSliceFuncFloatReducer creates a new BooleanSliceFuncFloatReducer.
func (*BooleanSliceFuncFloatReducer) AggregateBoolean ¶
func (r *BooleanSliceFuncFloatReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean copies the BooleanPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*BooleanSliceFuncFloatReducer) AggregateBooleanBulk ¶
func (r *BooleanSliceFuncFloatReducer) AggregateBooleanBulk(points []BooleanPoint)
AggregateBooleanBulk performs a bulk copy of BooleanPoints into the internal slice. This is a more efficient version of calling AggregateBoolean on each point.
func (*BooleanSliceFuncFloatReducer) Emit ¶
func (r *BooleanSliceFuncFloatReducer) Emit() []FloatPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type BooleanSliceFuncIntegerReducer ¶
BooleanSliceFuncIntegerReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type BooleanSliceFuncIntegerReducer struct {
// contains filtered or unexported fields
}
func NewBooleanSliceFuncIntegerReducer ¶
func NewBooleanSliceFuncIntegerReducer(fn BooleanReduceIntegerSliceFunc) *BooleanSliceFuncIntegerReducer
NewBooleanSliceFuncIntegerReducer creates a new BooleanSliceFuncIntegerReducer.
func (*BooleanSliceFuncIntegerReducer) AggregateBoolean ¶
func (r *BooleanSliceFuncIntegerReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean copies the BooleanPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*BooleanSliceFuncIntegerReducer) AggregateBooleanBulk ¶
func (r *BooleanSliceFuncIntegerReducer) AggregateBooleanBulk(points []BooleanPoint)
AggregateBooleanBulk performs a bulk copy of BooleanPoints into the internal slice. This is a more efficient version of calling AggregateBoolean on each point.
func (*BooleanSliceFuncIntegerReducer) Emit ¶
func (r *BooleanSliceFuncIntegerReducer) Emit() []IntegerPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type BooleanSliceFuncReducer ¶
BooleanSliceFuncReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type BooleanSliceFuncReducer struct {
// contains filtered or unexported fields
}
func NewBooleanSliceFuncReducer ¶
func NewBooleanSliceFuncReducer(fn BooleanReduceSliceFunc) *BooleanSliceFuncReducer
NewBooleanSliceFuncReducer creates a new BooleanSliceFuncReducer.
func (*BooleanSliceFuncReducer) AggregateBoolean ¶
func (r *BooleanSliceFuncReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean copies the BooleanPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*BooleanSliceFuncReducer) AggregateBooleanBulk ¶
func (r *BooleanSliceFuncReducer) AggregateBooleanBulk(points []BooleanPoint)
AggregateBooleanBulk performs a bulk copy of BooleanPoints into the internal slice. This is a more efficient version of calling AggregateBoolean on each point.
func (*BooleanSliceFuncReducer) Emit ¶
func (r *BooleanSliceFuncReducer) Emit() []BooleanPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type BooleanSliceFuncStringReducer ¶
BooleanSliceFuncStringReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type BooleanSliceFuncStringReducer struct {
// contains filtered or unexported fields
}
func NewBooleanSliceFuncStringReducer ¶
func NewBooleanSliceFuncStringReducer(fn BooleanReduceStringSliceFunc) *BooleanSliceFuncStringReducer
NewBooleanSliceFuncStringReducer creates a new BooleanSliceFuncStringReducer.
func (*BooleanSliceFuncStringReducer) AggregateBoolean ¶
func (r *BooleanSliceFuncStringReducer) AggregateBoolean(p *BooleanPoint)
AggregateBoolean copies the BooleanPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*BooleanSliceFuncStringReducer) AggregateBooleanBulk ¶
func (r *BooleanSliceFuncStringReducer) AggregateBooleanBulk(points []BooleanPoint)
AggregateBooleanBulk performs a bulk copy of BooleanPoints into the internal slice. This is a more efficient version of calling AggregateBoolean on each point.
func (*BooleanSliceFuncStringReducer) Emit ¶
func (r *BooleanSliceFuncStringReducer) Emit() []StringPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type Call ¶
Call represents a function call.
type Call struct { Name string Args []Expr }
func (*Call) String ¶
func (c *Call) String() string
String returns a string representation of the call.
type CreateContinuousQueryStatement ¶
CreateContinuousQueryStatement represents a command for creating a continuous query.
type CreateContinuousQueryStatement struct { // Name of the continuous query to be created. Name string // Name of the database to create the continuous query on. Database string // Source of data (SELECT statement). Source *SelectStatement // Interval to resample previous queries. ResampleEvery time.Duration // Maximum duration to resample previous queries. ResampleFor time.Duration }
func (*CreateContinuousQueryStatement) DefaultDatabase ¶
func (s *CreateContinuousQueryStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*CreateContinuousQueryStatement) RequiredPrivileges ¶
func (s *CreateContinuousQueryStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a CreateContinuousQueryStatement.
func (*CreateContinuousQueryStatement) String ¶
func (s *CreateContinuousQueryStatement) String() string
String returns a string representation of the statement.
type CreateDatabaseStatement ¶
CreateDatabaseStatement represents a command for creating a new database.
type CreateDatabaseStatement struct { // Name of the database to be created. Name string // RetentionPolicyCreate indicates whether the user explicitly wants to create a retention policy. RetentionPolicyCreate bool // RetentionPolicyDuration indicates retention duration for the new database. RetentionPolicyDuration *time.Duration // RetentionPolicyReplication indicates retention replication for the new database. RetentionPolicyReplication *int // RetentionPolicyName indicates retention name for the new database. RetentionPolicyName string // RetentionPolicyShardGroupDuration indicates shard group duration for the new database. RetentionPolicyShardGroupDuration time.Duration }
func (*CreateDatabaseStatement) RequiredPrivileges ¶
func (s *CreateDatabaseStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a CreateDatabaseStatement.
func (*CreateDatabaseStatement) String ¶
func (s *CreateDatabaseStatement) String() string
String returns a string representation of the create database statement.
type CreateRetentionPolicyStatement ¶
CreateRetentionPolicyStatement represents a command to create a retention policy.
type CreateRetentionPolicyStatement struct { // Name of policy to create. Name string // Name of database this policy belongs to. Database string // Duration data written to this policy will be retained. Duration time.Duration // Replication factor for data written to this policy. Replication int // Should this policy be set as default for the database? Default bool // Shard Duration. ShardGroupDuration time.Duration }
func (*CreateRetentionPolicyStatement) DefaultDatabase ¶
func (s *CreateRetentionPolicyStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*CreateRetentionPolicyStatement) RequiredPrivileges ¶
func (s *CreateRetentionPolicyStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a CreateRetentionPolicyStatement.
func (*CreateRetentionPolicyStatement) String ¶
func (s *CreateRetentionPolicyStatement) String() string
String returns a string representation of the create retention policy.
type CreateSubscriptionStatement ¶
CreateSubscriptionStatement represents a command to add a subscription to the incoming data stream.
type CreateSubscriptionStatement struct { Name string Database string RetentionPolicy string Destinations []string Mode string }
func (*CreateSubscriptionStatement) DefaultDatabase ¶
func (s *CreateSubscriptionStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*CreateSubscriptionStatement) RequiredPrivileges ¶
func (s *CreateSubscriptionStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a CreateSubscriptionStatement.
func (*CreateSubscriptionStatement) String ¶
func (s *CreateSubscriptionStatement) String() string
String returns a string representation of the CreateSubscriptionStatement.
type CreateUserStatement ¶
CreateUserStatement represents a command for creating a new user.
type CreateUserStatement struct { // Name of the user to be created. Name string // User's password. Password string // User's admin privilege. Admin bool }
func (*CreateUserStatement) RequiredPrivileges ¶
func (s *CreateUserStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a CreateUserStatement.
func (*CreateUserStatement) String ¶
func (s *CreateUserStatement) String() string
String returns a string representation of the create user statement.
type DataType ¶
DataType represents the primitive data types available in InfluxQL.
type DataType int
const ( // Unknown primitive data type. Unknown DataType = 0 // Float means the data type is a float. Float = 1 // Integer means the data type is an integer. Integer = 2 // String means the data type is a string of text. String = 3 // Boolean means the data type is a boolean. Boolean = 4 // Time means the data type is a time. Time = 5 // Duration means the data type is a duration of time. Duration = 6 // Tag means the data type is a tag. Tag = 7 // AnyField means the data type is any field. AnyField = 8 )
func EvalType ¶
func EvalType(expr Expr, sources Sources, typmap TypeMapper) DataType
EvalType evaluates the expression's type.
func InspectDataType ¶
func InspectDataType(v interface{}) DataType
InspectDataType returns the data type of a given value.
func (DataType) LessThan ¶
func (d DataType) LessThan(other DataType) bool
LessThan returns true if the other DataType has greater precedence than the current data type. Unknown has the lowest precedence.
NOTE: This is not the same as using the `<` or `>` operator because the integers used decrease with higher precedence, but Unknown is the lowest precedence at the zero value.
func (DataType) String ¶
func (d DataType) String() string
String returns the human-readable string representation of the DataType.
type DeleteSeriesStatement ¶
DeleteSeriesStatement represents a command for deleting all or part of a series from a database.
type DeleteSeriesStatement struct { // Data source that fields are extracted from (optional) Sources Sources // An expression evaluated on data point (optional) Condition Expr }
func (DeleteSeriesStatement) RequiredPrivileges ¶
func (s DeleteSeriesStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a DeleteSeriesStatement.
func (*DeleteSeriesStatement) String ¶
func (s *DeleteSeriesStatement) String() string
String returns a string representation of the delete series statement.
type DeleteStatement ¶
DeleteStatement represents a command for deleting data from the database.
type DeleteStatement struct { // Data source that values are removed from. Source Source // An expression evaluated on data point. Condition Expr }
func (*DeleteStatement) DefaultDatabase ¶
func (s *DeleteStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*DeleteStatement) RequiredPrivileges ¶
func (s *DeleteStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a DeleteStatement.
func (*DeleteStatement) String ¶
func (s *DeleteStatement) String() string
String returns a string representation of the delete statement.
type Dimension ¶
Dimension represents an expression that a select statement is grouped by.
type Dimension struct { Expr Expr }
func (*Dimension) String ¶
func (d *Dimension) String() string
String returns a string representation of the dimension.
type Dimensions ¶
Dimensions represents a list of dimensions.
type Dimensions []*Dimension
func (Dimensions) Normalize ¶
func (a Dimensions) Normalize() (time.Duration, []string)
Normalize returns the interval and tag dimensions separately. Returns 0 if no time interval is specified.
func (Dimensions) String ¶
func (a Dimensions) String() string
String returns a string representation of the dimensions.
type Distinct ¶
Distinct represents a DISTINCT expression.
type Distinct struct {
// Identifier following DISTINCT
Val string
}
func (*Distinct) NewCall ¶
func (d *Distinct) NewCall() *Call
NewCall returns a new call expression from this expressions.
func (*Distinct) String ¶
func (d *Distinct) String() string
String returns a string representation of the expression.
type DropContinuousQueryStatement ¶
DropContinuousQueryStatement represents a command for removing a continuous query.
type DropContinuousQueryStatement struct { Name string Database string }
func (*DropContinuousQueryStatement) DefaultDatabase ¶
func (s *DropContinuousQueryStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*DropContinuousQueryStatement) RequiredPrivileges ¶
func (s *DropContinuousQueryStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a DropContinuousQueryStatement
func (*DropContinuousQueryStatement) String ¶
func (s *DropContinuousQueryStatement) String() string
String returns a string representation of the statement.
type DropDatabaseStatement ¶
DropDatabaseStatement represents a command to drop a database.
type DropDatabaseStatement struct {
// Name of the database to be dropped.
Name string
}
func (*DropDatabaseStatement) RequiredPrivileges ¶
func (s *DropDatabaseStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a DropDatabaseStatement.
func (*DropDatabaseStatement) String ¶
func (s *DropDatabaseStatement) String() string
String returns a string representation of the drop database statement.
type DropMeasurementStatement ¶
DropMeasurementStatement represents a command to drop a measurement.
type DropMeasurementStatement struct {
// Name of the measurement to be dropped.
Name string
}
func (*DropMeasurementStatement) RequiredPrivileges ¶
func (s *DropMeasurementStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a DropMeasurementStatement
func (*DropMeasurementStatement) String ¶
func (s *DropMeasurementStatement) String() string
String returns a string representation of the drop measurement statement.
type DropRetentionPolicyStatement ¶
DropRetentionPolicyStatement represents a command to drop a retention policy from a database.
type DropRetentionPolicyStatement struct { // Name of the policy to drop. Name string // Name of the database to drop the policy from. Database string }
func (*DropRetentionPolicyStatement) DefaultDatabase ¶
func (s *DropRetentionPolicyStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*DropRetentionPolicyStatement) RequiredPrivileges ¶
func (s *DropRetentionPolicyStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a DropRetentionPolicyStatement.
func (*DropRetentionPolicyStatement) String ¶
func (s *DropRetentionPolicyStatement) String() string
String returns a string representation of the drop retention policy statement.
type DropSeriesStatement ¶
DropSeriesStatement represents a command for removing a series from the database.
type DropSeriesStatement struct { // Data source that fields are extracted from (optional) Sources Sources // An expression evaluated on data point (optional) Condition Expr }
func (DropSeriesStatement) RequiredPrivileges ¶
func (s DropSeriesStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a DropSeriesStatement.
func (*DropSeriesStatement) String ¶
func (s *DropSeriesStatement) String() string
String returns a string representation of the drop series statement.
type DropShardStatement ¶
DropShardStatement represents a command for removing a shard from the node.
type DropShardStatement struct {
// ID of the shard to be dropped.
ID uint64
}
func (*DropShardStatement) RequiredPrivileges ¶
func (s *DropShardStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a DropShardStatement.
func (*DropShardStatement) String ¶
func (s *DropShardStatement) String() string
String returns a string representation of the drop series statement.
type DropSubscriptionStatement ¶
DropSubscriptionStatement represents a command to drop a subscription to the incoming data stream.
type DropSubscriptionStatement struct { Name string Database string RetentionPolicy string }
func (*DropSubscriptionStatement) DefaultDatabase ¶
func (s *DropSubscriptionStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*DropSubscriptionStatement) RequiredPrivileges ¶
func (s *DropSubscriptionStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a DropSubscriptionStatement
func (*DropSubscriptionStatement) String ¶
func (s *DropSubscriptionStatement) String() string
String returns a string representation of the DropSubscriptionStatement.
type DropUserStatement ¶
DropUserStatement represents a command for dropping a user.
type DropUserStatement struct {
// Name of the user to drop.
Name string
}
func (*DropUserStatement) RequiredPrivileges ¶
func (s *DropUserStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a DropUserStatement.
func (*DropUserStatement) String ¶
func (s *DropUserStatement) String() string
String returns a string representation of the drop user statement.
type DurationLiteral ¶
DurationLiteral represents a duration literal.
type DurationLiteral struct { Val time.Duration }
func (*DurationLiteral) String ¶
func (l *DurationLiteral) String() string
String returns a string representation of the literal.
type Emitter ¶
Emitter groups values together by name, tags, and time.
type Emitter struct { // The columns to attach to each row. Columns []string // Removes the "time" column from output. // Used for meta queries where time does not apply. OmitTime bool // contains filtered or unexported fields }
func NewEmitter ¶
func NewEmitter(itrs []Iterator, ascending bool, chunkSize int) *Emitter
NewEmitter returns a new instance of Emitter that pulls from itrs.
func (*Emitter) Close ¶
func (e *Emitter) Close() error
Close closes the underlying iterators.
func (*Emitter) Emit ¶
func (e *Emitter) Emit() (*models.Row, bool, error)
Emit returns the next row from the iterators.
type ExecutionContext ¶
ExecutionContext contains state that the query is currently executing with.
type ExecutionContext struct { // The statement ID of the executing query. StatementID int // The query ID of the executing query. QueryID uint64 // The query task information available to the StatementExecutor. Query *QueryTask // Output channel where results and errors should be sent. Results chan *Result // Hold the query executor's logger. Log zap.Logger // A channel that is closed when the query is interrupted. InterruptCh <-chan struct{} // Options used to start this query. ExecutionOptions }
func (*ExecutionContext) Send ¶
func (ctx *ExecutionContext) Send(result *Result) error
Send sends a Result to the Results channel and will exit if the query has been interrupted or aborted.
type ExecutionOptions ¶
ExecutionOptions contains the options for executing a query.
type ExecutionOptions struct { // The database the query is running against. Database string // The requested maximum number of points to return in each result. ChunkSize int // If this query is being executed in a read-only context. ReadOnly bool // Node to execute on. NodeID uint64 // Quiet suppresses non-essential output from the query executor. Quiet bool // AbortCh is a channel that signals when results are no longer desired by the caller. AbortCh <-chan struct{} }
type ExecutionPrivilege ¶
ExecutionPrivilege is a privilege required for a user to execute a statement on a database or resource.
type ExecutionPrivilege struct { // Admin privilege required. Admin bool // Name of the database. Name string // Database privilege required. Privilege Privilege }
type ExecutionPrivileges ¶
ExecutionPrivileges is a list of privileges required to execute a statement.
type ExecutionPrivileges []ExecutionPrivilege
type Expr ¶
Expr represents an expression that can be evaluated to a value.
type Expr interface {
Node
// contains filtered or unexported methods
}
func CloneExpr ¶
func CloneExpr(expr Expr) Expr
CloneExpr returns a deep copy of the expression.
func MustParseExpr ¶
func MustParseExpr(s string) Expr
MustParseExpr parses an expression string and returns its AST. Panic on error.
func ParseExpr ¶
func ParseExpr(s string) (Expr, error)
ParseExpr parses an expression string and returns its AST representation.
func Reduce ¶
func Reduce(expr Expr, valuer Valuer) Expr
Reduce evaluates expr using the available values in valuer. References that don't exist in valuer are ignored.
func RewriteExpr ¶
func RewriteExpr(expr Expr, fn func(Expr) Expr) Expr
RewriteExpr recursively invokes the function to replace each expr. Nodes are traversed depth-first and rewritten from leaf to root.
type Field ¶
Field represents an expression retrieved from a select statement.
type Field struct { Expr Expr Alias string }
func (*Field) Name ¶
func (f *Field) Name() string
Name returns the name of the field. Returns alias, if set. Otherwise uses the function name or variable name.
func (*Field) String ¶
func (f *Field) String() string
String returns a string representation of the field.
type FieldMap ¶
type FieldMap int
func (FieldMap) Value ¶
func (i FieldMap) Value(tags Tags, buf []interface{}) interface{}
type FieldMapper ¶
FieldMapper returns the data type for the field inside of the measurement.
type FieldMapper interface { FieldDimensions(m *Measurement) (fields map[string]DataType, dimensions map[string]struct{}, err error) TypeMapper }
type Fields ¶
Fields represents a list of fields.
type Fields []*Field
func (Fields) AliasNames ¶
func (a Fields) AliasNames() []string
AliasNames returns a list of calculated field names in order of alias, function name, then field.
func (Fields) Len ¶
func (a Fields) Len() int
Len implements sort.Interface.
func (Fields) Less ¶
func (a Fields) Less(i, j int) bool
Less implements sort.Interface.
func (Fields) Names ¶
func (a Fields) Names() []string
Names returns a list of field names.
func (Fields) String ¶
func (a Fields) String() string
String returns a string representation of the fields.
func (Fields) Swap ¶
func (a Fields) Swap(i, j int)
Swap implements sort.Interface.
type FillOption ¶
FillOption represents different options for filling aggregate windows.
type FillOption int
const ( // NullFill means that empty aggregate windows will just have null values. NullFill FillOption = iota // NoFill means that empty aggregate windows will be purged from the result. NoFill // NumberFill means that empty aggregate windows will be filled with a provided number. NumberFill // PreviousFill means that empty aggregate windows will be filled with whatever the previous aggregate window had. PreviousFill // LinearFill means that empty aggregate windows will be filled with whatever a linear value between non null windows. LinearFill )
type FloatBulkPointAggregator ¶
FloatBulkPointAggregator aggregates multiple points at a time.
type FloatBulkPointAggregator interface { AggregateFloatBulk(points []FloatPoint) }
type FloatCumulativeSumReducer ¶
FloatCumulativeSumReducer cumulates the values from each point.
type FloatCumulativeSumReducer struct {
// contains filtered or unexported fields
}
func NewFloatCumulativeSumReducer ¶
func NewFloatCumulativeSumReducer() *FloatCumulativeSumReducer
NewFloatCumulativeSumReducer creates a new FloatCumulativeSumReducer.
func (*FloatCumulativeSumReducer) AggregateFloat ¶
func (r *FloatCumulativeSumReducer) AggregateFloat(p *FloatPoint)
func (*FloatCumulativeSumReducer) Emit ¶
func (r *FloatCumulativeSumReducer) Emit() []FloatPoint
type FloatDerivativeReducer ¶
FloatDerivativeReducer calculates the derivative of the aggregated points.
type FloatDerivativeReducer struct {
// contains filtered or unexported fields
}
func NewFloatDerivativeReducer ¶
func NewFloatDerivativeReducer(interval Interval, isNonNegative, ascending bool) *FloatDerivativeReducer
NewFloatDerivativeReducer creates a new FloatDerivativeReducer.
func (*FloatDerivativeReducer) AggregateFloat ¶
func (r *FloatDerivativeReducer) AggregateFloat(p *FloatPoint)
AggregateFloat aggregates a point into the reducer and updates the current window.
func (*FloatDerivativeReducer) Emit ¶
func (r *FloatDerivativeReducer) Emit() []FloatPoint
Emit emits the derivative of the reducer at the current point.
type FloatDifferenceReducer ¶
FloatDifferenceReducer calculates the derivative of the aggregated points.
type FloatDifferenceReducer struct {
// contains filtered or unexported fields
}
func NewFloatDifferenceReducer ¶
func NewFloatDifferenceReducer() *FloatDifferenceReducer
NewFloatDifferenceReducer creates a new FloatDifferenceReducer.
func (*FloatDifferenceReducer) AggregateFloat ¶
func (r *FloatDifferenceReducer) AggregateFloat(p *FloatPoint)
AggregateFloat aggregates a point into the reducer and updates the current window.
func (*FloatDifferenceReducer) Emit ¶
func (r *FloatDifferenceReducer) Emit() []FloatPoint
Emit emits the difference of the reducer at the current point.
type FloatDistinctReducer ¶
FloatDistinctReducer returns the distinct points in a series.
type FloatDistinctReducer struct {
// contains filtered or unexported fields
}
func NewFloatDistinctReducer ¶
func NewFloatDistinctReducer() *FloatDistinctReducer
NewFloatDistinctReducer creates a new FloatDistinctReducer.
func (*FloatDistinctReducer) AggregateFloat ¶
func (r *FloatDistinctReducer) AggregateFloat(p *FloatPoint)
AggregateFloat aggregates a point into the reducer.
func (*FloatDistinctReducer) Emit ¶
func (r *FloatDistinctReducer) Emit() []FloatPoint
Emit emits the distinct points that have been aggregated into the reducer.
type FloatElapsedReducer ¶
FloatElapsedReducer calculates the elapsed of the aggregated points.
type FloatElapsedReducer struct {
// contains filtered or unexported fields
}
func NewFloatElapsedReducer ¶
func NewFloatElapsedReducer(interval Interval) *FloatElapsedReducer
NewFloatElapsedReducer creates a new FloatElapsedReducer.
func (*FloatElapsedReducer) AggregateFloat ¶
func (r *FloatElapsedReducer) AggregateFloat(p *FloatPoint)
AggregateFloat aggregates a point into the reducer and updates the current window.
func (*FloatElapsedReducer) Emit ¶
func (r *FloatElapsedReducer) Emit() []IntegerPoint
Emit emits the elapsed of the reducer at the current point.
type FloatFuncBooleanReducer ¶
FloatFuncBooleanReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type FloatFuncBooleanReducer struct {
// contains filtered or unexported fields
}
func NewFloatFuncBooleanReducer ¶
func NewFloatFuncBooleanReducer(fn FloatReduceBooleanFunc, prev *BooleanPoint) *FloatFuncBooleanReducer
NewFloatFuncBooleanReducer creates a new FloatFuncBooleanReducer.
func (*FloatFuncBooleanReducer) AggregateFloat ¶
func (r *FloatFuncBooleanReducer) AggregateFloat(p *FloatPoint)
AggregateFloat takes a FloatPoint and invokes the reduce function with the current and new point to modify the current point.
func (*FloatFuncBooleanReducer) Emit ¶
func (r *FloatFuncBooleanReducer) Emit() []BooleanPoint
Emit emits the point that was generated when reducing the points fed in with AggregateFloat.
type FloatFuncIntegerReducer ¶
FloatFuncIntegerReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type FloatFuncIntegerReducer struct {
// contains filtered or unexported fields
}
func NewFloatFuncIntegerReducer ¶
func NewFloatFuncIntegerReducer(fn FloatReduceIntegerFunc, prev *IntegerPoint) *FloatFuncIntegerReducer
NewFloatFuncIntegerReducer creates a new FloatFuncIntegerReducer.
func (*FloatFuncIntegerReducer) AggregateFloat ¶
func (r *FloatFuncIntegerReducer) AggregateFloat(p *FloatPoint)
AggregateFloat takes a FloatPoint and invokes the reduce function with the current and new point to modify the current point.
func (*FloatFuncIntegerReducer) Emit ¶
func (r *FloatFuncIntegerReducer) Emit() []IntegerPoint
Emit emits the point that was generated when reducing the points fed in with AggregateFloat.
type FloatFuncReducer ¶
FloatFuncReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type FloatFuncReducer struct {
// contains filtered or unexported fields
}
func NewFloatFuncReducer ¶
func NewFloatFuncReducer(fn FloatReduceFunc, prev *FloatPoint) *FloatFuncReducer
NewFloatFuncReducer creates a new FloatFuncFloatReducer.
func (*FloatFuncReducer) AggregateFloat ¶
func (r *FloatFuncReducer) AggregateFloat(p *FloatPoint)
AggregateFloat takes a FloatPoint and invokes the reduce function with the current and new point to modify the current point.
func (*FloatFuncReducer) Emit ¶
func (r *FloatFuncReducer) Emit() []FloatPoint
Emit emits the point that was generated when reducing the points fed in with AggregateFloat.
type FloatFuncStringReducer ¶
FloatFuncStringReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type FloatFuncStringReducer struct {
// contains filtered or unexported fields
}
func NewFloatFuncStringReducer ¶
func NewFloatFuncStringReducer(fn FloatReduceStringFunc, prev *StringPoint) *FloatFuncStringReducer
NewFloatFuncStringReducer creates a new FloatFuncStringReducer.
func (*FloatFuncStringReducer) AggregateFloat ¶
func (r *FloatFuncStringReducer) AggregateFloat(p *FloatPoint)
AggregateFloat takes a FloatPoint and invokes the reduce function with the current and new point to modify the current point.
func (*FloatFuncStringReducer) Emit ¶
func (r *FloatFuncStringReducer) Emit() []StringPoint
Emit emits the point that was generated when reducing the points fed in with AggregateFloat.
type FloatHoltWintersReducer ¶
FloatHoltWintersReducer forecasts a series into the future. This is done using the Holt-Winters damped method.
1. Using the series the initial values are calculated using a SSE. 2. The series is forecasted into the future using the iterative relations.
type FloatHoltWintersReducer struct {
// contains filtered or unexported fields
}
func NewFloatHoltWintersReducer ¶
func NewFloatHoltWintersReducer(h, m int, includeFitData bool, interval time.Duration) *FloatHoltWintersReducer
NewFloatHoltWintersReducer creates a new FloatHoltWintersReducer.
func (*FloatHoltWintersReducer) AggregateFloat ¶
func (r *FloatHoltWintersReducer) AggregateFloat(p *FloatPoint)
AggregateFloat aggregates a point into the reducer and updates the current window.
func (*FloatHoltWintersReducer) AggregateInteger ¶
func (r *FloatHoltWintersReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger aggregates a point into the reducer and updates the current window.
func (*FloatHoltWintersReducer) Emit ¶
func (r *FloatHoltWintersReducer) Emit() []FloatPoint
Emit returns the points generated by the HoltWinters algorithm.
type FloatIterator ¶
FloatIterator represents a stream of float points.
type FloatIterator interface { Iterator Next() (*FloatPoint, error) }
type FloatMeanReducer ¶
FloatMeanReducer calculates the mean of the aggregated points.
type FloatMeanReducer struct {
// contains filtered or unexported fields
}
func NewFloatMeanReducer ¶
func NewFloatMeanReducer() *FloatMeanReducer
NewFloatMeanReducer creates a new FloatMeanReducer.
func (*FloatMeanReducer) AggregateFloat ¶
func (r *FloatMeanReducer) AggregateFloat(p *FloatPoint)
AggregateFloat aggregates a point into the reducer.
func (*FloatMeanReducer) Emit ¶
func (r *FloatMeanReducer) Emit() []FloatPoint
Emit emits the mean of the aggregated points as a single point.
type FloatMovingAverageReducer ¶
FloatMovingAverageReducer calculates the moving average of the aggregated points.
type FloatMovingAverageReducer struct {
// contains filtered or unexported fields
}
func NewFloatMovingAverageReducer ¶
func NewFloatMovingAverageReducer(n int) *FloatMovingAverageReducer
NewFloatMovingAverageReducer creates a new FloatMovingAverageReducer.
func (*FloatMovingAverageReducer) AggregateFloat ¶
func (r *FloatMovingAverageReducer) AggregateFloat(p *FloatPoint)
AggregateFloat aggregates a point into the reducer and updates the current window.
func (*FloatMovingAverageReducer) Emit ¶
func (r *FloatMovingAverageReducer) Emit() []FloatPoint
Emit emits the moving average of the current window. Emit should be called after every call to AggregateFloat and it will produce one point if there is enough data to fill a window, otherwise it will produce zero points.
type FloatPoint ¶
FloatPoint represents a point with a float64 value. DO NOT ADD ADDITIONAL FIELDS TO THIS STRUCT. See TestPoint_Fields in influxql/point_test.go for more details.
type FloatPoint struct { Name string Tags Tags Time int64 Nil bool Value float64 Aux []interface{} // Total number of points that were combined into this point from an aggregate. // If this is zero, the point is not the result of an aggregate function. Aggregated uint32 }
func (*FloatPoint) Clone ¶
func (v *FloatPoint) Clone() *FloatPoint
Clone returns a copy of v.
func (*FloatPoint) CopyTo ¶
func (v *FloatPoint) CopyTo(other *FloatPoint)
CopyTo makes a deep copy into the point.
type FloatPointAggregator ¶
FloatPointAggregator aggregates points to produce a single point.
type FloatPointAggregator interface { AggregateFloat(p *FloatPoint) }
type FloatPointDecoder ¶
FloatPointDecoder decodes FloatPoint points from a reader.
type FloatPointDecoder struct {
// contains filtered or unexported fields
}
func NewFloatPointDecoder ¶
func NewFloatPointDecoder(r io.Reader) *FloatPointDecoder
NewFloatPointDecoder returns a new instance of FloatPointDecoder that reads from r.
func (*FloatPointDecoder) DecodeFloatPoint ¶
func (dec *FloatPointDecoder) DecodeFloatPoint(p *FloatPoint) error
DecodeFloatPoint reads from the underlying reader and unmarshals into p.
func (*FloatPointDecoder) Stats ¶
func (dec *FloatPointDecoder) Stats() IteratorStats
Stats returns iterator stats embedded within the stream.
type FloatPointEmitter ¶
FloatPointEmitter produces a single point from an aggregate.
type FloatPointEmitter interface { Emit() []FloatPoint }
type FloatPointEncoder ¶
FloatPointEncoder encodes FloatPoint points to a writer.
type FloatPointEncoder struct {
// contains filtered or unexported fields
}
func NewFloatPointEncoder ¶
func NewFloatPointEncoder(w io.Writer) *FloatPointEncoder
NewFloatPointEncoder returns a new instance of FloatPointEncoder that writes to w.
func (*FloatPointEncoder) EncodeFloatPoint ¶
func (enc *FloatPointEncoder) EncodeFloatPoint(p *FloatPoint) error
EncodeFloatPoint marshals and writes p to the underlying writer.
type FloatReduceBooleanFunc ¶
FloatReduceBooleanFunc is the function called by a FloatPoint reducer.
type FloatReduceBooleanFunc func(prev *BooleanPoint, curr *FloatPoint) (t int64, v bool, aux []interface{})
type FloatReduceBooleanSliceFunc ¶
FloatReduceBooleanSliceFunc is the function called by a FloatPoint reducer.
type FloatReduceBooleanSliceFunc func(a []FloatPoint) []BooleanPoint
type FloatReduceFunc ¶
FloatReduceFunc is the function called by a FloatPoint reducer.
type FloatReduceFunc func(prev *FloatPoint, curr *FloatPoint) (t int64, v float64, aux []interface{})
type FloatReduceIntegerFunc ¶
FloatReduceIntegerFunc is the function called by a FloatPoint reducer.
type FloatReduceIntegerFunc func(prev *IntegerPoint, curr *FloatPoint) (t int64, v int64, aux []interface{})
type FloatReduceIntegerSliceFunc ¶
FloatReduceIntegerSliceFunc is the function called by a FloatPoint reducer.
type FloatReduceIntegerSliceFunc func(a []FloatPoint) []IntegerPoint
type FloatReduceSliceFunc ¶
FloatReduceSliceFunc is the function called by a FloatPoint reducer.
type FloatReduceSliceFunc func(a []FloatPoint) []FloatPoint
func NewFloatBottomReduceSliceFunc ¶
func NewFloatBottomReduceSliceFunc(n int, tags []int, interval Interval) FloatReduceSliceFunc
NewFloatBottomReduceSliceFunc returns the bottom values within a window.
func NewFloatPercentileReduceSliceFunc ¶
func NewFloatPercentileReduceSliceFunc(percentile float64) FloatReduceSliceFunc
NewFloatPercentileReduceSliceFunc returns the percentile value within a window.
func NewFloatTopReduceSliceFunc ¶
func NewFloatTopReduceSliceFunc(n int, tags []int, interval Interval) FloatReduceSliceFunc
NewFloatTopReduceSliceFunc returns the top values within a window.
type FloatReduceStringFunc ¶
FloatReduceStringFunc is the function called by a FloatPoint reducer.
type FloatReduceStringFunc func(prev *StringPoint, curr *FloatPoint) (t int64, v string, aux []interface{})
type FloatReduceStringSliceFunc ¶
FloatReduceStringSliceFunc is the function called by a FloatPoint reducer.
type FloatReduceStringSliceFunc func(a []FloatPoint) []StringPoint
type FloatSampleReducer ¶
FloatSampleReducer implements a reservoir sampling to calculate a random subset of points
type FloatSampleReducer struct {
// contains filtered or unexported fields
}
func NewFloatSampleReducer ¶
func NewFloatSampleReducer(size int) *FloatSampleReducer
NewFloatSampleReducer creates a new FloatSampleReducer
func (*FloatSampleReducer) AggregateFloat ¶
func (r *FloatSampleReducer) AggregateFloat(p *FloatPoint)
AggregateFloat aggregates a point into the reducer.
func (*FloatSampleReducer) Emit ¶
func (r *FloatSampleReducer) Emit() []FloatPoint
Emit emits the reservoir sample as many points.
type FloatSliceFuncBooleanReducer ¶
FloatSliceFuncBooleanReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type FloatSliceFuncBooleanReducer struct {
// contains filtered or unexported fields
}
func NewFloatSliceFuncBooleanReducer ¶
func NewFloatSliceFuncBooleanReducer(fn FloatReduceBooleanSliceFunc) *FloatSliceFuncBooleanReducer
NewFloatSliceFuncBooleanReducer creates a new FloatSliceFuncBooleanReducer.
func (*FloatSliceFuncBooleanReducer) AggregateFloat ¶
func (r *FloatSliceFuncBooleanReducer) AggregateFloat(p *FloatPoint)
AggregateFloat copies the FloatPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*FloatSliceFuncBooleanReducer) AggregateFloatBulk ¶
func (r *FloatSliceFuncBooleanReducer) AggregateFloatBulk(points []FloatPoint)
AggregateFloatBulk performs a bulk copy of FloatPoints into the internal slice. This is a more efficient version of calling AggregateFloat on each point.
func (*FloatSliceFuncBooleanReducer) Emit ¶
func (r *FloatSliceFuncBooleanReducer) Emit() []BooleanPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type FloatSliceFuncIntegerReducer ¶
FloatSliceFuncIntegerReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type FloatSliceFuncIntegerReducer struct {
// contains filtered or unexported fields
}
func NewFloatSliceFuncIntegerReducer ¶
func NewFloatSliceFuncIntegerReducer(fn FloatReduceIntegerSliceFunc) *FloatSliceFuncIntegerReducer
NewFloatSliceFuncIntegerReducer creates a new FloatSliceFuncIntegerReducer.
func (*FloatSliceFuncIntegerReducer) AggregateFloat ¶
func (r *FloatSliceFuncIntegerReducer) AggregateFloat(p *FloatPoint)
AggregateFloat copies the FloatPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*FloatSliceFuncIntegerReducer) AggregateFloatBulk ¶
func (r *FloatSliceFuncIntegerReducer) AggregateFloatBulk(points []FloatPoint)
AggregateFloatBulk performs a bulk copy of FloatPoints into the internal slice. This is a more efficient version of calling AggregateFloat on each point.
func (*FloatSliceFuncIntegerReducer) Emit ¶
func (r *FloatSliceFuncIntegerReducer) Emit() []IntegerPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type FloatSliceFuncReducer ¶
FloatSliceFuncReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type FloatSliceFuncReducer struct {
// contains filtered or unexported fields
}
func NewFloatSliceFuncReducer ¶
func NewFloatSliceFuncReducer(fn FloatReduceSliceFunc) *FloatSliceFuncReducer
NewFloatSliceFuncReducer creates a new FloatSliceFuncReducer.
func (*FloatSliceFuncReducer) AggregateFloat ¶
func (r *FloatSliceFuncReducer) AggregateFloat(p *FloatPoint)
AggregateFloat copies the FloatPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*FloatSliceFuncReducer) AggregateFloatBulk ¶
func (r *FloatSliceFuncReducer) AggregateFloatBulk(points []FloatPoint)
AggregateFloatBulk performs a bulk copy of FloatPoints into the internal slice. This is a more efficient version of calling AggregateFloat on each point.
func (*FloatSliceFuncReducer) Emit ¶
func (r *FloatSliceFuncReducer) Emit() []FloatPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type FloatSliceFuncStringReducer ¶
FloatSliceFuncStringReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type FloatSliceFuncStringReducer struct {
// contains filtered or unexported fields
}
func NewFloatSliceFuncStringReducer ¶
func NewFloatSliceFuncStringReducer(fn FloatReduceStringSliceFunc) *FloatSliceFuncStringReducer
NewFloatSliceFuncStringReducer creates a new FloatSliceFuncStringReducer.
func (*FloatSliceFuncStringReducer) AggregateFloat ¶
func (r *FloatSliceFuncStringReducer) AggregateFloat(p *FloatPoint)
AggregateFloat copies the FloatPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*FloatSliceFuncStringReducer) AggregateFloatBulk ¶
func (r *FloatSliceFuncStringReducer) AggregateFloatBulk(points []FloatPoint)
AggregateFloatBulk performs a bulk copy of FloatPoints into the internal slice. This is a more efficient version of calling AggregateFloat on each point.
func (*FloatSliceFuncStringReducer) Emit ¶
func (r *FloatSliceFuncStringReducer) Emit() []StringPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type GrantAdminStatement ¶
GrantAdminStatement represents a command for granting admin privilege.
type GrantAdminStatement struct {
// Who to grant the privilege to.
User string
}
func (*GrantAdminStatement) RequiredPrivileges ¶
func (s *GrantAdminStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a GrantAdminStatement.
func (*GrantAdminStatement) String ¶
func (s *GrantAdminStatement) String() string
String returns a string representation of the grant admin statement.
type GrantStatement ¶
GrantStatement represents a command for granting a privilege.
type GrantStatement struct { // The privilege to be granted. Privilege Privilege // Database to grant the privilege to. On string // Who to grant the privilege to. User string }
func (*GrantStatement) DefaultDatabase ¶
func (s *GrantStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*GrantStatement) RequiredPrivileges ¶
func (s *GrantStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a GrantStatement.
func (*GrantStatement) String ¶
func (s *GrantStatement) String() string
String returns a string representation of the grant statement.
type HasDefaultDatabase ¶
HasDefaultDatabase provides an interface to get the default database from a Statement.
type HasDefaultDatabase interface {
Node
DefaultDatabase() string
// contains filtered or unexported methods
}
type IntegerBulkPointAggregator ¶
IntegerBulkPointAggregator aggregates multiple points at a time.
type IntegerBulkPointAggregator interface { AggregateIntegerBulk(points []IntegerPoint) }
type IntegerCumulativeSumReducer ¶
IntegerCumulativeSumReducer cumulates the values from each point.
type IntegerCumulativeSumReducer struct {
// contains filtered or unexported fields
}
func NewIntegerCumulativeSumReducer ¶
func NewIntegerCumulativeSumReducer() *IntegerCumulativeSumReducer
NewIntegerCumulativeSumReducer creates a new IntegerCumulativeSumReducer.
func (*IntegerCumulativeSumReducer) AggregateInteger ¶
func (r *IntegerCumulativeSumReducer) AggregateInteger(p *IntegerPoint)
func (*IntegerCumulativeSumReducer) Emit ¶
func (r *IntegerCumulativeSumReducer) Emit() []IntegerPoint
type IntegerDerivativeReducer ¶
IntegerDerivativeReducer calculates the derivative of the aggregated points.
type IntegerDerivativeReducer struct {
// contains filtered or unexported fields
}
func NewIntegerDerivativeReducer ¶
func NewIntegerDerivativeReducer(interval Interval, isNonNegative, ascending bool) *IntegerDerivativeReducer
NewIntegerDerivativeReducer creates a new IntegerDerivativeReducer.
func (*IntegerDerivativeReducer) AggregateInteger ¶
func (r *IntegerDerivativeReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger aggregates a point into the reducer and updates the current window.
func (*IntegerDerivativeReducer) Emit ¶
func (r *IntegerDerivativeReducer) Emit() []FloatPoint
Emit emits the derivative of the reducer at the current point.
type IntegerDifferenceReducer ¶
IntegerDifferenceReducer calculates the derivative of the aggregated points.
type IntegerDifferenceReducer struct {
// contains filtered or unexported fields
}
func NewIntegerDifferenceReducer ¶
func NewIntegerDifferenceReducer() *IntegerDifferenceReducer
NewIntegerDifferenceReducer creates a new IntegerDifferenceReducer.
func (*IntegerDifferenceReducer) AggregateInteger ¶
func (r *IntegerDifferenceReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger aggregates a point into the reducer and updates the current window.
func (*IntegerDifferenceReducer) Emit ¶
func (r *IntegerDifferenceReducer) Emit() []IntegerPoint
Emit emits the difference of the reducer at the current point.
type IntegerDistinctReducer ¶
IntegerDistinctReducer returns the distinct points in a series.
type IntegerDistinctReducer struct {
// contains filtered or unexported fields
}
func NewIntegerDistinctReducer ¶
func NewIntegerDistinctReducer() *IntegerDistinctReducer
NewIntegerDistinctReducer creates a new IntegerDistinctReducer.
func (*IntegerDistinctReducer) AggregateInteger ¶
func (r *IntegerDistinctReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger aggregates a point into the reducer.
func (*IntegerDistinctReducer) Emit ¶
func (r *IntegerDistinctReducer) Emit() []IntegerPoint
Emit emits the distinct points that have been aggregated into the reducer.
type IntegerElapsedReducer ¶
IntegerElapsedReducer calculates the elapsed of the aggregated points.
type IntegerElapsedReducer struct {
// contains filtered or unexported fields
}
func NewIntegerElapsedReducer ¶
func NewIntegerElapsedReducer(interval Interval) *IntegerElapsedReducer
NewIntegerElapsedReducer creates a new IntegerElapsedReducer.
func (*IntegerElapsedReducer) AggregateInteger ¶
func (r *IntegerElapsedReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger aggregates a point into the reducer and updates the current window.
func (*IntegerElapsedReducer) Emit ¶
func (r *IntegerElapsedReducer) Emit() []IntegerPoint
Emit emits the elapsed of the reducer at the current point.
type IntegerFuncBooleanReducer ¶
IntegerFuncBooleanReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type IntegerFuncBooleanReducer struct {
// contains filtered or unexported fields
}
func NewIntegerFuncBooleanReducer ¶
func NewIntegerFuncBooleanReducer(fn IntegerReduceBooleanFunc, prev *BooleanPoint) *IntegerFuncBooleanReducer
NewIntegerFuncBooleanReducer creates a new IntegerFuncBooleanReducer.
func (*IntegerFuncBooleanReducer) AggregateInteger ¶
func (r *IntegerFuncBooleanReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger takes a IntegerPoint and invokes the reduce function with the current and new point to modify the current point.
func (*IntegerFuncBooleanReducer) Emit ¶
func (r *IntegerFuncBooleanReducer) Emit() []BooleanPoint
Emit emits the point that was generated when reducing the points fed in with AggregateInteger.
type IntegerFuncFloatReducer ¶
IntegerFuncFloatReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type IntegerFuncFloatReducer struct {
// contains filtered or unexported fields
}
func NewIntegerFuncFloatReducer ¶
func NewIntegerFuncFloatReducer(fn IntegerReduceFloatFunc, prev *FloatPoint) *IntegerFuncFloatReducer
NewIntegerFuncFloatReducer creates a new IntegerFuncFloatReducer.
func (*IntegerFuncFloatReducer) AggregateInteger ¶
func (r *IntegerFuncFloatReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger takes a IntegerPoint and invokes the reduce function with the current and new point to modify the current point.
func (*IntegerFuncFloatReducer) Emit ¶
func (r *IntegerFuncFloatReducer) Emit() []FloatPoint
Emit emits the point that was generated when reducing the points fed in with AggregateInteger.
type IntegerFuncReducer ¶
IntegerFuncReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type IntegerFuncReducer struct {
// contains filtered or unexported fields
}
func NewIntegerFuncReducer ¶
func NewIntegerFuncReducer(fn IntegerReduceFunc, prev *IntegerPoint) *IntegerFuncReducer
NewIntegerFuncReducer creates a new IntegerFuncIntegerReducer.
func (*IntegerFuncReducer) AggregateInteger ¶
func (r *IntegerFuncReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger takes a IntegerPoint and invokes the reduce function with the current and new point to modify the current point.
func (*IntegerFuncReducer) Emit ¶
func (r *IntegerFuncReducer) Emit() []IntegerPoint
Emit emits the point that was generated when reducing the points fed in with AggregateInteger.
type IntegerFuncStringReducer ¶
IntegerFuncStringReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type IntegerFuncStringReducer struct {
// contains filtered or unexported fields
}
func NewIntegerFuncStringReducer ¶
func NewIntegerFuncStringReducer(fn IntegerReduceStringFunc, prev *StringPoint) *IntegerFuncStringReducer
NewIntegerFuncStringReducer creates a new IntegerFuncStringReducer.
func (*IntegerFuncStringReducer) AggregateInteger ¶
func (r *IntegerFuncStringReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger takes a IntegerPoint and invokes the reduce function with the current and new point to modify the current point.
func (*IntegerFuncStringReducer) Emit ¶
func (r *IntegerFuncStringReducer) Emit() []StringPoint
Emit emits the point that was generated when reducing the points fed in with AggregateInteger.
type IntegerIterator ¶
IntegerIterator represents a stream of integer points.
type IntegerIterator interface { Iterator Next() (*IntegerPoint, error) }
type IntegerLiteral ¶
IntegerLiteral represents an integer literal.
type IntegerLiteral struct { Val int64 }
func (*IntegerLiteral) String ¶
func (l *IntegerLiteral) String() string
String returns a string representation of the literal.
type IntegerMeanReducer ¶
IntegerMeanReducer calculates the mean of the aggregated points.
type IntegerMeanReducer struct {
// contains filtered or unexported fields
}
func NewIntegerMeanReducer ¶
func NewIntegerMeanReducer() *IntegerMeanReducer
NewIntegerMeanReducer creates a new IntegerMeanReducer.
func (*IntegerMeanReducer) AggregateInteger ¶
func (r *IntegerMeanReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger aggregates a point into the reducer.
func (*IntegerMeanReducer) Emit ¶
func (r *IntegerMeanReducer) Emit() []FloatPoint
Emit emits the mean of the aggregated points as a single point.
type IntegerMovingAverageReducer ¶
IntegerMovingAverageReducer calculates the moving average of the aggregated points.
type IntegerMovingAverageReducer struct {
// contains filtered or unexported fields
}
func NewIntegerMovingAverageReducer ¶
func NewIntegerMovingAverageReducer(n int) *IntegerMovingAverageReducer
NewIntegerMovingAverageReducer creates a new IntegerMovingAverageReducer.
func (*IntegerMovingAverageReducer) AggregateInteger ¶
func (r *IntegerMovingAverageReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger aggregates a point into the reducer and updates the current window.
func (*IntegerMovingAverageReducer) Emit ¶
func (r *IntegerMovingAverageReducer) Emit() []FloatPoint
Emit emits the moving average of the current window. Emit should be called after every call to AggregateInteger and it will produce one point if there is enough data to fill a window, otherwise it will produce zero points.
type IntegerPoint ¶
IntegerPoint represents a point with a int64 value. DO NOT ADD ADDITIONAL FIELDS TO THIS STRUCT. See TestPoint_Fields in influxql/point_test.go for more details.
type IntegerPoint struct { Name string Tags Tags Time int64 Nil bool Value int64 Aux []interface{} // Total number of points that were combined into this point from an aggregate. // If this is zero, the point is not the result of an aggregate function. Aggregated uint32 }
func (*IntegerPoint) Clone ¶
func (v *IntegerPoint) Clone() *IntegerPoint
Clone returns a copy of v.
func (*IntegerPoint) CopyTo ¶
func (v *IntegerPoint) CopyTo(other *IntegerPoint)
CopyTo makes a deep copy into the point.
type IntegerPointAggregator ¶
IntegerPointAggregator aggregates points to produce a single point.
type IntegerPointAggregator interface { AggregateInteger(p *IntegerPoint) }
type IntegerPointDecoder ¶
IntegerPointDecoder decodes IntegerPoint points from a reader.
type IntegerPointDecoder struct {
// contains filtered or unexported fields
}
func NewIntegerPointDecoder ¶
func NewIntegerPointDecoder(r io.Reader) *IntegerPointDecoder
NewIntegerPointDecoder returns a new instance of IntegerPointDecoder that reads from r.
func (*IntegerPointDecoder) DecodeIntegerPoint ¶
func (dec *IntegerPointDecoder) DecodeIntegerPoint(p *IntegerPoint) error
DecodeIntegerPoint reads from the underlying reader and unmarshals into p.
func (*IntegerPointDecoder) Stats ¶
func (dec *IntegerPointDecoder) Stats() IteratorStats
Stats returns iterator stats embedded within the stream.
type IntegerPointEmitter ¶
IntegerPointEmitter produces a single point from an aggregate.
type IntegerPointEmitter interface { Emit() []IntegerPoint }
type IntegerPointEncoder ¶
IntegerPointEncoder encodes IntegerPoint points to a writer.
type IntegerPointEncoder struct {
// contains filtered or unexported fields
}
func NewIntegerPointEncoder ¶
func NewIntegerPointEncoder(w io.Writer) *IntegerPointEncoder
NewIntegerPointEncoder returns a new instance of IntegerPointEncoder that writes to w.
func (*IntegerPointEncoder) EncodeIntegerPoint ¶
func (enc *IntegerPointEncoder) EncodeIntegerPoint(p *IntegerPoint) error
EncodeIntegerPoint marshals and writes p to the underlying writer.
type IntegerReduceBooleanFunc ¶
IntegerReduceBooleanFunc is the function called by a IntegerPoint reducer.
type IntegerReduceBooleanFunc func(prev *BooleanPoint, curr *IntegerPoint) (t int64, v bool, aux []interface{})
type IntegerReduceBooleanSliceFunc ¶
IntegerReduceBooleanSliceFunc is the function called by a IntegerPoint reducer.
type IntegerReduceBooleanSliceFunc func(a []IntegerPoint) []BooleanPoint
type IntegerReduceFloatFunc ¶
IntegerReduceFloatFunc is the function called by a IntegerPoint reducer.
type IntegerReduceFloatFunc func(prev *FloatPoint, curr *IntegerPoint) (t int64, v float64, aux []interface{})
type IntegerReduceFloatSliceFunc ¶
IntegerReduceFloatSliceFunc is the function called by a IntegerPoint reducer.
type IntegerReduceFloatSliceFunc func(a []IntegerPoint) []FloatPoint
type IntegerReduceFunc ¶
IntegerReduceFunc is the function called by a IntegerPoint reducer.
type IntegerReduceFunc func(prev *IntegerPoint, curr *IntegerPoint) (t int64, v int64, aux []interface{})
type IntegerReduceSliceFunc ¶
IntegerReduceSliceFunc is the function called by a IntegerPoint reducer.
type IntegerReduceSliceFunc func(a []IntegerPoint) []IntegerPoint
func NewIntegerBottomReduceSliceFunc ¶
func NewIntegerBottomReduceSliceFunc(n int, tags []int, interval Interval) IntegerReduceSliceFunc
NewIntegerBottomReduceSliceFunc returns the bottom values within a window.
func NewIntegerPercentileReduceSliceFunc ¶
func NewIntegerPercentileReduceSliceFunc(percentile float64) IntegerReduceSliceFunc
NewIntegerPercentileReduceSliceFunc returns the percentile value within a window.
func NewIntegerTopReduceSliceFunc ¶
func NewIntegerTopReduceSliceFunc(n int, tags []int, interval Interval) IntegerReduceSliceFunc
NewIntegerTopReduceSliceFunc returns the top values within a window.
type IntegerReduceStringFunc ¶
IntegerReduceStringFunc is the function called by a IntegerPoint reducer.
type IntegerReduceStringFunc func(prev *StringPoint, curr *IntegerPoint) (t int64, v string, aux []interface{})
type IntegerReduceStringSliceFunc ¶
IntegerReduceStringSliceFunc is the function called by a IntegerPoint reducer.
type IntegerReduceStringSliceFunc func(a []IntegerPoint) []StringPoint
type IntegerSampleReducer ¶
IntegerSampleReducer implements a reservoir sampling to calculate a random subset of points
type IntegerSampleReducer struct {
// contains filtered or unexported fields
}
func NewIntegerSampleReducer ¶
func NewIntegerSampleReducer(size int) *IntegerSampleReducer
NewIntegerSampleReducer creates a new IntegerSampleReducer
func (*IntegerSampleReducer) AggregateInteger ¶
func (r *IntegerSampleReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger aggregates a point into the reducer.
func (*IntegerSampleReducer) Emit ¶
func (r *IntegerSampleReducer) Emit() []IntegerPoint
Emit emits the reservoir sample as many points.
type IntegerSliceFuncBooleanReducer ¶
IntegerSliceFuncBooleanReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type IntegerSliceFuncBooleanReducer struct {
// contains filtered or unexported fields
}
func NewIntegerSliceFuncBooleanReducer ¶
func NewIntegerSliceFuncBooleanReducer(fn IntegerReduceBooleanSliceFunc) *IntegerSliceFuncBooleanReducer
NewIntegerSliceFuncBooleanReducer creates a new IntegerSliceFuncBooleanReducer.
func (*IntegerSliceFuncBooleanReducer) AggregateInteger ¶
func (r *IntegerSliceFuncBooleanReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger copies the IntegerPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*IntegerSliceFuncBooleanReducer) AggregateIntegerBulk ¶
func (r *IntegerSliceFuncBooleanReducer) AggregateIntegerBulk(points []IntegerPoint)
AggregateIntegerBulk performs a bulk copy of IntegerPoints into the internal slice. This is a more efficient version of calling AggregateInteger on each point.
func (*IntegerSliceFuncBooleanReducer) Emit ¶
func (r *IntegerSliceFuncBooleanReducer) Emit() []BooleanPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type IntegerSliceFuncFloatReducer ¶
IntegerSliceFuncFloatReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type IntegerSliceFuncFloatReducer struct {
// contains filtered or unexported fields
}
func NewIntegerSliceFuncFloatReducer ¶
func NewIntegerSliceFuncFloatReducer(fn IntegerReduceFloatSliceFunc) *IntegerSliceFuncFloatReducer
NewIntegerSliceFuncFloatReducer creates a new IntegerSliceFuncFloatReducer.
func (*IntegerSliceFuncFloatReducer) AggregateInteger ¶
func (r *IntegerSliceFuncFloatReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger copies the IntegerPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*IntegerSliceFuncFloatReducer) AggregateIntegerBulk ¶
func (r *IntegerSliceFuncFloatReducer) AggregateIntegerBulk(points []IntegerPoint)
AggregateIntegerBulk performs a bulk copy of IntegerPoints into the internal slice. This is a more efficient version of calling AggregateInteger on each point.
func (*IntegerSliceFuncFloatReducer) Emit ¶
func (r *IntegerSliceFuncFloatReducer) Emit() []FloatPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type IntegerSliceFuncReducer ¶
IntegerSliceFuncReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type IntegerSliceFuncReducer struct {
// contains filtered or unexported fields
}
func NewIntegerSliceFuncReducer ¶
func NewIntegerSliceFuncReducer(fn IntegerReduceSliceFunc) *IntegerSliceFuncReducer
NewIntegerSliceFuncReducer creates a new IntegerSliceFuncReducer.
func (*IntegerSliceFuncReducer) AggregateInteger ¶
func (r *IntegerSliceFuncReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger copies the IntegerPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*IntegerSliceFuncReducer) AggregateIntegerBulk ¶
func (r *IntegerSliceFuncReducer) AggregateIntegerBulk(points []IntegerPoint)
AggregateIntegerBulk performs a bulk copy of IntegerPoints into the internal slice. This is a more efficient version of calling AggregateInteger on each point.
func (*IntegerSliceFuncReducer) Emit ¶
func (r *IntegerSliceFuncReducer) Emit() []IntegerPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type IntegerSliceFuncStringReducer ¶
IntegerSliceFuncStringReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type IntegerSliceFuncStringReducer struct {
// contains filtered or unexported fields
}
func NewIntegerSliceFuncStringReducer ¶
func NewIntegerSliceFuncStringReducer(fn IntegerReduceStringSliceFunc) *IntegerSliceFuncStringReducer
NewIntegerSliceFuncStringReducer creates a new IntegerSliceFuncStringReducer.
func (*IntegerSliceFuncStringReducer) AggregateInteger ¶
func (r *IntegerSliceFuncStringReducer) AggregateInteger(p *IntegerPoint)
AggregateInteger copies the IntegerPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*IntegerSliceFuncStringReducer) AggregateIntegerBulk ¶
func (r *IntegerSliceFuncStringReducer) AggregateIntegerBulk(points []IntegerPoint)
AggregateIntegerBulk performs a bulk copy of IntegerPoints into the internal slice. This is a more efficient version of calling AggregateInteger on each point.
func (*IntegerSliceFuncStringReducer) Emit ¶
func (r *IntegerSliceFuncStringReducer) Emit() []StringPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type Interval ¶
Interval represents a repeating interval for a query.
type Interval struct { Duration time.Duration Offset time.Duration }
func (Interval) IsZero ¶
func (i Interval) IsZero() bool
IsZero returns true if the interval has no duration.
type Iterator ¶
Iterator represents a generic interface for all Iterators. Most iterator operations are done on the typed sub-interfaces.
type Iterator interface { Stats() IteratorStats Close() error }
func NewCallIterator ¶
func NewCallIterator(input Iterator, opt IteratorOptions) (Iterator, error)
NewCallIterator returns a new iterator for a Call.
func NewCloseInterruptIterator ¶
func NewCloseInterruptIterator(input Iterator, closing <-chan struct{}) Iterator
NewCloseInterruptIterator returns an iterator that will invoke the Close() method on an iterator when the passed-in channel has been closed.
func NewDedupeIterator ¶
func NewDedupeIterator(input Iterator) Iterator
NewDedupeIterator returns an iterator that only outputs unique points. This iterator maintains a serialized copy of each row so it is inefficient to use on large datasets. It is intended for small datasets such as meta queries.
func NewDistinctIterator ¶
func NewDistinctIterator(input Iterator, opt IteratorOptions) (Iterator, error)
NewDistinctIterator returns an iterator for operating on a distinct() call.
func NewFillIterator ¶
func NewFillIterator(input Iterator, expr Expr, opt IteratorOptions) Iterator
NewFillIterator returns an iterator that fills in missing points in an aggregate.
func NewFilterIterator ¶
func NewFilterIterator(input Iterator, cond Expr, opt IteratorOptions) Iterator
NewFilterIterator returns an iterator that filters the points based on the condition. This iterator is not nearly as efficient as filtering points within the query engine and is only used when filtering subqueries.
func NewInterruptIterator ¶
func NewInterruptIterator(input Iterator, closing <-chan struct{}) Iterator
NewInterruptIterator returns an iterator that will stop producing output when the passed-in channel is closed.
func NewIntervalIterator ¶
func NewIntervalIterator(input Iterator, opt IteratorOptions) Iterator
NewIntervalIterator returns an iterator that sets the time on each point to the interval.
func NewIteratorMapper ¶
func NewIteratorMapper(itrs []Iterator, fields []IteratorMap, opt IteratorOptions) Iterator
func NewLimitIterator ¶
func NewLimitIterator(input Iterator, opt IteratorOptions) Iterator
NewLimitIterator returns an iterator that limits the number of points per grouping.
func NewMedianIterator ¶
func NewMedianIterator(input Iterator, opt IteratorOptions) (Iterator, error)
NewMedianIterator returns an iterator for operating on a median() call.
func NewMergeIterator ¶
func NewMergeIterator(inputs []Iterator, opt IteratorOptions) Iterator
NewMergeIterator returns an iterator to merge itrs into one. Inputs must either be merge iterators or only contain a single name/tag in sorted order. The iterator will output all points by window, name/tag, then time. This iterator is useful when you need all of the points for an interval.
func NewModeIterator ¶
func NewModeIterator(input Iterator, opt IteratorOptions) (Iterator, error)
newModeIterator returns an iterator for operating on a mode() call.
func NewParallelMergeIterator ¶
func NewParallelMergeIterator(inputs []Iterator, opt IteratorOptions, parallelism int) Iterator
NewParallelMergeIterator returns an iterator that breaks input iterators into groups and processes them in parallel.
func NewReaderIterator ¶
func NewReaderIterator(r io.Reader, typ DataType, stats IteratorStats) Iterator
NewReaderIterator returns an iterator that streams from a reader.
func NewSampleIterator ¶
func NewSampleIterator(input Iterator, opt IteratorOptions, size int) (Iterator, error)
NewSampleIterator returns an iterator for operating on a sample() call (exported for use in test).
func NewSortedMergeIterator ¶
func NewSortedMergeIterator(inputs []Iterator, opt IteratorOptions) Iterator
NewSortedMergeIterator returns an iterator to merge itrs into one. Inputs must either be sorted merge iterators or only contain a single name/tag in sorted order. The iterator will output all points by name/tag, then time. This iterator is useful when you need all points for a name/tag to be in order.
type IteratorCreator ¶
IteratorCreator is an interface to create Iterators.
type IteratorCreator interface {
// Creates a simple iterator for use in an InfluxQL query.
CreateIterator(source *Measurement, opt IteratorOptions) (Iterator, error)
}
type IteratorEncoder ¶
IteratorEncoder is an encoder for encoding an iterator's points to w.
type IteratorEncoder struct { // Frequency with which stats are emitted. StatsInterval time.Duration // contains filtered or unexported fields }
func NewIteratorEncoder ¶
func NewIteratorEncoder(w io.Writer) *IteratorEncoder
NewIteratorEncoder encodes an iterator's points to w.
func (*IteratorEncoder) EncodeIterator ¶
func (enc *IteratorEncoder) EncodeIterator(itr Iterator) error
EncodeIterator encodes and writes all of itr's points to the underlying writer.
type IteratorMap ¶
type IteratorMap interface { Value(tags Tags, buf []interface{}) interface{} }
type IteratorOptions ¶
IteratorOptions is an object passed to CreateIterator to specify creation options.
type IteratorOptions struct { // Expression to iterate for. // This can be VarRef or a Call. Expr Expr // Auxilary tags or values to also retrieve for the point. Aux []VarRef // Data sources from which to receive data. This is only used for encoding // measurements over RPC and is no longer used in the open source version. Sources []Source // Group by interval and tags. Interval Interval Dimensions []string // The final dimensions of the query (stays the same even in subqueries). GroupBy map[string]struct{} // Dimensions to group points by in intermediate iterators. // Fill options. Fill FillOption FillValue interface{} // Condition to filter by. Condition Expr // Time range for the iterator. StartTime int64 EndTime int64 // Sorted in time ascending order if true. Ascending bool // Limits the number of points per series. Limit, Offset int // Limits the number of series. SLimit, SOffset int // Removes duplicate rows from raw queries. Dedupe bool // Determines if this is a query for raw data or an aggregate/selector. Ordered bool // Limits on the creation of iterators. MaxSeriesN int // If this channel is set and is closed, the iterator should try to exit // and close as soon as possible. InterruptCh <-chan struct{} }
func (IteratorOptions) DerivativeInterval ¶
func (opt IteratorOptions) DerivativeInterval() Interval
DerivativeInterval returns the time interval for the derivative function.
func (IteratorOptions) ElapsedInterval ¶
func (opt IteratorOptions) ElapsedInterval() Interval
ElapsedInterval returns the time interval for the elapsed function.
func (IteratorOptions) GetDimensions ¶
func (opt IteratorOptions) GetDimensions() []string
GetDimensions retrieves the dimensions for this query.
func (*IteratorOptions) MarshalBinary ¶
func (opt *IteratorOptions) MarshalBinary() ([]byte, error)
MarshalBinary encodes opt into a binary format.
func (IteratorOptions) MergeSorted ¶
func (opt IteratorOptions) MergeSorted() bool
MergeSorted returns true if the options require a sorted merge.
func (IteratorOptions) SeekTime ¶
func (opt IteratorOptions) SeekTime() int64
SeekTime returns the time the iterator should start from. For ascending iterators this is the start time, for descending iterators it's the end time.
func (*IteratorOptions) UnmarshalBinary ¶
func (opt *IteratorOptions) UnmarshalBinary(buf []byte) error
UnmarshalBinary decodes from a binary format in to opt.
func (IteratorOptions) Window ¶
func (opt IteratorOptions) Window(t int64) (start, end int64)
Window returns the time window [start,end) that t falls within.
type IteratorStats ¶
IteratorStats represents statistics about an iterator. Some statistics are available immediately upon iterator creation while some are derived as the iterator processes data.
type IteratorStats struct { SeriesN int // series represented PointN int // points returned }
func (*IteratorStats) Add ¶
func (s *IteratorStats) Add(other IteratorStats)
Add aggregates fields from s and other together. Overwrites s.
type Iterators ¶
Iterators represents a list of iterators.
type Iterators []Iterator
func (Iterators) Close ¶
func (a Iterators) Close() error
Close closes all iterators.
func (Iterators) Merge ¶
func (a Iterators) Merge(opt IteratorOptions) (Iterator, error)
Merge combines all iterators into a single iterator. A sorted merge iterator or a merge iterator can be used based on opt.
func (Iterators) Stats ¶
func (a Iterators) Stats() IteratorStats
Stats returns the aggregation of all iterator stats.
type KillQueryStatement ¶
KillQueryStatement represents a command for killing a query.
type KillQueryStatement struct { // The query to kill. QueryID uint64 // The host to delegate the kill to. Host string }
func (*KillQueryStatement) RequiredPrivileges ¶
func (s *KillQueryStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a KillQueryStatement.
func (*KillQueryStatement) String ¶
func (s *KillQueryStatement) String() string
String returns a string representation of the kill query statement.
type ListLiteral ¶
ListLiteral represents a list of tag key literals.
type ListLiteral struct { Vals []string }
func (*ListLiteral) String ¶
func (s *ListLiteral) String() string
String returns a string representation of the literal.
type Literal ¶
Literal represents a static literal.
type Literal interface {
Expr
// contains filtered or unexported methods
}
type Measurement ¶
Measurement represents a single measurement used as a datasource.
type Measurement struct { Database string RetentionPolicy string Name string Regex *RegexLiteral IsTarget bool }
func (*Measurement) String ¶
func (m *Measurement) String() string
String returns a string representation of the measurement.
type Measurements ¶
Measurements represents a list of measurements.
type Measurements []*Measurement
func (Measurements) String ¶
func (a Measurements) String() string
String returns a string representation of the measurements.
type Message ¶
Message represents a user-facing message to be included with the result.
type Message struct { Level string `json:"level"` Text string `json:"text"` }
func ReadOnlyWarning ¶
func ReadOnlyWarning(stmt string) *Message
ReadOnlyWarning generates a warning message that tells the user the command they are using is being used for writing in a read only context.
This is a temporary method while to be used while transitioning to read only operations for issue #6290.
type Node ¶
Node represents a node in the InfluxDB abstract syntax tree.
type Node interface {
String() string
// contains filtered or unexported methods
}
func Rewrite ¶
func Rewrite(r Rewriter, node Node) Node
Rewrite recursively invokes the rewriter to replace each node. Nodes are traversed depth-first and rewritten from leaf to root.
func RewriteFunc ¶
func RewriteFunc(node Node, fn func(Node) Node) Node
RewriteFunc rewrites a node hierarchy.
type NowValuer ¶
NowValuer returns only the value for "now()".
type NowValuer struct { Now time.Time }
func (*NowValuer) Value ¶
func (v *NowValuer) Value(key string) (interface{}, bool)
Value is a method that returns the value and existence flag for a given key.
type NumberLiteral ¶
NumberLiteral represents a numeric literal.
type NumberLiteral struct { Val float64 }
func (*NumberLiteral) String ¶
func (l *NumberLiteral) String() string
String returns a string representation of the literal.
type ParenExpr ¶
ParenExpr represents a parenthesized expression.
type ParenExpr struct { Expr Expr }
func (*ParenExpr) String ¶
func (e *ParenExpr) String() string
String returns a string representation of the parenthesized expression.
type ParseError ¶
ParseError represents an error that occurred during parsing.
type ParseError struct { Message string Found string Expected []string Pos Pos }
func (*ParseError) Error ¶
func (e *ParseError) Error() string
Error returns the string representation of the error.
type Parser ¶
Parser represents an InfluxQL parser.
type Parser struct {
// contains filtered or unexported fields
}
func NewParser ¶
func NewParser(r io.Reader) *Parser
NewParser returns a new instance of Parser.
func (*Parser) ParseExpr ¶
func (p *Parser) ParseExpr() (Expr, error)
ParseExpr parses an expression.
func (*Parser) ParseQuery ¶
func (p *Parser) ParseQuery() (*Query, error)
ParseQuery parses an InfluxQL string and returns a Query AST object.
func (*Parser) ParseStatement ¶
func (p *Parser) ParseStatement() (Statement, error)
ParseStatement parses an InfluxQL string and returns a Statement AST object.
func (*Parser) SetParams ¶
func (p *Parser) SetParams(params map[string]interface{})
SetParams sets the parameters that will be used for any bound parameter substitutions.
type Point ¶
Point represents a value in a series that occurred at a given time.
type Point interface {
// contains filtered or unexported methods
}
type PointDecoder ¶
PointDecoder decodes generic points from a reader.
type PointDecoder struct {
// contains filtered or unexported fields
}
func NewPointDecoder ¶
func NewPointDecoder(r io.Reader) *PointDecoder
NewPointDecoder returns a new instance of PointDecoder that reads from r.
func (*PointDecoder) DecodePoint ¶
func (dec *PointDecoder) DecodePoint(p *Point) error
DecodePoint reads from the underlying reader and unmarshals into p.
func (*PointDecoder) Stats ¶
func (dec *PointDecoder) Stats() IteratorStats
Stats returns iterator stats embedded within the stream.
type Points ¶
Points represents a list of points.
type Points []Point
func (Points) Clone ¶
func (a Points) Clone() []Point
Clone returns a deep copy of a.
type Pos ¶
Pos specifies the line and character position of a token. The Char and Line are both zero-based indexes.
type Pos struct { Line int Char int }
type Privilege ¶
Privilege is a type of action a user can be granted the right to use.
type Privilege int
const ( // NoPrivileges means no privileges required / granted / revoked. NoPrivileges Privilege = iota // ReadPrivilege means read privilege required / granted / revoked. ReadPrivilege // WritePrivilege means write privilege required / granted / revoked. WritePrivilege // AllPrivileges means all privileges required / granted / revoked. AllPrivileges )
func NewPrivilege ¶
func NewPrivilege(p Privilege) *Privilege
NewPrivilege returns an initialized *Privilege.
func (Privilege) String ¶
func (p Privilege) String() string
String returns a string representation of a Privilege.
type Query ¶
Query represents a collection of ordered statements.
type Query struct { Statements Statements }
func ParseQuery ¶
func ParseQuery(s string) (*Query, error)
ParseQuery parses a query string and returns its AST representation.
func (*Query) String ¶
func (q *Query) String() string
String returns a string representation of the query.
type QueryExecutor ¶
QueryExecutor executes every statement in an Query.
type QueryExecutor struct { // Used for executing a statement in the query. StatementExecutor StatementExecutor // Used for tracking running queries. TaskManager *TaskManager // Logger to use for all logging. // Defaults to discarding all log output. Logger zap.Logger // contains filtered or unexported fields }
func NewQueryExecutor ¶
func NewQueryExecutor() *QueryExecutor
NewQueryExecutor returns a new instance of QueryExecutor.
func (*QueryExecutor) Close ¶
func (e *QueryExecutor) Close() error
Close kills all running queries and prevents new queries from being attached.
func (*QueryExecutor) ExecuteQuery ¶
func (e *QueryExecutor) ExecuteQuery(query *Query, opt ExecutionOptions, closing chan struct{}) <-chan *Result
ExecuteQuery executes each statement within a query.
func (*QueryExecutor) Statistics ¶
func (e *QueryExecutor) Statistics(tags map[string]string) []models.Statistic
Statistics returns statistics for periodic monitoring.
func (*QueryExecutor) WithLogger ¶
func (e *QueryExecutor) WithLogger(log zap.Logger)
SetLogOutput sets the writer to which all logs are written. It must not be called after Open is called.
type QueryInfo ¶
QueryInfo represents the information for a query.
type QueryInfo struct { ID uint64 `json:"id"` Query string `json:"query"` Database string `json:"database"` Duration time.Duration `json:"duration"` }
type QueryMonitorFunc ¶
QueryMonitorFunc is a function that will be called to check if a query is currently healthy. If the query needs to be interrupted for some reason, the error should be returned by this function.
type QueryMonitorFunc func(<-chan struct{}) error
func PointLimitMonitor ¶
func PointLimitMonitor(itrs Iterators, interval time.Duration, limit int) QueryMonitorFunc
PointLimitMonitor is a query monitor that exits when the number of points emitted exceeds a threshold.
type QueryStatistics ¶
QueryStatistics keeps statistics related to the QueryExecutor.
type QueryStatistics struct { ActiveQueries int64 ExecutedQueries int64 FinishedQueries int64 QueryExecutionDuration int64 }
type QueryTask ¶
QueryTask is the internal data structure for managing queries. For the public use data structure that gets returned, see QueryTask.
type QueryTask struct {
// contains filtered or unexported fields
}
func (*QueryTask) Error ¶
func (q *QueryTask) Error() error
Error returns any asynchronous error that may have occured while executing the query.
func (*QueryTask) Monitor ¶
func (q *QueryTask) Monitor(fn QueryMonitorFunc)
Monitor starts a new goroutine that will monitor a query. The function will be passed in a channel to signal when the query has been finished normally. If the function returns with an error and the query is still running, the query will be terminated.
type RegexLiteral ¶
RegexLiteral represents a regular expression.
type RegexLiteral struct { Val *regexp.Regexp }
func CloneRegexLiteral ¶
func CloneRegexLiteral(r *RegexLiteral) *RegexLiteral
CloneRegexLiteral returns a clone of the RegexLiteral.
func (*RegexLiteral) String ¶
func (r *RegexLiteral) String() string
String returns a string representation of the literal.
type Result ¶
Result represents a resultset returned from a single statement. Rows represents a list of rows that can be sorted consistently by name/tag.
type Result struct { // StatementID is just the statement's position in the query. It's used // to combine statement results if they're being buffered in memory. StatementID int Series models.Rows Messages []*Message Partial bool Err error }
func (*Result) MarshalJSON ¶
func (r *Result) MarshalJSON() ([]byte, error)
MarshalJSON encodes the result into JSON.
func (*Result) UnmarshalJSON ¶
func (r *Result) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes the data into the Result struct
type RevokeAdminStatement ¶
RevokeAdminStatement represents a command to revoke admin privilege from a user.
type RevokeAdminStatement struct {
// Who to revoke admin privilege from.
User string
}
func (*RevokeAdminStatement) RequiredPrivileges ¶
func (s *RevokeAdminStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a RevokeAdminStatement.
func (*RevokeAdminStatement) String ¶
func (s *RevokeAdminStatement) String() string
String returns a string representation of the revoke admin statement.
type RevokeStatement ¶
RevokeStatement represents a command to revoke a privilege from a user.
type RevokeStatement struct { // The privilege to be revoked. Privilege Privilege // Database to revoke the privilege from. On string // Who to revoke privilege from. User string }
func (*RevokeStatement) DefaultDatabase ¶
func (s *RevokeStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*RevokeStatement) RequiredPrivileges ¶
func (s *RevokeStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a RevokeStatement.
func (*RevokeStatement) String ¶
func (s *RevokeStatement) String() string
String returns a string representation of the revoke statement.
type Rewriter ¶
Rewriter can be called by Rewrite to replace nodes in the AST hierarchy. The Rewrite() function is called once per node.
type Rewriter interface { Rewrite(Node) Node }
type Scanner ¶
Scanner represents a lexical scanner for InfluxQL.
type Scanner struct {
// contains filtered or unexported fields
}
func NewScanner ¶
func NewScanner(r io.Reader) *Scanner
NewScanner returns a new instance of Scanner.
func (*Scanner) Scan ¶
func (s *Scanner) Scan() (tok Token, pos Pos, lit string)
Scan returns the next token and position from the underlying reader. Also returns the literal text read for strings, numbers, and duration tokens since these token types can have different literal representations.
func (*Scanner) ScanRegex ¶
func (s *Scanner) ScanRegex() (tok Token, pos Pos, lit string)
ScanRegex consumes a token to find escapes
type SelectOptions ¶
SelectOptions are options that customize the select call.
type SelectOptions struct { // The lower bound for a select call. MinTime time.Time // The upper bound for a select call. MaxTime time.Time // Node to exclusively read from. // If zero, all nodes are used. NodeID uint64 // An optional channel that, if closed, signals that the select should be // interrupted. InterruptCh <-chan struct{} // Maximum number of concurrent series. MaxSeriesN int }
type SelectStatement ¶
SelectStatement represents a command for extracting data from the database.
type SelectStatement struct { // Expressions returned from the selection. Fields Fields // Target (destination) for the result of a SELECT INTO query. Target *Target // Expressions used for grouping the selection. Dimensions Dimensions // Data sources (measurements) that fields are extracted from. Sources Sources // An expression evaluated on data point. Condition Expr // Fields to sort results by. SortFields SortFields // Maximum number of rows to be returned. Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int // Maxiumum number of series to be returned. Unlimited if zero. SLimit int // Returns series starting at an offset from the first one. SOffset int // Whether it's a query for raw data values (i.e. not an aggregate). IsRawQuery bool // What fill option the select statement uses, if any. Fill FillOption // The value to fill empty aggregate buckets with, if any. FillValue interface{} // Renames the implicit time field name. TimeAlias string // Removes the "time" column from the output. OmitTime bool // Removes duplicate rows from raw queries. Dedupe bool // contains filtered or unexported fields }
func (*SelectStatement) Clone ¶
func (s *SelectStatement) Clone() *SelectStatement
Clone returns a deep copy of the statement.
func (*SelectStatement) ColumnNames ¶
func (s *SelectStatement) ColumnNames() []string
ColumnNames will walk all fields and functions and return the appropriate field names for the select statement while maintaining order of the field names.
func (*SelectStatement) FieldExprByName ¶
func (s *SelectStatement) FieldExprByName(name string) (int, Expr)
FieldExprByName returns the expression that matches the field name and the index where this was found. If the name matches one of the arguments to "top" or "bottom", the variable reference inside of the function is returned and the index is of the function call rather than the variable reference. If no expression is found, -1 is returned for the index and the expression will be nil.
func (*SelectStatement) FunctionCalls ¶
func (s *SelectStatement) FunctionCalls() []*Call
FunctionCalls returns the Call objects from the query.
func (*SelectStatement) FunctionCallsByPosition ¶
func (s *SelectStatement) FunctionCallsByPosition() [][]*Call
FunctionCallsByPosition returns the Call objects from the query in the order they appear in the select statement.
func (*SelectStatement) GroupByInterval ¶
func (s *SelectStatement) GroupByInterval() (time.Duration, error)
GroupByInterval extracts the time interval, if specified.
func (*SelectStatement) GroupByOffset ¶
func (s *SelectStatement) GroupByOffset() (time.Duration, error)
GroupByOffset extracts the time interval offset, if specified.
func (*SelectStatement) HasDerivative ¶
func (s *SelectStatement) HasDerivative() bool
HasDerivative returns true if any function call in the statement is a derivative aggregate.
func (*SelectStatement) HasDimensionWildcard ¶
func (s *SelectStatement) HasDimensionWildcard() bool
HasDimensionWildcard returns whether or not the select statement has at least 1 wildcard in the dimensions aka `GROUP BY`.
func (*SelectStatement) HasDistinct ¶
func (s *SelectStatement) HasDistinct() bool
HasDistinct checks if a select statement contains a call to DISTINCT.
func (*SelectStatement) HasFieldWildcard ¶
func (s *SelectStatement) HasFieldWildcard() (hasWildcard bool)
HasFieldWildcard returns whether or not the select statement has at least 1 wildcard in the fields.
func (*SelectStatement) HasSelector ¶
func (s *SelectStatement) HasSelector() bool
HasSelector returns true if there is exactly one selector.
func (*SelectStatement) HasTimeFieldSpecified ¶
func (s *SelectStatement) HasTimeFieldSpecified() bool
HasTimeFieldSpecified will walk all fields and determine if the user explicitly asked for time. This is needed to determine re-write behaviors for functions like TOP and BOTTOM.
func (*SelectStatement) HasWildcard ¶
func (s *SelectStatement) HasWildcard() bool
HasWildcard returns whether or not the select statement has at least 1 wildcard.
func (*SelectStatement) IsSimpleDerivative ¶
func (s *SelectStatement) IsSimpleDerivative() bool
IsSimpleDerivative return true if any function call is a derivative function with a variable ref as the first arg.
func (*SelectStatement) NamesInDimension ¶
func (s *SelectStatement) NamesInDimension() []string
NamesInDimension returns the field and tag names (idents) in the group by clause.
func (*SelectStatement) NamesInSelect ¶
func (s *SelectStatement) NamesInSelect() []string
NamesInSelect returns the field and tag names (idents) in the select clause.
func (*SelectStatement) NamesInWhere ¶
func (s *SelectStatement) NamesInWhere() []string
NamesInWhere returns the field and tag names (idents) referenced in the where clause.
func (*SelectStatement) Reduce ¶
func (s *SelectStatement) Reduce(valuer Valuer) *SelectStatement
Reduce calls the Reduce function on the different components of the SelectStatement to reduce the statement.
func (*SelectStatement) RequiredPrivileges ¶
func (s *SelectStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute the SelectStatement. NOTE: Statement should be normalized first (database name(s) in Sources and Target should be populated). If the statement has not been normalized, an empty string will be returned for the database name and it is up to the caller to interpret that as the default database.
func (*SelectStatement) RewriteDistinct ¶
func (s *SelectStatement) RewriteDistinct()
RewriteDistinct rewrites the expression to be a call for map/reduce to work correctly. This method assumes all validation has passed.
func (*SelectStatement) RewriteFields ¶
func (s *SelectStatement) RewriteFields(m FieldMapper) (*SelectStatement, error)
RewriteFields returns the re-written form of the select statement. Any wildcard query fields are replaced with the supplied fields, and any wildcard GROUP BY fields are replaced with the supplied dimensions. Any fields with no type specifier are rewritten with the appropriate type.
func (*SelectStatement) RewriteRegexConditions ¶
func (s *SelectStatement) RewriteRegexConditions()
RewriteRegexConditions rewrites regex conditions to make better use of the database index.
Conditions that can currently be simplified are:
- host =~ /^foo$/ becomes host = 'foo' - host !~ /^foo$/ becomes host != 'foo'
Note: if the regex contains groups, character classes, repetition or similar, it's likely it won't be rewritten. In order to support rewriting regexes with these characters would be a lot more work.
func (*SelectStatement) RewriteTimeCondition ¶
func (s *SelectStatement) RewriteTimeCondition(now time.Time) error
RewriteTimeCondition adds time constraints to aggregate queries.
func (*SelectStatement) RewriteTimeFields ¶
func (s *SelectStatement) RewriteTimeFields()
RewriteTimeFields removes any "time" field references.
func (*SelectStatement) SetTimeRange ¶
func (s *SelectStatement) SetTimeRange(start, end time.Time) error
SetTimeRange sets the start and end time of the select statement to [start, end). i.e. start inclusive, end exclusive. This is used commonly for continuous queries so the start and end are in buckets.
func (*SelectStatement) String ¶
func (s *SelectStatement) String() string
String returns a string representation of the select statement.
func (*SelectStatement) TimeAscending ¶
func (s *SelectStatement) TimeAscending() bool
TimeAscending returns true if the time field is sorted in chronological order.
func (*SelectStatement) TimeFieldName ¶
func (s *SelectStatement) TimeFieldName() string
TimeFieldName returns the name of the time field.
type SetPasswordUserStatement ¶
SetPasswordUserStatement represents a command for changing user password.
type SetPasswordUserStatement struct { // Plain-text password. Password string // Who to grant the privilege to. Name string }
func (*SetPasswordUserStatement) RequiredPrivileges ¶
func (s *SetPasswordUserStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a SetPasswordUserStatement.
func (*SetPasswordUserStatement) String ¶
func (s *SetPasswordUserStatement) String() string
String returns a string representation of the set password statement.
type ShowContinuousQueriesStatement ¶
ShowContinuousQueriesStatement represents a command for listing continuous queries.
type ShowContinuousQueriesStatement struct{}
func (*ShowContinuousQueriesStatement) RequiredPrivileges ¶
func (s *ShowContinuousQueriesStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a ShowContinuousQueriesStatement.
func (*ShowContinuousQueriesStatement) String ¶
func (s *ShowContinuousQueriesStatement) String() string
String returns a string representation of the show continuous queries statement.
type ShowDatabasesStatement ¶
ShowDatabasesStatement represents a command for listing all databases in the cluster.
type ShowDatabasesStatement struct{}
func (*ShowDatabasesStatement) RequiredPrivileges ¶
func (s *ShowDatabasesStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a ShowDatabasesStatement.
func (*ShowDatabasesStatement) String ¶
func (s *ShowDatabasesStatement) String() string
String returns a string representation of the show databases command.
type ShowDiagnosticsStatement ¶
ShowDiagnosticsStatement represents a command for show node diagnostics.
type ShowDiagnosticsStatement struct {
// Module
Module string
}
func (*ShowDiagnosticsStatement) RequiredPrivileges ¶
func (s *ShowDiagnosticsStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a ShowDiagnosticsStatement
func (*ShowDiagnosticsStatement) String ¶
func (s *ShowDiagnosticsStatement) String() string
String returns a string representation of the ShowDiagnosticsStatement.
type ShowFieldKeysStatement ¶
ShowFieldKeysStatement represents a command for listing field keys.
type ShowFieldKeysStatement struct { // Database to query. If blank, use the default database. // The database can also be specified per source in the Sources. Database string // Data sources that fields are extracted from. Sources Sources // Fields to sort results by SortFields SortFields // Maximum number of rows to be returned. // Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int }
func (*ShowFieldKeysStatement) DefaultDatabase ¶
func (s *ShowFieldKeysStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*ShowFieldKeysStatement) RequiredPrivileges ¶
func (s *ShowFieldKeysStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a ShowFieldKeysStatement.
func (*ShowFieldKeysStatement) String ¶
func (s *ShowFieldKeysStatement) String() string
String returns a string representation of the statement.
type ShowGrantsForUserStatement ¶
ShowGrantsForUserStatement represents a command for listing user privileges.
type ShowGrantsForUserStatement struct {
// Name of the user to display privileges.
Name string
}
func (*ShowGrantsForUserStatement) RequiredPrivileges ¶
func (s *ShowGrantsForUserStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a ShowGrantsForUserStatement
func (*ShowGrantsForUserStatement) String ¶
func (s *ShowGrantsForUserStatement) String() string
String returns a string representation of the show grants for user.
type ShowMeasurementsStatement ¶
ShowMeasurementsStatement represents a command for listing measurements.
type ShowMeasurementsStatement struct { // Database to query. If blank, use the default database. Database string // Measurement name or regex. Source Source // An expression evaluated on data point. Condition Expr // Fields to sort results by SortFields SortFields // Maximum number of rows to be returned. // Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int }
func (*ShowMeasurementsStatement) DefaultDatabase ¶
func (s *ShowMeasurementsStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*ShowMeasurementsStatement) RequiredPrivileges ¶
func (s *ShowMeasurementsStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a ShowMeasurementsStatement.
func (*ShowMeasurementsStatement) String ¶
func (s *ShowMeasurementsStatement) String() string
String returns a string representation of the statement.
type ShowQueriesStatement ¶
ShowQueriesStatement represents a command for listing all running queries.
type ShowQueriesStatement struct{}
func (*ShowQueriesStatement) RequiredPrivileges ¶
func (s *ShowQueriesStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a ShowQueriesStatement.
func (*ShowQueriesStatement) String ¶
func (s *ShowQueriesStatement) String() string
String returns a string representation of the show queries statement.
type ShowRetentionPoliciesStatement ¶
ShowRetentionPoliciesStatement represents a command for listing retention policies.
type ShowRetentionPoliciesStatement struct {
// Name of the database to list policies for.
Database string
}
func (*ShowRetentionPoliciesStatement) DefaultDatabase ¶
func (s *ShowRetentionPoliciesStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*ShowRetentionPoliciesStatement) RequiredPrivileges ¶
func (s *ShowRetentionPoliciesStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a ShowRetentionPoliciesStatement
func (*ShowRetentionPoliciesStatement) String ¶
func (s *ShowRetentionPoliciesStatement) String() string
String returns a string representation of a ShowRetentionPoliciesStatement.
type ShowSeriesStatement ¶
ShowSeriesStatement represents a command for listing series in the database.
type ShowSeriesStatement struct { // Database to query. If blank, use the default database. // The database can also be specified per source in the Sources. Database string // Measurement(s) the series are listed for. Sources Sources // An expression evaluated on a series name or tag. Condition Expr // Fields to sort results by SortFields SortFields // Maximum number of rows to be returned. // Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int }
func (*ShowSeriesStatement) DefaultDatabase ¶
func (s *ShowSeriesStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*ShowSeriesStatement) RequiredPrivileges ¶
func (s *ShowSeriesStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a ShowSeriesStatement.
func (*ShowSeriesStatement) String ¶
func (s *ShowSeriesStatement) String() string
String returns a string representation of the list series statement.
type ShowShardGroupsStatement ¶
ShowShardGroupsStatement represents a command for displaying shard groups in the cluster.
type ShowShardGroupsStatement struct{}
func (*ShowShardGroupsStatement) RequiredPrivileges ¶
func (s *ShowShardGroupsStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privileges required to execute the statement.
func (*ShowShardGroupsStatement) String ¶
func (s *ShowShardGroupsStatement) String() string
String returns a string representation of the SHOW SHARD GROUPS command.
type ShowShardsStatement ¶
ShowShardsStatement represents a command for displaying shards in the cluster.
type ShowShardsStatement struct{}
func (*ShowShardsStatement) RequiredPrivileges ¶
func (s *ShowShardsStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privileges required to execute the statement.
func (*ShowShardsStatement) String ¶
func (s *ShowShardsStatement) String() string
String returns a string representation.
type ShowStatsStatement ¶
ShowStatsStatement displays statistics for a given module.
type ShowStatsStatement struct { Module string }
func (*ShowStatsStatement) RequiredPrivileges ¶
func (s *ShowStatsStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a ShowStatsStatement
func (*ShowStatsStatement) String ¶
func (s *ShowStatsStatement) String() string
String returns a string representation of a ShowStatsStatement.
type ShowSubscriptionsStatement ¶
ShowSubscriptionsStatement represents a command to show a list of subscriptions.
type ShowSubscriptionsStatement struct { }
func (*ShowSubscriptionsStatement) RequiredPrivileges ¶
func (s *ShowSubscriptionsStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege required to execute a ShowSubscriptionsStatement.
func (*ShowSubscriptionsStatement) String ¶
func (s *ShowSubscriptionsStatement) String() string
String returns a string representation of the ShowSubscriptionsStatement.
type ShowTagKeysStatement ¶
ShowTagKeysStatement represents a command for listing tag keys.
type ShowTagKeysStatement struct { // Database to query. If blank, use the default database. // The database can also be specified per source in the Sources. Database string // Data sources that fields are extracted from. Sources Sources // An expression evaluated on data point. Condition Expr // Fields to sort results by. SortFields SortFields // Maximum number of tag keys per measurement. Unlimited if zero. Limit int // Returns tag keys starting at an offset from the first row. Offset int // Maxiumum number of series to be returned. Unlimited if zero. SLimit int // Returns series starting at an offset from the first one. SOffset int }
func (*ShowTagKeysStatement) DefaultDatabase ¶
func (s *ShowTagKeysStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*ShowTagKeysStatement) RequiredPrivileges ¶
func (s *ShowTagKeysStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a ShowTagKeysStatement.
func (*ShowTagKeysStatement) String ¶
func (s *ShowTagKeysStatement) String() string
String returns a string representation of the statement.
type ShowTagValuesStatement ¶
ShowTagValuesStatement represents a command for listing tag values.
type ShowTagValuesStatement struct { // Database to query. If blank, use the default database. // The database can also be specified per source in the Sources. Database string // Data source that fields are extracted from. Sources Sources // Operation to use when selecting tag key(s). Op Token // Literal to compare the tag key(s) with. TagKeyExpr Literal // An expression evaluated on data point. Condition Expr // Fields to sort results by. SortFields SortFields // Maximum number of rows to be returned. // Unlimited if zero. Limit int // Returns rows starting at an offset from the first row. Offset int }
func (*ShowTagValuesStatement) DefaultDatabase ¶
func (s *ShowTagValuesStatement) DefaultDatabase() string
DefaultDatabase returns the default database from the statement.
func (*ShowTagValuesStatement) RequiredPrivileges ¶
func (s *ShowTagValuesStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a ShowTagValuesStatement.
func (*ShowTagValuesStatement) String ¶
func (s *ShowTagValuesStatement) String() string
String returns a string representation of the statement.
type ShowUsersStatement ¶
ShowUsersStatement represents a command for listing users.
type ShowUsersStatement struct{}
func (*ShowUsersStatement) RequiredPrivileges ¶
func (s *ShowUsersStatement) RequiredPrivileges() (ExecutionPrivileges, error)
RequiredPrivileges returns the privilege(s) required to execute a ShowUsersStatement
func (*ShowUsersStatement) String ¶
func (s *ShowUsersStatement) String() string
String returns a string representation of the ShowUsersStatement.
type SortField ¶
SortField represents a field to sort results by.
type SortField struct { // Name of the field. Name string // Sort order. Ascending bool }
func (*SortField) String ¶
func (field *SortField) String() string
String returns a string representation of a sort field.
type SortFields ¶
SortFields represents an ordered list of ORDER BY fields.
type SortFields []*SortField
func (SortFields) String ¶
func (a SortFields) String() string
String returns a string representation of sort fields.
type Source ¶
Source represents a source of data for a statement.
type Source interface {
Node
// contains filtered or unexported methods
}
type Sources ¶
Sources represents a list of sources.
type Sources []Source
func (Sources) Filter ¶
func (a Sources) Filter(database, retentionPolicy string) []Source
Filter returns a list of source names filtered by the database/retention policy.
func (Sources) HasRegex ¶
func (a Sources) HasRegex() bool
HasRegex returns true if any of the sources are regex measurements.
func (Sources) HasSystemSource ¶
func (a Sources) HasSystemSource() bool
HasSystemSource returns true if any of the sources are internal, system sources.
func (Sources) MarshalBinary ¶
func (a Sources) MarshalBinary() ([]byte, error)
MarshalBinary encodes a list of sources to a binary format.
func (Sources) Measurements ¶
func (a Sources) Measurements() []*Measurement
Measurements returns all measurements including ones embedded in subqueries.
func (Sources) Names ¶
func (a Sources) Names() []string
Names returns a list of source names.
func (Sources) String ¶
func (a Sources) String() string
String returns a string representation of a Sources array.
func (*Sources) UnmarshalBinary ¶
func (a *Sources) UnmarshalBinary(buf []byte) error
UnmarshalBinary decodes binary data into a list of sources.
type Statement ¶
Statement represents a single command in InfluxQL.
type Statement interface {
Node
RequiredPrivileges() (ExecutionPrivileges, error)
// contains filtered or unexported methods
}
func MustParseStatement ¶
func MustParseStatement(s string) Statement
MustParseStatement parses a statement string and returns its AST. Panic on error.
func ParseStatement ¶
func ParseStatement(s string) (Statement, error)
ParseStatement parses a statement string and returns its AST representation.
func RewriteStatement ¶
func RewriteStatement(stmt Statement) (Statement, error)
RewriteStatement rewrites stmt into a new statement, if applicable.
type StatementExecutor ¶
StatementExecutor executes a statement within the QueryExecutor.
type StatementExecutor interface { // ExecuteStatement executes a statement. Results should be sent to the // results channel in the ExecutionContext. ExecuteStatement(stmt Statement, ctx ExecutionContext) error }
type StatementNormalizer ¶
StatementNormalizer normalizes a statement before it is executed.
type StatementNormalizer interface { // NormalizeStatement adds a default database and policy to the // measurements in the statement. NormalizeStatement(stmt Statement, database string) error }
type Statements ¶
Statements represents a list of statements.
type Statements []Statement
func (Statements) String ¶
func (a Statements) String() string
String returns a string representation of the statements.
type StringBulkPointAggregator ¶
StringBulkPointAggregator aggregates multiple points at a time.
type StringBulkPointAggregator interface { AggregateStringBulk(points []StringPoint) }
type StringDistinctReducer ¶
StringDistinctReducer returns the distinct points in a series.
type StringDistinctReducer struct {
// contains filtered or unexported fields
}
func NewStringDistinctReducer ¶
func NewStringDistinctReducer() *StringDistinctReducer
NewStringDistinctReducer creates a new StringDistinctReducer.
func (*StringDistinctReducer) AggregateString ¶
func (r *StringDistinctReducer) AggregateString(p *StringPoint)
AggregateString aggregates a point into the reducer.
func (*StringDistinctReducer) Emit ¶
func (r *StringDistinctReducer) Emit() []StringPoint
Emit emits the distinct points that have been aggregated into the reducer.
type StringElapsedReducer ¶
StringElapsedReducer calculates the elapsed of the aggregated points.
type StringElapsedReducer struct {
// contains filtered or unexported fields
}
func NewStringElapsedReducer ¶
func NewStringElapsedReducer(interval Interval) *StringElapsedReducer
NewStringElapsedReducer creates a new StringElapsedReducer.
func (*StringElapsedReducer) AggregateString ¶
func (r *StringElapsedReducer) AggregateString(p *StringPoint)
AggregateString aggregates a point into the reducer and updates the current window.
func (*StringElapsedReducer) Emit ¶
func (r *StringElapsedReducer) Emit() []IntegerPoint
Emit emits the elapsed of the reducer at the current point.
type StringFuncBooleanReducer ¶
StringFuncBooleanReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type StringFuncBooleanReducer struct {
// contains filtered or unexported fields
}
func NewStringFuncBooleanReducer ¶
func NewStringFuncBooleanReducer(fn StringReduceBooleanFunc, prev *BooleanPoint) *StringFuncBooleanReducer
NewStringFuncBooleanReducer creates a new StringFuncBooleanReducer.
func (*StringFuncBooleanReducer) AggregateString ¶
func (r *StringFuncBooleanReducer) AggregateString(p *StringPoint)
AggregateString takes a StringPoint and invokes the reduce function with the current and new point to modify the current point.
func (*StringFuncBooleanReducer) Emit ¶
func (r *StringFuncBooleanReducer) Emit() []BooleanPoint
Emit emits the point that was generated when reducing the points fed in with AggregateString.
type StringFuncFloatReducer ¶
StringFuncFloatReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type StringFuncFloatReducer struct {
// contains filtered or unexported fields
}
func NewStringFuncFloatReducer ¶
func NewStringFuncFloatReducer(fn StringReduceFloatFunc, prev *FloatPoint) *StringFuncFloatReducer
NewStringFuncFloatReducer creates a new StringFuncFloatReducer.
func (*StringFuncFloatReducer) AggregateString ¶
func (r *StringFuncFloatReducer) AggregateString(p *StringPoint)
AggregateString takes a StringPoint and invokes the reduce function with the current and new point to modify the current point.
func (*StringFuncFloatReducer) Emit ¶
func (r *StringFuncFloatReducer) Emit() []FloatPoint
Emit emits the point that was generated when reducing the points fed in with AggregateString.
type StringFuncIntegerReducer ¶
StringFuncIntegerReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type StringFuncIntegerReducer struct {
// contains filtered or unexported fields
}
func NewStringFuncIntegerReducer ¶
func NewStringFuncIntegerReducer(fn StringReduceIntegerFunc, prev *IntegerPoint) *StringFuncIntegerReducer
NewStringFuncIntegerReducer creates a new StringFuncIntegerReducer.
func (*StringFuncIntegerReducer) AggregateString ¶
func (r *StringFuncIntegerReducer) AggregateString(p *StringPoint)
AggregateString takes a StringPoint and invokes the reduce function with the current and new point to modify the current point.
func (*StringFuncIntegerReducer) Emit ¶
func (r *StringFuncIntegerReducer) Emit() []IntegerPoint
Emit emits the point that was generated when reducing the points fed in with AggregateString.
type StringFuncReducer ¶
StringFuncReducer is a reducer that reduces the passed in points to a single point using a reduce function.
type StringFuncReducer struct {
// contains filtered or unexported fields
}
func NewStringFuncReducer ¶
func NewStringFuncReducer(fn StringReduceFunc, prev *StringPoint) *StringFuncReducer
NewStringFuncReducer creates a new StringFuncStringReducer.
func (*StringFuncReducer) AggregateString ¶
func (r *StringFuncReducer) AggregateString(p *StringPoint)
AggregateString takes a StringPoint and invokes the reduce function with the current and new point to modify the current point.
func (*StringFuncReducer) Emit ¶
func (r *StringFuncReducer) Emit() []StringPoint
Emit emits the point that was generated when reducing the points fed in with AggregateString.
type StringIterator ¶
StringIterator represents a stream of string points.
type StringIterator interface { Iterator Next() (*StringPoint, error) }
type StringLiteral ¶
StringLiteral represents a string literal.
type StringLiteral struct { Val string }
func (*StringLiteral) IsTimeLiteral ¶
func (l *StringLiteral) IsTimeLiteral() bool
IsTimeLiteral returns if this string can be interpreted as a time literal.
func (*StringLiteral) String ¶
func (l *StringLiteral) String() string
String returns a string representation of the literal.
func (*StringLiteral) ToTimeLiteral ¶
func (l *StringLiteral) ToTimeLiteral() (*TimeLiteral, error)
ToTimeLiteral returns a time literal if this string can be converted to a time literal.
type StringPoint ¶
StringPoint represents a point with a string value. DO NOT ADD ADDITIONAL FIELDS TO THIS STRUCT. See TestPoint_Fields in influxql/point_test.go for more details.
type StringPoint struct { Name string Tags Tags Time int64 Nil bool Value string Aux []interface{} // Total number of points that were combined into this point from an aggregate. // If this is zero, the point is not the result of an aggregate function. Aggregated uint32 }
func (*StringPoint) Clone ¶
func (v *StringPoint) Clone() *StringPoint
Clone returns a copy of v.
func (*StringPoint) CopyTo ¶
func (v *StringPoint) CopyTo(other *StringPoint)
CopyTo makes a deep copy into the point.
type StringPointAggregator ¶
StringPointAggregator aggregates points to produce a single point.
type StringPointAggregator interface { AggregateString(p *StringPoint) }
type StringPointDecoder ¶
StringPointDecoder decodes StringPoint points from a reader.
type StringPointDecoder struct {
// contains filtered or unexported fields
}
func NewStringPointDecoder ¶
func NewStringPointDecoder(r io.Reader) *StringPointDecoder
NewStringPointDecoder returns a new instance of StringPointDecoder that reads from r.
func (*StringPointDecoder) DecodeStringPoint ¶
func (dec *StringPointDecoder) DecodeStringPoint(p *StringPoint) error
DecodeStringPoint reads from the underlying reader and unmarshals into p.
func (*StringPointDecoder) Stats ¶
func (dec *StringPointDecoder) Stats() IteratorStats
Stats returns iterator stats embedded within the stream.
type StringPointEmitter ¶
StringPointEmitter produces a single point from an aggregate.
type StringPointEmitter interface { Emit() []StringPoint }
type StringPointEncoder ¶
StringPointEncoder encodes StringPoint points to a writer.
type StringPointEncoder struct {
// contains filtered or unexported fields
}
func NewStringPointEncoder ¶
func NewStringPointEncoder(w io.Writer) *StringPointEncoder
NewStringPointEncoder returns a new instance of StringPointEncoder that writes to w.
func (*StringPointEncoder) EncodeStringPoint ¶
func (enc *StringPointEncoder) EncodeStringPoint(p *StringPoint) error
EncodeStringPoint marshals and writes p to the underlying writer.
type StringReduceBooleanFunc ¶
StringReduceBooleanFunc is the function called by a StringPoint reducer.
type StringReduceBooleanFunc func(prev *BooleanPoint, curr *StringPoint) (t int64, v bool, aux []interface{})
type StringReduceBooleanSliceFunc ¶
StringReduceBooleanSliceFunc is the function called by a StringPoint reducer.
type StringReduceBooleanSliceFunc func(a []StringPoint) []BooleanPoint
type StringReduceFloatFunc ¶
StringReduceFloatFunc is the function called by a StringPoint reducer.
type StringReduceFloatFunc func(prev *FloatPoint, curr *StringPoint) (t int64, v float64, aux []interface{})
type StringReduceFloatSliceFunc ¶
StringReduceFloatSliceFunc is the function called by a StringPoint reducer.
type StringReduceFloatSliceFunc func(a []StringPoint) []FloatPoint
type StringReduceFunc ¶
StringReduceFunc is the function called by a StringPoint reducer.
type StringReduceFunc func(prev *StringPoint, curr *StringPoint) (t int64, v string, aux []interface{})
type StringReduceIntegerFunc ¶
StringReduceIntegerFunc is the function called by a StringPoint reducer.
type StringReduceIntegerFunc func(prev *IntegerPoint, curr *StringPoint) (t int64, v int64, aux []interface{})
type StringReduceIntegerSliceFunc ¶
StringReduceIntegerSliceFunc is the function called by a StringPoint reducer.
type StringReduceIntegerSliceFunc func(a []StringPoint) []IntegerPoint
type StringReduceSliceFunc ¶
StringReduceSliceFunc is the function called by a StringPoint reducer.
type StringReduceSliceFunc func(a []StringPoint) []StringPoint
type StringSampleReducer ¶
StringSampleReducer implements a reservoir sampling to calculate a random subset of points
type StringSampleReducer struct {
// contains filtered or unexported fields
}
func NewStringSampleReducer ¶
func NewStringSampleReducer(size int) *StringSampleReducer
NewStringSampleReducer creates a new StringSampleReducer
func (*StringSampleReducer) AggregateString ¶
func (r *StringSampleReducer) AggregateString(p *StringPoint)
AggregateString aggregates a point into the reducer.
func (*StringSampleReducer) Emit ¶
func (r *StringSampleReducer) Emit() []StringPoint
Emit emits the reservoir sample as many points.
type StringSliceFuncBooleanReducer ¶
StringSliceFuncBooleanReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type StringSliceFuncBooleanReducer struct {
// contains filtered or unexported fields
}
func NewStringSliceFuncBooleanReducer ¶
func NewStringSliceFuncBooleanReducer(fn StringReduceBooleanSliceFunc) *StringSliceFuncBooleanReducer
NewStringSliceFuncBooleanReducer creates a new StringSliceFuncBooleanReducer.
func (*StringSliceFuncBooleanReducer) AggregateString ¶
func (r *StringSliceFuncBooleanReducer) AggregateString(p *StringPoint)
AggregateString copies the StringPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*StringSliceFuncBooleanReducer) AggregateStringBulk ¶
func (r *StringSliceFuncBooleanReducer) AggregateStringBulk(points []StringPoint)
AggregateStringBulk performs a bulk copy of StringPoints into the internal slice. This is a more efficient version of calling AggregateString on each point.
func (*StringSliceFuncBooleanReducer) Emit ¶
func (r *StringSliceFuncBooleanReducer) Emit() []BooleanPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type StringSliceFuncFloatReducer ¶
StringSliceFuncFloatReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type StringSliceFuncFloatReducer struct {
// contains filtered or unexported fields
}
func NewStringSliceFuncFloatReducer ¶
func NewStringSliceFuncFloatReducer(fn StringReduceFloatSliceFunc) *StringSliceFuncFloatReducer
NewStringSliceFuncFloatReducer creates a new StringSliceFuncFloatReducer.
func (*StringSliceFuncFloatReducer) AggregateString ¶
func (r *StringSliceFuncFloatReducer) AggregateString(p *StringPoint)
AggregateString copies the StringPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*StringSliceFuncFloatReducer) AggregateStringBulk ¶
func (r *StringSliceFuncFloatReducer) AggregateStringBulk(points []StringPoint)
AggregateStringBulk performs a bulk copy of StringPoints into the internal slice. This is a more efficient version of calling AggregateString on each point.
func (*StringSliceFuncFloatReducer) Emit ¶
func (r *StringSliceFuncFloatReducer) Emit() []FloatPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type StringSliceFuncIntegerReducer ¶
StringSliceFuncIntegerReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type StringSliceFuncIntegerReducer struct {
// contains filtered or unexported fields
}
func NewStringSliceFuncIntegerReducer ¶
func NewStringSliceFuncIntegerReducer(fn StringReduceIntegerSliceFunc) *StringSliceFuncIntegerReducer
NewStringSliceFuncIntegerReducer creates a new StringSliceFuncIntegerReducer.
func (*StringSliceFuncIntegerReducer) AggregateString ¶
func (r *StringSliceFuncIntegerReducer) AggregateString(p *StringPoint)
AggregateString copies the StringPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*StringSliceFuncIntegerReducer) AggregateStringBulk ¶
func (r *StringSliceFuncIntegerReducer) AggregateStringBulk(points []StringPoint)
AggregateStringBulk performs a bulk copy of StringPoints into the internal slice. This is a more efficient version of calling AggregateString on each point.
func (*StringSliceFuncIntegerReducer) Emit ¶
func (r *StringSliceFuncIntegerReducer) Emit() []IntegerPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type StringSliceFuncReducer ¶
StringSliceFuncReducer is a reducer that aggregates the passed in points and then invokes the function to reduce the points when they are emitted.
type StringSliceFuncReducer struct {
// contains filtered or unexported fields
}
func NewStringSliceFuncReducer ¶
func NewStringSliceFuncReducer(fn StringReduceSliceFunc) *StringSliceFuncReducer
NewStringSliceFuncReducer creates a new StringSliceFuncReducer.
func (*StringSliceFuncReducer) AggregateString ¶
func (r *StringSliceFuncReducer) AggregateString(p *StringPoint)
AggregateString copies the StringPoint into the internal slice to be passed to the reduce function when Emit is called.
func (*StringSliceFuncReducer) AggregateStringBulk ¶
func (r *StringSliceFuncReducer) AggregateStringBulk(points []StringPoint)
AggregateStringBulk performs a bulk copy of StringPoints into the internal slice. This is a more efficient version of calling AggregateString on each point.
func (*StringSliceFuncReducer) Emit ¶
func (r *StringSliceFuncReducer) Emit() []StringPoint
Emit invokes the reduce function on the aggregated points to generate the aggregated points. This method does not clear the points from the internal slice.
type SubQuery ¶
SubQuery is a source with a SelectStatement as the backing store.
type SubQuery struct { Statement *SelectStatement }
func (*SubQuery) String ¶
func (s *SubQuery) String() string
String returns a string representation of the subquery.
type TagMap ¶
type TagMap string
func (TagMap) Value ¶
func (s TagMap) Value(tags Tags, buf []interface{}) interface{}
type TagSet ¶
TagSet is a fundamental concept within the query system. It represents a composite series, composed of multiple individual series that share a set of tag attributes.
type TagSet struct { Tags map[string]string Filters []Expr SeriesKeys []string Key []byte }
func (*TagSet) AddFilter ¶
func (t *TagSet) AddFilter(key string, filter Expr)
AddFilter adds a series-level filter to the Tagset.
func (*TagSet) Len ¶
func (t *TagSet) Len() int
func (*TagSet) Less ¶
func (t *TagSet) Less(i, j int) bool
func (*TagSet) Reverse ¶
func (t *TagSet) Reverse()
Reverse reverses the order of series keys and filters in the TagSet.
func (*TagSet) Swap ¶
func (t *TagSet) Swap(i, j int)
type Tags ¶
Tags represent a map of keys and values. It memoizes its key so it can be used efficiently during query execution.
type Tags struct {
// contains filtered or unexported fields
}
func NewTags ¶
func NewTags(m map[string]string) Tags
NewTags returns a new instance of Tags.
func (*Tags) Equals ¶
func (t *Tags) Equals(other *Tags) bool
Equals returns true if t equals other.
func (Tags) ID ¶
func (t Tags) ID() string
ID returns the string identifier for the tags.
func (Tags) KeyValues ¶
func (t Tags) KeyValues() map[string]string
KeyValues returns the underlying map for the tags.
func (*Tags) Keys ¶
func (t *Tags) Keys() []string
Keys returns a sorted list of all keys on the tag.
func (*Tags) Subset ¶
func (t *Tags) Subset(keys []string) Tags
Subset returns a new tags object with a subset of the keys.
func (*Tags) Value ¶
func (t *Tags) Value(k string) string
Value returns the value for a given key.
type Target ¶
Target represents a target (destination) policy, measurement, and DB.
type Target struct {
// Measurement to write into.
Measurement *Measurement
}
func (*Target) String ¶
func (t *Target) String() string
String returns a string representation of the Target.
type TaskManager ¶
TaskManager takes care of all aspects related to managing running queries.
type TaskManager struct { // Query execution timeout. QueryTimeout time.Duration // Log queries if they are slower than this time. // If zero, slow queries will never be logged. LogQueriesAfter time.Duration // Maximum number of concurrent queries. MaxConcurrentQueries int // Logger to use for all logging. // Defaults to discarding all log output. Logger zap.Logger // contains filtered or unexported fields }
func NewTaskManager ¶
func NewTaskManager() *TaskManager
NewTaskManager creates a new TaskManager.
func (*TaskManager) AttachQuery ¶
func (t *TaskManager) AttachQuery(q *Query, database string, interrupt <-chan struct{}) (uint64, *QueryTask, error)
AttachQuery attaches a running query to be managed by the TaskManager. Returns the query id of the newly attached query or an error if it was unable to assign a query id or attach the query to the TaskManager. This function also returns a channel that will be closed when this query finishes running.
After a query finishes running, the system is free to reuse a query id.
func (*TaskManager) Close ¶
func (t *TaskManager) Close() error
Close kills all running queries and prevents new queries from being attached.
func (*TaskManager) ExecuteStatement ¶
func (t *TaskManager) ExecuteStatement(stmt Statement, ctx ExecutionContext) error
ExecuteStatement executes a statement containing one of the task management queries.
func (*TaskManager) KillQuery ¶
func (t *TaskManager) KillQuery(qid uint64) error
KillQuery stops and removes a query from the TaskManager. This method can be used to forcefully terminate a running query.
func (*TaskManager) Queries ¶
func (t *TaskManager) Queries() []QueryInfo
Queries returns a list of all running queries with information about them.
type TimeLiteral ¶
TimeLiteral represents a point-in-time literal.
type TimeLiteral struct { Val time.Time }
func (*TimeLiteral) String ¶
func (l *TimeLiteral) String() string
String returns a string representation of the literal.
type Token ¶
Token is a lexical token of the InfluxQL language.
type Token int
These are a comprehensive list of InfluxQL language tokens.
const ( // ILLEGAL Token, EOF, WS are Special InfluxQL tokens. ILLEGAL Token = iota EOF WS // IDENT and the following are InfluxQL literal tokens. IDENT // main BOUNDPARAM // $param NUMBER // 12345.67 INTEGER // 12345 DURATIONVAL // 13h STRING // "abc" BADSTRING // "abc BADESCAPE // \q TRUE // true FALSE // false REGEX // Regular expressions BADREGEX // `.* // ADD and the following are InfluxQL Operators ADD // + SUB // - MUL // * DIV // / AND // AND OR // OR EQ // = NEQ // != EQREGEX // =~ NEQREGEX // !~ LT // < LTE // <= GT // > GTE // >= LPAREN // ( RPAREN // ) COMMA // , COLON // : DOUBLECOLON // :: SEMICOLON // ; DOT // . // ALL and the following are InfluxQL Keywords ALL ALTER ANY AS ASC BEGIN BY CREATE CONTINUOUS DATABASE DATABASES DEFAULT DELETE DESC DESTINATIONS DIAGNOSTICS DISTINCT DROP DURATION END EVERY EXPLAIN FIELD FOR FROM GRANT GRANTS GROUP GROUPS IN INF INSERT INTO KEY KEYS KILL LIMIT MEASUREMENT MEASUREMENTS NAME OFFSET ON ORDER PASSWORD POLICY POLICIES PRIVILEGES QUERIES QUERY READ REPLICATION RESAMPLE RETENTION REVOKE SELECT SERIES SET SHOW SHARD SHARDS SLIMIT SOFFSET STATS SUBSCRIPTION SUBSCRIPTIONS TAG TO USER USERS VALUES WHERE WITH WRITE )
func Lookup ¶
func Lookup(ident string) Token
Lookup returns the token associated with a given string.
func (Token) Precedence ¶
func (tok Token) Precedence() int
Precedence returns the operator precedence of the binary operator token.
func (Token) String ¶
func (tok Token) String() string
String returns the string representation of the token.
type TypeMapper ¶
TypeMapper maps a data type to the measurement and field.
type TypeMapper interface { MapType(measurement *Measurement, field string) DataType }
type Valuer ¶
Valuer is the interface that wraps the Value() method.
type Valuer interface {
// Value returns the value and existence flag for a given key.
Value(key string) (interface{}, bool)
}
type VarRef ¶
VarRef represents a reference to a variable.
type VarRef struct { Val string Type DataType }
func (*VarRef) String ¶
func (r *VarRef) String() string
String returns a string representation of the variable reference.
type VarRefs ¶
VarRefs represents a slice of VarRef types.
type VarRefs []VarRef
func (VarRefs) Len ¶
func (a VarRefs) Len() int
Len implements sort.Interface.
func (VarRefs) Less ¶
func (a VarRefs) Less(i, j int) bool
Less implements sort.Interface.
func (VarRefs) Strings ¶
func (a VarRefs) Strings() []string
Strings returns a slice of the variable names.
func (VarRefs) Swap ¶
func (a VarRefs) Swap(i, j int)
Swap implements sort.Interface.
type Visitor ¶
Visitor can be called by Walk to traverse an AST hierarchy. The Visit() function is called once per node.
type Visitor interface { Visit(Node) Visitor }
type Wildcard ¶
Wildcard represents a wild card expression.
type Wildcard struct { Type Token }
func (*Wildcard) String ¶
func (e *Wildcard) String() string
String returns a string representation of the wildcard.
Subdirectories
Name | Synopsis |
---|---|
.. | |
neldermead | Package neldermead is an implementation of the Nelder-Mead optimization method. |