Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Jun 6, 2023
1 parent 1d3ef3c commit e036a85
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 0 additions & 2 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -2545,8 +2545,6 @@ func (r *bucketIndexReader) fetchPostings(ctx context.Context, keys []labels.Lab
return err
}

dataToCache := pBytes

// Reencode postings before storing to cache. If that fails, we store original bytes.
// This can only fail, if postings data was somehow corrupted,
// and there is nothing we can do about it.
Expand Down
1 change: 0 additions & 1 deletion pkg/store/bucket_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ func (c *swappableCache) StoreExpandedPostings(blockID ulid.ULID, matchers []*la
c.ptr.StoreExpandedPostings(blockID, matchers, v)
}

// FetchExpandedPostings fetches expanded postings.
func (c *swappableCache) FetchExpandedPostings(ctx context.Context, blockID ulid.ULID, matchers []*labels.Matcher) ([]byte, bool) {
return c.ptr.FetchExpandedPostings(ctx, blockID, matchers)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/store/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type IndexCache interface {
// StoreExpandedPostings stores expanded postings for a set of label matchers.
StoreExpandedPostings(blockID ulid.ULID, matchers []*labels.Matcher, v []byte)

// FetchExpandedPostings fetches expanded postings.
// FetchExpandedPostings fetches expanded postings and returns cached data and a boolean value representing whether it is a cache hit or not.
FetchExpandedPostings(ctx context.Context, blockID ulid.ULID, matchers []*labels.Matcher) ([]byte, bool)

// StoreSeries stores a single series.
Expand Down
2 changes: 1 addition & 1 deletion pkg/store/cache/inmemory.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func (c *InMemoryIndexCache) StoreExpandedPostings(blockID ulid.ULID, matchers [
c.set(cacheTypeExpandedPostings, cacheKey{block: blockID.String(), key: cacheKeyExpandedPostings(labelMatchersToString(matchers))}, v)
}

// FetchExpandedPostings fetches expanded postings.
// FetchExpandedPostings fetches expanded postings and returns cached data and a boolean value representing whether it is a cache hit or not.
func (c *InMemoryIndexCache) FetchExpandedPostings(_ context.Context, blockID ulid.ULID, matchers []*labels.Matcher) ([]byte, bool) {
if b, ok := c.get(cacheTypeExpandedPostings, cacheKey{blockID.String(), cacheKeyExpandedPostings(labelMatchersToString(matchers))}); ok {
return b, true
Expand Down

0 comments on commit e036a85

Please sign in to comment.