-
Notifications
You must be signed in to change notification settings - Fork 139
/
store.go
84 lines (62 loc) · 2.39 KB
/
store.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package reads
import (
"context"
"github.com/gogo/protobuf/proto"
"github.com/influxdata/influxdb/models"
"github.com/influxdata/influxdb/storage/reads/datatypes"
"github.com/influxdata/influxdb/tsdb/cursors"
)
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
}
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
}
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 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(db, rp string) proto.Message
}