| 1 |
package storage |
| 2 |
|
| 3 |
import ( |
| 4 |
"context" |
| 5 |
"time" |
| 6 |
|
| 7 |
"github.com/influxdata/influxdb/services/meta" |
| 8 |
"github.com/influxdata/influxdb/tsdb" |
| 9 |
) |
| 10 |
|
| 11 |
type MetaClient interface { |
| 12 |
ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta.ShardGroupInfo, err error) |
| 13 |
} |
| 14 |
|
| 15 |
|
| 16 |
type ReadRequest struct { |
| 17 |
Database string |
| 18 |
RP string |
| 19 |
Shards []*tsdb.Shard |
| 20 |
Start int64 |
| 21 |
End int64 |
| 22 |
} |
| 23 |
|
| 24 |
type Store struct { |
| 25 |
TSDBStore *tsdb.Store |
| 26 |
} |
| 27 |
|
| 28 |
d. |
| 29 |
func (s *Store) Read(ctx context.Context, req *ReadRequest) (*ResultSet, error) { |
| 30 |
var cur seriesCursor |
| 31 |
if ic, err := newIndexSeriesCursor(ctx, req.Shards); err != nil { |
| 32 |
return nil, err |
| 33 |
} else if ic == nil { |
| 34 |
return nil, nil |
| 35 |
} else { |
| 36 |
cur = ic |
| 37 |
} |
| 38 |
|
| 39 |
return newResultSet(ctx, req, cur), nil |
| 40 |
} |