reads

package
v0.0.0-...-d500d3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 35 Imported by: 1

Documentation

Index

Constants

View Source
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

View Source
var (
	// ErrSeriesKeyOrder means the series keys for a ResultSetStreamReader were
	// incorrectly ordered.
	ErrSeriesKeyOrder = errors.New("invalid series key order")

	// ErrPartitionKeyOrder means the partition keys for a
	// GroupResultSetStreamReader were incorrectly ordered.
	ErrPartitionKeyOrder = errors.New("invalid partition key order")
)
View Source
var BooleanEmptyArrayCursor cursors.BooleanArrayCursor = &booleanEmptyArrayCursor{}
View Source
var FloatEmptyArrayCursor cursors.FloatArrayCursor = &floatEmptyArrayCursor{}
View Source
var IntegerEmptyArrayCursor cursors.IntegerArrayCursor = &integerEmptyArrayCursor{}
View Source
var StringEmptyArrayCursor cursors.StringArrayCursor = &stringEmptyArrayCursor{}
View Source
var UnsignedEmptyArrayCursor cursors.UnsignedArrayCursor = &unsignedEmptyArrayCursor{}

Functions

func EvalExprBool

func EvalExprBool(expr influxql.Expr, m Valuer) bool

func HasFieldValueKey

func HasFieldValueKey(expr influxql.Expr) bool

func IsTrueBooleanLiteral

func IsTrueBooleanLiteral(expr influxql.Expr) bool

func NewReader

func NewReader(s Store) fstorage.Reader

func NodeToExpr

func NodeToExpr(node *datatypes.Node, remap map[string]string) (influxql.Expr, error)

NodeToExpr transforms a predicate node to an influxql.Expr.

func PredicateToExprString

func PredicateToExprString(p *datatypes.Predicate) string

func RewriteExprRemoveFieldValue

func RewriteExprRemoveFieldValue(expr influxql.Expr) influxql.Expr

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.ReadRequest, 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 (*GroupResultSetStreamReader) Next

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 NewMergedResultSet

func NewMergedResultSet(results []ResultSet) ResultSet

func NewResultSet

func NewResultSet(ctx context.Context, req *datatypes.ReadRequest, cur SeriesCursor) ResultSet

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) Stats

func (*ResultSetStreamReader) Tags

func (r *ResultSetStreamReader) Tags() models.Tags

type SeriesCursor

type SeriesCursor interface {
	Close()
	Next() *SeriesRow
	Err() error
}

func NewLimitSeriesCursor

func NewLimitSeriesCursor(ctx context.Context, cur SeriesCursor, n, o int64) SeriesCursor

type SeriesRow

type SeriesRow struct {
	SortKey    []byte
	Name       []byte      // measurement name
	SeriesTags models.Tags // unmodified series tags
	Tags       models.Tags
	Field      string
	Query      cursors.CursorIterators
	ValueCond  influxql.Expr
}

type Store

type Store interface {
	Read(ctx context.Context, req *datatypes.ReadRequest) (ResultSet, error)
	GroupRead(ctx context.Context, req *datatypes.ReadRequest) (GroupResultSet, error)
	GetSource(rs fstorage.ReadSpec) (proto.Message, error)
}

type StreamReader

type StreamReader interface {
	Recv() (*datatypes.ReadResponse, error)
}

type Valuer

type Valuer interface {
	// Value returns the value and existence flag for a given key.
	Value(key string) (interface{}, bool)
}

Valuer is the interface that wraps the Value() method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL