@@ -238,20 +238,11 @@ type entries interface {
238
238
FilterReadQueries (queries []IndexQuery , shard * astmapper.ShardAnnotation ) []IndexQuery
239
239
}
240
240
241
- // noops is a placeholder which can be embedded to provide default implementations
242
- type noops struct {}
243
-
244
- func (n noops ) FilterReadQueries (queries []IndexQuery , shard * astmapper.ShardAnnotation ) []IndexQuery {
245
- return queries
246
- }
247
-
248
241
// original entries:
249
242
// - hash key: <userid>:<bucket>:<metric name>
250
243
// - range key: <label name>\0<label value>\0<chunk name>
251
244
252
- type originalEntries struct {
253
- noops
254
- }
245
+ type originalEntries struct {}
255
246
256
247
func (originalEntries ) GetWriteEntries (bucket Bucket , metricName string , labels labels.Labels , chunkID string ) ([]IndexEntry , error ) {
257
248
chunkIDBytes := []byte (chunkID )
@@ -320,6 +311,10 @@ func (originalEntries) GetLabelNamesForSeries(_ Bucket, _ []byte) ([]IndexQuery,
320
311
return nil , ErrNotSupported
321
312
}
322
313
314
+ func (originalEntries ) FilterReadQueries (queries []IndexQuery , shard * astmapper.ShardAnnotation ) []IndexQuery {
315
+ return queries
316
+ }
317
+
323
318
// v3Schema went to base64 encoded label values & a version ID
324
319
// - range key: <label name>\0<base64(label value)>\0<chunk name>\0<version 1>
325
320
@@ -368,9 +363,7 @@ func (base64Entries) GetReadMetricLabelValueQueries(bucket Bucket, metricName st
368
363
// - range key: \0<base64(label value)>\0<chunk name>\0<version 2>
369
364
// 2) - hash key: <userid>:<hour bucket>:<metric name>
370
365
// - range key: \0\0<chunk name>\0<version 3>
371
- type labelNameInHashKeyEntries struct {
372
- noops
373
- }
366
+ type labelNameInHashKeyEntries struct {}
374
367
375
368
func (labelNameInHashKeyEntries ) GetWriteEntries (bucket Bucket , metricName string , labels labels.Labels , chunkID string ) ([]IndexEntry , error ) {
376
369
chunkIDBytes := []byte (chunkID )
@@ -441,12 +434,14 @@ func (labelNameInHashKeyEntries) GetLabelNamesForSeries(_ Bucket, _ []byte) ([]I
441
434
return nil , ErrNotSupported
442
435
}
443
436
437
+ func (labelNameInHashKeyEntries ) FilterReadQueries (queries []IndexQuery , shard * astmapper.ShardAnnotation ) []IndexQuery {
438
+ return queries
439
+ }
440
+
444
441
// v5 schema is an extension of v4, with the chunk end time in the
445
442
// range key to improve query latency. However, it did it wrong
446
443
// so the chunk end times are ignored.
447
- type v5Entries struct {
448
- noops
449
- }
444
+ type v5Entries struct {}
450
445
451
446
func (v5Entries ) GetWriteEntries (bucket Bucket , metricName string , labels labels.Labels , chunkID string ) ([]IndexEntry , error ) {
452
447
chunkIDBytes := []byte (chunkID )
@@ -517,11 +512,13 @@ func (v5Entries) GetLabelNamesForSeries(_ Bucket, _ []byte) ([]IndexQuery, error
517
512
return nil , ErrNotSupported
518
513
}
519
514
515
+ func (v5Entries ) FilterReadQueries (queries []IndexQuery , shard * astmapper.ShardAnnotation ) []IndexQuery {
516
+ return queries
517
+ }
518
+
520
519
// v6Entries fixes issues with v5 time encoding being wrong (see #337), and
521
520
// moves label value out of range key (see #199).
522
- type v6Entries struct {
523
- noops
524
- }
521
+ type v6Entries struct {}
525
522
526
523
func (v6Entries ) GetWriteEntries (bucket Bucket , metricName string , labels labels.Labels , chunkID string ) ([]IndexEntry , error ) {
527
524
chunkIDBytes := []byte (chunkID )
@@ -599,11 +596,13 @@ func (v6Entries) GetLabelNamesForSeries(_ Bucket, _ []byte) ([]IndexQuery, error
599
596
return nil , ErrNotSupported
600
597
}
601
598
602
- // v9Entries adds a layer of indirection between labels -> series -> chunks.
603
- type v9Entries struct {
604
- noops
599
+ func (v6Entries ) FilterReadQueries (queries []IndexQuery , shard * astmapper.ShardAnnotation ) []IndexQuery {
600
+ return queries
605
601
}
606
602
603
+ // v9Entries adds a layer of indirection between labels -> series -> chunks.
604
+ type v9Entries struct {}
605
+
607
606
func (v9Entries ) GetWriteEntries (bucket Bucket , metricName string , labels labels.Labels , chunkID string ) ([]IndexEntry , error ) {
608
607
return nil , ErrNotSupported
609
608
}
@@ -699,6 +698,10 @@ func (v9Entries) GetLabelNamesForSeries(_ Bucket, _ []byte) ([]IndexQuery, error
699
698
return nil , ErrNotSupported
700
699
}
701
700
701
+ func (v9Entries ) FilterReadQueries (queries []IndexQuery , shard * astmapper.ShardAnnotation ) []IndexQuery {
702
+ return queries
703
+ }
704
+
702
705
// v10Entries builds on v9 by sharding index rows to reduce their size.
703
706
type v10Entries struct {
704
707
rowShards uint32
0 commit comments