@@ -98,7 +98,8 @@ func NewDataObjTee(
9898// A SegmentedStream is a KeyedStream with a segmentation key.
9999type SegmentedStream struct {
100100 KeyedStream
101- SegmentationKey SegmentationKey
101+ SegmentationKey SegmentationKey
102+ SegmentationKeyHash uint64
102103}
103104
104105// Duplicate implements the [Tee] interface.
@@ -112,8 +113,9 @@ func (t *DataObjTee) Duplicate(ctx context.Context, tenant string, streams []Key
112113 return
113114 }
114115 segmentationKeyStreams = append (segmentationKeyStreams , SegmentedStream {
115- KeyedStream : stream ,
116- SegmentationKey : segmentationKey ,
116+ KeyedStream : stream ,
117+ SegmentationKey : segmentationKey ,
118+ SegmentationKeyHash : segmentationKey .Sum64 (),
117119 })
118120 }
119121 rates , err := t .limitsClient .UpdateRates (ctx , tenant , segmentationKeyStreams )
@@ -127,7 +129,7 @@ func (t *DataObjTee) Duplicate(ctx context.Context, tenant string, streams []Key
127129 fastRates [rate .StreamHash ] = rate .Rate
128130 }
129131 for _ , s := range segmentationKeyStreams {
130- go t .duplicate (ctx , tenant , s , fastRates [s .SegmentationKey . Sum64 () ])
132+ go t .duplicate (ctx , tenant , s , fastRates [s .SegmentationKeyHash ])
131133 }
132134}
133135
0 commit comments