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

add get_preflist to http-client #50

Merged
merged 2 commits into from
Feb 27, 2015
Merged

Conversation

zeeshanlakhani
Copy link
Contributor

Description

Part of RIAK-1481.

The active preflist will return primary/fallback partitions and nodes for the available nodes at the time of query. Primary/fallback will be annotated.
This involves updates to our RiakKV WB code, RiakPB, Riak-Erlang-Http-Client, Riak-Erlang-Client.

*The impetus for adding this to the API started with a mailing list question answered by Charlie Voiselle, http://lists.basho.com/pipermail/riak-users_lists.basho.com/2015-January/016527.html, which involved a snippet of code that we've given clients multiple times. This was then discussed with Russell Brown on HipChat, https://basho.hipchat.com/history/room/867200/2015/01/13?q=enterprising&t=rid-867200#12:23:22.

Other PRs in the series:

@seancribbs
Copy link
Contributor

I have similar comments on the PB client. I'm most concerned about the lists-of-lists thing. Maybe it's not a significant detail.

@zeeshanlakhani zeeshanlakhani force-pushed the feature/zl/add-get-preflist branch 2 times, most recently from 4d8430c to 88a46f2 Compare February 26, 2015 20:18
%% @doc Convert a preflist resource response to a proplist.
erlify_preflist(Response) ->
Preflist = [V || {_, V} <- proplists:get_value(<<"preflist">>, Response)],
lists:foldl(
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be simplified to a list comprehension.

[ lists:foldl(fun({K, V}, AccRec) -> erlify_preflist(K, V, AccRec) end, #preflist_item{}, P) || P <- Preflist ]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

def.

@zeeshanlakhani
Copy link
Contributor Author

@seancribbs I plan to also update rebar.config to use the newest webmachine/ibrowse versions... and once basho/riak-erlang-client#204 is in, I guess we should tag a release there, yeah?

@seancribbs
Copy link
Contributor

👍 (merge manually)

@zeeshanlakhani
Copy link
Contributor Author

@seancribbs will do.

zeeshanlakhani added a commit that referenced this pull request Feb 27, 2015
@zeeshanlakhani zeeshanlakhani merged commit 2f04551 into master Feb 27, 2015
@zeeshanlakhani zeeshanlakhani deleted the feature/zl/add-get-preflist branch February 27, 2015 20:47
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.

2 participants