Documentation ¶
Index ¶
- Constants
- Variables
- func EvalExprBool(expr influxql.Expr, m Valuer) bool
- func HasFieldValueKey(expr influxql.Expr) bool
- func IsTrueBooleanLiteral(expr influxql.Expr) bool
- func NewReader(s Store) influxdb.Reader
- func NodeToExpr(node *datatypes.Node, remap map[string]string) (influxql.Expr, error)
- func PredicateToExprString(p *datatypes.Predicate) string
- func ResultSetToLineProtocol(wr io.Writer, rs ResultSet) (err error)
- func RewriteExprRemoveFieldValue(expr influxql.Expr) influxql.Expr
- func WalkChildren(v NodeVisitor, node *datatypes.Node)
- func WalkNode(v NodeVisitor, node *datatypes.Node)
- type GroupCursor
- type GroupOption
- type GroupResultSet
- type GroupResultSetStreamReader
- type MergedStringIterator
- type NodeVisitor
- type ResponseStream
- type ResponseWriter
- type ResultSet
- type ResultSetStreamReader
- func (r *ResultSetStreamReader) Close()
- func (r *ResultSetStreamReader) Cursor() cursors.Cursor
- func (r *ResultSetStreamReader) Err() error
- func (r *ResultSetStreamReader) Next() bool
- func (r *ResultSetStreamReader) Peek()
- func (r *ResultSetStreamReader) Stats() cursors.CursorStats
- func (r *ResultSetStreamReader) Tags() models.Tags
- type SeriesCursor
- type SeriesRow
- type StorageReadClient
- type Store
- type StreamClient
- type StreamReader
- type StringIteratorStream
- type StringIteratorStreamReader
- type StringIteratorWriter
- type StringValuesStreamReader
- type Valuer
Constants ¶
const ( // MaxPointsPerBlock is the maximum number of points in an encoded // block in a TSM file. It should match the value in the tsm1 // package, but we don't want to import it. MaxPointsPerBlock = 1000 )
Variables ¶
var ( // ErrPartitionKeyOrder means the partition keys for a // GroupResultSetStreamReader were incorrectly ordered. ErrPartitionKeyOrder = errors.New("invalid partition key order") // ErrStreamNoData means the StreamReader repeatedly returned no data // when calling Recv ErrStreamNoData = errors.New("peekFrame: no data") )
var BooleanEmptyArrayCursor cursors.BooleanArrayCursor = &booleanEmptyArrayCursor{}
var FloatEmptyArrayCursor cursors.FloatArrayCursor = &floatEmptyArrayCursor{}
var IntegerEmptyArrayCursor cursors.IntegerArrayCursor = &integerEmptyArrayCursor{}
var StringEmptyArrayCursor cursors.StringArrayCursor = &stringEmptyArrayCursor{}
var UnsignedEmptyArrayCursor cursors.UnsignedArrayCursor = &unsignedEmptyArrayCursor{}
Functions ¶
func HasFieldValueKey ¶
func IsTrueBooleanLiteral ¶
func NodeToExpr ¶
NodeToExpr transforms a predicate node to an influxql.Expr.
func PredicateToExprString ¶
func ResultSetToLineProtocol ¶
ResultSetToLineProtocol transforms rs to line protocol and writes the output to wr.
func WalkChildren ¶
func WalkChildren(v NodeVisitor, node *datatypes.Node)
func WalkNode ¶
func WalkNode(v NodeVisitor, node *datatypes.Node)
Types ¶
type GroupCursor ¶
type GroupCursor interface { // Next advances to the next cursor. Next will return false when there are no // more cursors in the current group. Next() bool // Cursor returns the most recent cursor after a call to Next. Cursor() cursors.Cursor // Tags returns the tags for the most recent cursor after a call to Next. Tags() models.Tags // Keys returns the union of all tag key names for all series produced by // this GroupCursor. Keys() [][]byte // PartitionKeyVals returns the values of all tags identified by the // keys specified in ReadRequest#GroupKeys. The tag values values will // appear in the same order as the GroupKeys. // // When the datatypes.GroupNone strategy is specified, PartitionKeyVals will // be nil. PartitionKeyVals() [][]byte // Close releases any resources allocated by the GroupCursor. Close() // Err returns the first error encountered by the GroupCursor. Err() error Stats() cursors.CursorStats }
type GroupOption ¶
type GroupOption func(g *groupResultSet)
func GroupOptionNilSortLo ¶
func GroupOptionNilSortLo() GroupOption
GroupOptionNilSortLo configures nil values to be sorted lower than any other value
type GroupResultSet ¶
type GroupResultSet interface { // Next advances the GroupResultSet and returns the next GroupCursor. It // returns nil if there are no more groups. Next() GroupCursor // Close releases any resources allocated by the GroupResultSet. Close() // Err returns the first error encountered by the GroupResultSet. Err() error }
func NewGroupByMergedGroupResultSet ¶
func NewGroupByMergedGroupResultSet(g []GroupResultSet) GroupResultSet
Returns a GroupResultSet that merges results using the datatypes.GroupBy strategy. Each source GroupResultSet in g must be configured using the GroupBy strategy with the same GroupKeys or the results are undefined.
func NewGroupNoneMergedGroupResultSet ¶
func NewGroupNoneMergedGroupResultSet(g []GroupResultSet) GroupResultSet
Returns a GroupResultSet that merges results using the datatypes.GroupNone strategy. Each source GroupResultSet in g must be configured using the GroupNone strategy or the results are undefined.
The GroupNone strategy must merge the partition key and tag keys from each source GroupResultSet when producing its
func NewGroupResultSet ¶
func NewGroupResultSet(ctx context.Context, req *datatypes.ReadGroupRequest, newCursorFn func() (SeriesCursor, error), opts ...GroupOption) GroupResultSet
type GroupResultSetStreamReader ¶
type GroupResultSetStreamReader struct {
// contains filtered or unexported fields
}
func NewGroupResultSetStreamReader ¶
func NewGroupResultSetStreamReader(stream StreamReader) *GroupResultSetStreamReader
func (*GroupResultSetStreamReader) Close ¶
func (r *GroupResultSetStreamReader) Close()
func (*GroupResultSetStreamReader) Err ¶
func (r *GroupResultSetStreamReader) Err() error
func (*GroupResultSetStreamReader) Next ¶
func (r *GroupResultSetStreamReader) Next() GroupCursor
func (*GroupResultSetStreamReader) Peek ¶
func (r *GroupResultSetStreamReader) Peek()
Peek reads the next frame on the underlying stream-reader if there is one
type MergedStringIterator ¶
type MergedStringIterator struct {
// contains filtered or unexported fields
}
MergedStringIterator merges multiple storage.StringIterators into one. It sorts and deduplicates adjacent values, so the output is sorted iff all inputs are sorted. If all inputs are not sorted, then output order and deduplication are undefined and unpleasant.
func NewMergedStringIterator ¶
func NewMergedStringIterator(iterators []cursors.StringIterator) *MergedStringIterator
func (*MergedStringIterator) Next ¶
func (msi *MergedStringIterator) Next() bool
func (*MergedStringIterator) Stats ¶
func (msi *MergedStringIterator) Stats() cursors.CursorStats
func (*MergedStringIterator) Value ¶
func (msi *MergedStringIterator) Value() string
type NodeVisitor ¶
type NodeVisitor interface {
Visit(*datatypes.Node) NodeVisitor
}
NodeVisitor can be called by Walk to traverse the Node hierarchy. The Visit() function is called once per node.
type ResponseStream ¶
type ResponseStream interface { Send(*datatypes.ReadResponse) error // SetTrailer sets the trailer metadata which will be sent with the RPC status. // When called more than once, all the provided metadata will be merged. SetTrailer(metadata.MD) }
type ResponseWriter ¶
type ResponseWriter struct {
// contains filtered or unexported fields
}
func NewResponseWriter ¶
func NewResponseWriter(stream ResponseStream, hints datatypes.HintFlags) *ResponseWriter
func (*ResponseWriter) Err ¶
func (w *ResponseWriter) Err() error
func (*ResponseWriter) Flush ¶
func (w *ResponseWriter) Flush()
func (*ResponseWriter) WriteGroupResultSet ¶
func (w *ResponseWriter) WriteGroupResultSet(rs GroupResultSet) error
func (*ResponseWriter) WriteResultSet ¶
func (w *ResponseWriter) WriteResultSet(rs ResultSet) error
func (*ResponseWriter) WrittenN ¶
func (w *ResponseWriter) WrittenN() int
WrittenN returns the number of values written to the response stream.
type ResultSet ¶
type ResultSet interface { // Next advances the ResultSet to the next cursor. It returns false // when there are no more cursors. Next() bool // Cursor returns the most recent cursor after a call to Next. Cursor() cursors.Cursor // Tags returns the tags for the most recent cursor after a call to Next. Tags() models.Tags // Close releases any resources allocated by the ResultSet. Close() // Err returns the first error encountered by the ResultSet. Err() error Stats() cursors.CursorStats }
func NewFilteredResultSet ¶
func NewFilteredResultSet(ctx context.Context, req *datatypes.ReadFilterRequest, cur SeriesCursor) ResultSet
func NewMergedResultSet ¶
NewMergedResultSet combines the results into a single ResultSet, producing keys in ascending lexicographical order. It requires all input results are ordered.
func NewSequenceResultSet ¶
NewSequenceResultSet combines results into a single ResultSet, draining each ResultSet in order before moving to the next.
type ResultSetStreamReader ¶
type ResultSetStreamReader struct {
// contains filtered or unexported fields
}
func NewResultSetStreamReader ¶
func NewResultSetStreamReader(stream StreamReader) *ResultSetStreamReader
func (*ResultSetStreamReader) Close ¶
func (r *ResultSetStreamReader) Close()
func (*ResultSetStreamReader) Cursor ¶
func (r *ResultSetStreamReader) Cursor() cursors.Cursor
func (*ResultSetStreamReader) Err ¶
func (r *ResultSetStreamReader) Err() error
func (*ResultSetStreamReader) Next ¶
func (r *ResultSetStreamReader) Next() bool
func (*ResultSetStreamReader) Peek ¶
func (r *ResultSetStreamReader) Peek()
Peek reads the next frame on the underlying stream-reader if there is one
func (*ResultSetStreamReader) Stats ¶
func (r *ResultSetStreamReader) Stats() cursors.CursorStats
func (*ResultSetStreamReader) Tags ¶
func (r *ResultSetStreamReader) Tags() models.Tags
type SeriesCursor ¶
func NewLimitSeriesCursor ¶
func NewLimitSeriesCursor(ctx context.Context, cur SeriesCursor, n, o int64) SeriesCursor
type StorageReadClient ¶
type StorageReadClient struct {
// contains filtered or unexported fields
}
StorageReadClient adapts a grpc client to implement the cursors.Statistics interface and read the statistics from the gRPC trailer.
func NewStorageReadClient ¶
func NewStorageReadClient(client StreamClient) *StorageReadClient
NewStorageReadClient returns a new StorageReadClient which implements StreamReader and reads the gRPC trailer to return CursorStats.
func (*StorageReadClient) Recv ¶
func (rc *StorageReadClient) Recv() (res *datatypes.ReadResponse, err error)
func (*StorageReadClient) Stats ¶
func (rc *StorageReadClient) Stats() (stats cursors.CursorStats)
type Store ¶
type Store interface { ReadFilter(ctx context.Context, req *datatypes.ReadFilterRequest) (ResultSet, error) ReadGroup(ctx context.Context, req *datatypes.ReadGroupRequest) (GroupResultSet, error) TagKeys(ctx context.Context, req *datatypes.TagKeysRequest) (cursors.StringIterator, error) TagValues(ctx context.Context, req *datatypes.TagValuesRequest) (cursors.StringIterator, error) GetSource(orgID, bucketID uint64) proto.Message }
type StreamClient ¶
type StreamClient interface { StreamReader grpc.ClientStream }
type StreamReader ¶
type StreamReader interface {
Recv() (*datatypes.ReadResponse, error)
}
type StringIteratorStream ¶
type StringIteratorStream interface {
Send(*datatypes.StringValuesResponse) error
}
type StringIteratorStreamReader ¶
type StringIteratorStreamReader struct {
// contains filtered or unexported fields
}
func NewStringIteratorStreamReader ¶
func NewStringIteratorStreamReader(stream StringValuesStreamReader) *StringIteratorStreamReader
func (*StringIteratorStreamReader) Err ¶
func (r *StringIteratorStreamReader) Err() error
func (*StringIteratorStreamReader) Next ¶
func (r *StringIteratorStreamReader) Next() bool
func (*StringIteratorStreamReader) Stats ¶
func (r *StringIteratorStreamReader) Stats() cursors.CursorStats
func (*StringIteratorStreamReader) Value ¶
func (r *StringIteratorStreamReader) Value() string
type StringIteratorWriter ¶
type StringIteratorWriter struct {
// contains filtered or unexported fields
}
func NewStringIteratorWriter ¶
func NewStringIteratorWriter(stream StringIteratorStream) *StringIteratorWriter
func (*StringIteratorWriter) Err ¶
func (w *StringIteratorWriter) Err() error
func (*StringIteratorWriter) Flush ¶
func (w *StringIteratorWriter) Flush()
func (*StringIteratorWriter) WriteStringIterator ¶
func (w *StringIteratorWriter) WriteStringIterator(si cursors.StringIterator) error
func (*StringIteratorWriter) WrittenN ¶
func (w *StringIteratorWriter) WrittenN() int
type StringValuesStreamReader ¶
type StringValuesStreamReader interface {
Recv() (*datatypes.StringValuesResponse, error)
}
Source Files ¶
- array_cursor.gen.go
- array_cursor.go
- eval.go
- expr.go
- gen.go
- group_resultset.go
- keymerger.go
- merge.go
- mergegroupresultset.go
- predicate.go
- reader.go
- readstate_string.go
- response_writer.gen.go
- response_writer.go
- resultset.go
- resultset_lineprotocol.go
- series_cursor.go
- store.go
- stream_reader.gen.go
- stream_reader.go
- string_iterator_reader.go
- string_iterator_writer.go
- table.gen.go
- table.go
- tags_cache.go
- tagsbuffer.go