File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,20 @@ import (
1818// distribute load while preserving stream locality for tenants.
1919type SegmentationKey string
2020
21+ << << << < HEAD
2122// Sum64 returns a 64 bit, non-cryptographic hash of the key.
23+ == == == =
24+ // Sum64 returns a 64 bit, non-crytogrpahic hash of the key.
25+ >> >> >> > 5 ef092522a (feat : add segmentation keys and resolver )
2226func (key SegmentationKey ) Sum64 () uint64 {
2327 h := fnv .New64a ()
2428 // Use a reserved word here to avoid any possible hash conflicts with
2529 // streams.
30+ << << << < HEAD
2631 h .Write ([]byte ("__loki_segmentation_key__" ))
32+ == == == =
33+ h .Write ([]byte ("__loki__segmentation_key__" ))
34+ >> >> >> > 5 ef092522a (feat : add segmentation keys and resolver )
2735 h .Write ([]byte (key ))
2836 return h .Sum64 ()
2937}
@@ -44,12 +52,19 @@ func GetSegmentationKey(stream KeyedStream) (SegmentationKey, error) {
4452type SegmentationPartitionResolver struct {
4553 perPartitionRateBytes uint64
4654 ringReader ring.PartitionRingReader
55+ << << << < HEAD
4756 logger log.Logger
4857
4958 // Metrics.
5059 failed prometheus.Counter
5160 randomlySharded prometheus.Counter
5261 total prometheus.Counter
62+ == == == =
63+ fallback prometheus.Counter
64+ failed prometheus.Counter
65+ total prometheus.Counter
66+ logger log.Logger
67+ >> >> >> > 5 ef092522a (feat : add segmentation keys and resolver )
5368}
5469
5570// NewSegmentationPartitionResolver returns a new SegmentationPartitionResolver.
You can’t perform that action at this time.
0 commit comments