Skip to content

Fix for [JIRA: CLIENTS-654]#566

Merged
alexmoore merged 2 commits intobasho:developfrom
empovit:CLIENTS-654
Nov 4, 2015
Merged

Fix for [JIRA: CLIENTS-654]#566
alexmoore merged 2 commits intobasho:developfrom
empovit:CLIENTS-654

Conversation

@empovit
Copy link
Contributor

@empovit empovit commented Nov 3, 2015

ListBuckets ignored the bucket type member when building a request, which made it work with the default bucket type only. Passing bucket type if not null to enable listing non-empty buckets of types other than 'default'.

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please match the brace style in this file? Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Should have done it, sorry

Copy link
Contributor

Choose a reason for hiding this comment

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

It's no problem, I'm just being pedantic. Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lukebakken
You're absolutely right, I have to stick to the style in use.

@lukebakken
Copy link
Contributor

Thank you for this pull request 😄

There should also be a unit test confirming this fix here (I think):

https://github.com/basho/riak-java-client/tree/develop/src/test/java/com/basho/riak/client/api/commands

@alexmoore - is that the right place?

@empovit
Copy link
Contributor Author

empovit commented Nov 3, 2015

@lukebakken
Ok, I see a unit test for ListBuckets now. Will try to fix it because apparently it didn't catch the bug.

@lukebakken
Copy link
Contributor

Great!

@alexmoore
Copy link
Contributor

Yep, that would be the folder to put a unit test in.

@empovit
Copy link
Contributor Author

empovit commented Nov 3, 2015

Fixed, added unit tests. Please review.

BTW, I think that copying the bucket type from the command context into response is wrong, and it should be returned from the backend. See com.basho.riak.client.api.commands.buckets.ListBuckets#executeAsync. As a side note, it posed a challenge when writing the unit tests, because validating an expected bucket type against a response does not make sense as the type is always the one from request.

@alexmoore
Copy link
Contributor

Yeah, our messages only return the bucket names: https://github.com/basho/riak_pb/blob/develop/src/riak_kv.proto#L127-L130

I think the original authors did this to save message space, otherwise we'd send a lot of duplicate info back with every bucket. This applies to the RpbListKeysResp message as well. :/

@alexmoore
Copy link
Contributor

Looks good, thanks for the PR!

alexmoore added a commit that referenced this pull request Nov 4, 2015
Fix for [JIRA: CLIENTS-654]
@alexmoore alexmoore merged commit d1da92a into basho:develop Nov 4, 2015
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.

3 participants