Skip to content

Commit cd49144

Browse files
committed
addtl linting
Signed-off-by: Owen Diehl <[email protected]>
1 parent 4625589 commit cd49144

File tree

6 files changed

+9
-28
lines changed

6 files changed

+9
-28
lines changed

pkg/bloomcompactor/spec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (s *SimpleBloomGenerator) populator(ctx context.Context) v1.BloomPopulatorF
115115
Chunks: toAdd,
116116
})
117117

118-
s.tokenizer.Populate(series, srcBlooms, chunkItersWithFP.itr, ch)
118+
s.tokenizer.Populate(srcBlooms, chunkItersWithFP.itr, ch)
119119

120120
if s.reporter != nil {
121121
s.reporter(series.Fingerprint)

pkg/storage/bloom/v1/bloom_tokenizer.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import (
55

66
"github.com/go-kit/log/level"
77

8-
"github.com/grafana/loki/pkg/push"
98
"github.com/grafana/loki/v3/pkg/iter"
109
"github.com/grafana/loki/v3/pkg/logproto"
1110
"github.com/grafana/loki/v3/pkg/storage/bloom/v1/filter"
1211

12+
"github.com/grafana/loki/pkg/push"
13+
1314
"github.com/grafana/loki/v3/pkg/util/encoding"
1415
util_log "github.com/grafana/loki/v3/pkg/util/log"
1516
)
@@ -97,7 +98,6 @@ func (bt *BloomTokenizer) newBloom() *Bloom {
9798
}
9899

99100
func (bt *BloomTokenizer) Populate(
100-
series *Series,
101101
blooms SizedIterator[*Bloom],
102102
chks Iterator[ChunkRefWithIter],
103103
ch chan *BloomCreation,
@@ -163,8 +163,6 @@ func (bt *BloomTokenizer) Populate(
163163
SourceBytesAdded: bytesAdded,
164164
}
165165
close(ch)
166-
return
167-
168166
}
169167

170168
// addChunkToBloom adds the tokens from the given chunk to the given bloom.

pkg/storage/bloom/v1/bloom_tokenizer_test.go

+2-20
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,9 @@ func TestTokenizerPopulate(t *testing.T) {
121121
bloom := Bloom{
122122
ScalableBloomFilter: *sbf,
123123
}
124-
series := Series{
125-
Fingerprint: model.Fingerprint(lbsList[0].Hash()),
126-
}
127124

128125
blooms, err := populateAndConsumeBloom(
129126
bt,
130-
series,
131127
NewSliceIter([]*Bloom{&bloom}),
132128
NewSliceIter([]ChunkRefWithIter{{Ref: ChunkRef{},
133129
Itr: itr}}),
@@ -164,13 +160,8 @@ func TestBloomTokenizerPopulateWithoutPreexistingBloom(t *testing.T) {
164160
)
165161
require.Nil(t, err)
166162

167-
series := Series{
168-
Fingerprint: model.Fingerprint(lbsList[0].Hash()),
169-
}
170-
171163
blooms, err := populateAndConsumeBloom(
172164
bt,
173-
series,
174165
NewEmptyIter[*Bloom](),
175166
NewSliceIter([]ChunkRefWithIter{{Ref: ChunkRef{},
176167
Itr: itr}}),
@@ -227,11 +218,6 @@ func TestTokenizerPopulateWontExceedMaxSize(t *testing.T) {
227218
itr, err := chunkRefItrFromLines(line)
228219
require.NoError(t, err)
229220
go bt.Populate(
230-
&Series{
231-
Chunks: ChunkRefs{
232-
{},
233-
},
234-
},
235221
NewSliceIter([]*Bloom{
236222
{
237223
*filter.NewScalableBloomFilter(1024, 0.01, 0.8),
@@ -258,13 +244,12 @@ func TestTokenizerPopulateWontExceedMaxSize(t *testing.T) {
258244

259245
func populateAndConsumeBloom(
260246
bt *BloomTokenizer,
261-
s Series,
262247
blooms SizedIterator[*Bloom],
263248
chks Iterator[ChunkRefWithIter],
264249
) (res []*Bloom, err error) {
265250
var e multierror.MultiError
266251
ch := make(chan *BloomCreation)
267-
go bt.Populate(&s, blooms, chks, ch)
252+
go bt.Populate(blooms, chks, ch)
268253
for x := range ch {
269254
if x.Err != nil {
270255
e = append(e, x.Err)
@@ -301,12 +286,9 @@ func BenchmarkPopulateSeriesWithBloom(b *testing.B) {
301286
bloom := Bloom{
302287
ScalableBloomFilter: *sbf,
303288
}
304-
series := Series{
305-
Fingerprint: model.Fingerprint(lbsList[0].Hash()),
306-
}
289+
307290
_, err = populateAndConsumeBloom(
308291
bt,
309-
series,
310292
NewSliceIter([]*Bloom{&bloom}),
311293
NewSliceIter([]ChunkRefWithIter{{Ref: ChunkRef{},
312294
Itr: itr}}),

pkg/storage/bloom/v1/index.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func (s *SeriesWithOffsets) Decode(
421421
var (
422422
err error
423423
lastEnd model.Time
424-
lastOffset BloomOffset = previousOffset
424+
lastOffset = previousOffset
425425
)
426426
for i := range s.Offsets {
427427
err = s.Offsets[i].Decode(dec, lastOffset)

pkg/storage/bloom/v1/util.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const (
1616
magicNumber = uint32(0xCA7CAFE5)
1717
// Add new versions below
1818
V1 Version = iota
19-
// V2 supports single series blooms encoded over multipe pages
20-
// to accomodate larger single series
19+
// V2 supports single series blooms encoded over multiple pages
20+
// to accommodate larger single series
2121
V2
2222
)
2323

pkg/storage/bloom/v1/versioned_builder.go

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ type SeriesWithBloom struct {
129129
Bloom *Bloom
130130
}
131131

132+
//nolint:revive
132133
type V1Builder struct {
133134
opts BlockOptions
134135

0 commit comments

Comments
 (0)