Skip to content

Commit e37b7f9

Browse files
committed
Improve ShardIndex and ShardCount doc
Signed-off-by: Marco Pracucci <[email protected]>
1 parent 4f0dbcb commit e37b7f9

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

storage/interface.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,19 @@ type SelectHints struct {
197197
By bool // Indicate whether it is without or by.
198198
Range int64 // Range vector selector range in milliseconds.
199199

200-
ShardIndex uint64 // Current shard index (starts from 0 and up to ShardCount-1).
201-
ShardCount uint64 // Total number of shards (0 means sharding is disabled).
200+
// ShardCount is the total number of shards that series should be split into
201+
// at query time. Then, only series in the ShardIndex shard will be returned
202+
// by the query.
203+
//
204+
// ShardCount equal to 0 means that sharding is disabled.
205+
ShardCount uint64
206+
207+
// ShardIndex is the series shard index to query. The index must be between 0 and ShardCount-1.
208+
// When ShardCount is set to a value > 0, then a query will only process series within the
209+
// ShardIndex's shard.
210+
//
211+
// Series are sharded by "labels stable hash" mod "ShardCount".
212+
ShardIndex uint64
202213

203214
// DisableTrimming allows to disable trimming of matching series chunks based on query Start and End time.
204215
// When disabled, the result may contain samples outside the queried time range but Select() performances

0 commit comments

Comments
 (0)