2018-10-05 22:02:31 +00:00
|
|
|
package reads
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/gogo/protobuf/proto"
|
2020-07-28 22:59:11 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/models"
|
2020-04-03 17:39:20 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/storage/reads/datatypes"
|
2020-08-26 17:46:47 +00:00
|
|
|
"github.com/influxdata/influxdb/v2/tsdb/cursors"
|
2018-10-05 22:02:31 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type ResultSet interface {
|
2018-11-20 18:38:36 +00:00
|
|
|
// Next advances the ResultSet to the next cursor. It returns false
|
|
|
|
// when there are no more cursors.
|
2018-10-05 22:02:31 +00:00
|
|
|
Next() bool
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// Cursor returns the most recent cursor after a call to Next.
|
2018-10-05 22:02:31 +00:00
|
|
|
Cursor() cursors.Cursor
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// Tags returns the tags for the most recent cursor after a call to Next.
|
2018-10-05 22:02:31 +00:00
|
|
|
Tags() models.Tags
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// Close releases any resources allocated by the ResultSet.
|
|
|
|
Close()
|
|
|
|
|
|
|
|
// Err returns the first error encountered by the ResultSet.
|
|
|
|
Err() error
|
2018-11-07 16:31:42 +00:00
|
|
|
|
|
|
|
Stats() cursors.CursorStats
|
2018-10-05 22:02:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type GroupResultSet interface {
|
2018-11-20 18:38:36 +00:00
|
|
|
// Next advances the GroupResultSet and returns the next GroupCursor. It
|
|
|
|
// returns nil if there are no more groups.
|
2018-10-05 22:02:31 +00:00
|
|
|
Next() GroupCursor
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// Close releases any resources allocated by the GroupResultSet.
|
2018-10-05 22:02:31 +00:00
|
|
|
Close()
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// Err returns the first error encountered by the GroupResultSet.
|
|
|
|
Err() error
|
2018-10-05 22:02:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type GroupCursor interface {
|
2018-11-20 18:38:36 +00:00
|
|
|
// 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.
|
2018-10-05 22:02:31 +00:00
|
|
|
Tags() models.Tags
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// Keys returns the union of all tag key names for all series produced by
|
|
|
|
// this GroupCursor.
|
2018-10-05 22:02:31 +00:00
|
|
|
Keys() [][]byte
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// 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.
|
2018-10-05 22:02:31 +00:00
|
|
|
PartitionKeyVals() [][]byte
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// Close releases any resources allocated by the GroupCursor.
|
2018-10-05 22:02:31 +00:00
|
|
|
Close()
|
2018-11-20 18:38:36 +00:00
|
|
|
|
|
|
|
// Err returns the first error encountered by the GroupCursor.
|
|
|
|
Err() error
|
2018-11-07 16:31:42 +00:00
|
|
|
|
|
|
|
Stats() cursors.CursorStats
|
2020-07-29 20:31:29 +00:00
|
|
|
|
|
|
|
Aggregate() *datatypes.Aggregate
|
2018-10-05 22:02:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Store interface {
|
2019-04-02 21:03:25 +00:00
|
|
|
ReadFilter(ctx context.Context, req *datatypes.ReadFilterRequest) (ResultSet, error)
|
2019-04-24 23:18:33 +00:00
|
|
|
ReadGroup(ctx context.Context, req *datatypes.ReadGroupRequest) (GroupResultSet, error)
|
2020-10-22 21:34:22 +00:00
|
|
|
// WindowAggregate will invoke a ReadWindowAggregateRequest against the Store.
|
|
|
|
WindowAggregate(ctx context.Context, req *datatypes.ReadWindowAggregateRequest) (ResultSet, error)
|
2019-04-24 23:18:33 +00:00
|
|
|
|
2019-04-17 23:11:09 +00:00
|
|
|
TagKeys(ctx context.Context, req *datatypes.TagKeysRequest) (cursors.StringIterator, error)
|
|
|
|
TagValues(ctx context.Context, req *datatypes.TagValuesRequest) (cursors.StringIterator, error)
|
2019-04-24 23:18:33 +00:00
|
|
|
|
2020-07-30 01:08:04 +00:00
|
|
|
GetSource(orgID, bucketID uint64) proto.Message
|
2020-04-21 19:15:38 +00:00
|
|
|
}
|