Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Move setting bucket properties to riak_api, see basho/riak_api#31 bas…
  • Loading branch information
Sean Cribbs committed Feb 15, 2013
commit b1ad1790fa4a75536b3f78cef00c5878416aba9d
2 changes: 1 addition & 1 deletion src/riak_kv_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

-define(SERVICES, [{riak_kv_pb_object, 3, 6}, %% ClientID stuff
{riak_kv_pb_object, 9, 14}, %% Object requests
{riak_kv_pb_bucket, 15, 22}, %% Bucket requests
{riak_kv_pb_bucket, 15, 18}, %% Bucket requests
{riak_kv_pb_mapred, 23, 24}, %% MapReduce requests
{riak_kv_pb_index, 25, 26} %% Secondary index requests
]).
Expand Down
24 changes: 1 addition & 23 deletions src/riak_kv_pb_bucket.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,13 @@
%% <pre>
%% 15 - RpbListBucketsReq
%% 17 - RpbListKeysReq
%% 19 - RpbGetBucketReq
%% 21 - RpbSetBucketReq
%% </pre>
%%
%% <p>This service produces the following responses:</p>
%%
%% <pre>
%% 16 - RpbListBucketsResp
%% 18 - RpbListKeysResp{1,}
%% 20 - RpbGetBucketResp
%% 22 - RpbSetBucketResp
%% </pre>
%%
%% <p>The semantics are unchanged from their original
Expand Down Expand Up @@ -88,25 +84,7 @@ process(rpblistbucketsreq,
process(#rpblistkeysreq{bucket=B}=Req, #state{client=C} = State) ->
%% stream_list_keys results will be processed by process_stream/3
{ok, ReqId} = C:stream_list_keys(B),
{reply, {stream, ReqId}, State#state{req = Req, req_ctx = ReqId}};

%% Get bucket properties
process(#rpbgetbucketreq{bucket=B},
#state{client=C} = State) ->
Props = C:get_bucket(B),
PbProps = riak_pb_kv_codec:encode_bucket_props(Props),
{reply, #rpbgetbucketresp{props = PbProps}, State};

%% Set bucket properties
process(#rpbsetbucketreq{bucket=B, props = PbProps},
#state{client=C} = State) ->
Props = riak_pb_kv_codec:decode_bucket_props(PbProps),
case C:set_bucket(B, Props) of
ok ->
{reply, rpbsetbucketresp, State};
{error, Details} ->
{error, {format, "Invalid bucket properties: ~p", [Details]}, State}
end.
{reply, {stream, ReqId}, State#state{req = Req, req_ctx = ReqId}}.

%% @doc process_stream/3 callback. Handles streaming keys messages.
process_stream({ReqId, done}, ReqId,
Expand Down