Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bucket: use block.MetaFetcher to fetch blocks #1988

Merged
merged 1 commit into from
Jan 12, 2020

Conversation

khyatisoneji
Copy link
Contributor

Issue link: #1941

Changes

use block.metaFetcher in bucket command

@khyatisoneji khyatisoneji force-pushed the 1941-metaFetcher branch 2 times, most recently from 9c79cd2 to 50e6804 Compare January 11, 2020 13:12
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, good work 👍 Generally ok, only style issues. I am suprised that there is not much to improve given your first contribution to Thanos 👍

Thanks, commented.

Also there is a CI error. You can click on red link to show the actual error at the bottom (: (tip: do make format)

@@ -406,25 +412,17 @@ func refresh(ctx context.Context, logger log.Logger, bucketUI *ui.Bucket, durati
})
}

func download(ctx context.Context, logger log.Logger, bkt objstore.Bucket) (blocks []metadata.Meta, err error) {
func download(ctx context.Context, logger log.Logger, bkt objstore.Bucket, fetcher *block.MetaFetcher) (blocks []metadata.Meta, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can return map here and operate on map on download caller to avoid unnecessary allocations/operations. The reason is rather readability not performance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the caller function is marshaling the returned array, is it ok if we return map instead of array now?
Will there be any change in the caller because of this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case probably no (: ignore my comment, you are right 👍

@khyatisoneji khyatisoneji force-pushed the 1941-metaFetcher branch 2 times, most recently from df5e846 to 2c291ee Compare January 11, 2020 15:10
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One super small nit and LGTM 👍

Thanks. 🎉 🎉 That was smooth!

@bwplotka
Copy link
Member

bwplotka commented Jan 11, 2020

As a last thing: Can you test manually? e.g thanos bucket web on some prepared bucket?

@khyatisoneji
Copy link
Contributor Author

Screenshot 2020-01-12 at 9 02 57 AM

The web component gives this output

@bwplotka bwplotka merged commit 4fc908e into thanos-io:master Jan 12, 2020
@bwplotka
Copy link
Member

Thank you! Good job 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants