-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
9c79cd2
to
50e6804
Compare
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 👍
df5e846
to
2c291ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a last thing: Can you test manually? e.g |
Signed-off-by: khyatisoneji <[email protected]>
2c291ee
to
fd895dd
Compare
Thank you! Good job 🥇 |
Issue link: #1941
Changes
use
block.metaFetcher
inbucket
command