From 95c82ca174fd912ebe6b8bf2058999ab5b2da943 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Thu, 8 Aug 2013 13:56:50 -0400 Subject: [PATCH 1/5] WIP bucket types --- src/riak_kv.proto | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/riak_kv.proto b/src/riak_kv.proto index 0a2ca5ea..dffb09ab 100644 --- a/src/riak_kv.proto +++ b/src/riak_kv.proto @@ -56,6 +56,7 @@ message RpbGetReq { optional uint32 timeout = 10; optional bool sloppy_quorum = 11; // Experimental, may change/disappear optional uint32 n_val = 12; // Experimental, may change/disappear + optional bytes type = 13; // Bucket type, if not set we assume the 'default' type } // Get Response - if the record was not found there will be no content/vclock @@ -84,6 +85,7 @@ message RpbPutReq { optional bool asis = 13; optional bool sloppy_quorum = 14; // Experimental, may change/disappear optional uint32 n_val = 15; // Experimental, may change/disappear + optional bytes type = 16; // Bucket type, if not set we assume the 'default' type } // Put response - same as get response with optional key if one was generated @@ -108,6 +110,7 @@ message RpbDelReq { optional uint32 timeout = 10; optional bool sloppy_quorum = 11; // Experimental, may change/disappear optional uint32 n_val = 12; // Experimental, may change/disappear + optional bytes type = 13; // Bucket type, if not set we assume the 'default' type } // Delete response - not defined, will return a RpbDelResp on success or RpbErrorResp on failure @@ -116,6 +119,7 @@ message RpbDelReq { message RpbListBucketsReq { optional uint32 timeout = 1; optional bool stream = 2; + optional bytes type = 3; // Bucket type, if not set we assume the 'default' type } // List buckets response - one or more of these packets will be sent @@ -130,6 +134,7 @@ message RpbListBucketsResp { message RpbListKeysReq { required bytes bucket = 1; optional uint32 timeout = 2; + optional bytes type = 3; // Bucket type, if not set we assume the 'default' type } // List keys in bucket response - one or more of these packets will be sent @@ -173,6 +178,7 @@ message RpbIndexReq { optional uint32 max_results = 9; optional bytes continuation = 10; optional uint32 timeout = 11; + optional bytes type = 12; // Bucket type, if not set we assume the 'default' type } // Secondary Index query response @@ -195,6 +201,7 @@ message RpbCSBucketReq { optional bytes continuation = 6; optional uint32 max_results = 7; optional uint32 timeout = 8; + optional bytes type = 9; // Bucket type, if not set we assume the 'default' type } // return for CS bucket fold @@ -241,6 +248,7 @@ message RpbCounterUpdateReq { optional uint32 dw = 5; optional uint32 pw = 6; optional bool returnvalue = 7; + optional bytes type = 8; // Bucket type, if not set we assume the 'default' type } // Counter update response? No message | error response @@ -256,6 +264,7 @@ message RpbCounterGetReq { optional uint32 pr = 4; optional bool basic_quorum = 5; optional bool notfound_ok = 6; + optional bytes type = 7; // Bucket type, if not set we assume the 'default' type } // Counter value response From 82c47f4fe0a2d7ad934d959b29ee63ca266eff9c Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Mon, 19 Aug 2013 15:05:46 -0400 Subject: [PATCH 2/5] More WIP buckrt types --- src/riak.proto | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/riak.proto b/src/riak.proto index df7563e5..1e8e2864 100644 --- a/src/riak.proto +++ b/src/riak.proto @@ -52,6 +52,7 @@ message RpbPair { // Get bucket properties request message RpbGetBucketReq { required bytes bucket = 1; + optional bytes type = 2; } // Get bucket properties response @@ -63,6 +64,7 @@ message RpbGetBucketResp { message RpbSetBucketReq { required bytes bucket = 1; required RpbBucketProps props = 2; + optional bytes type = 3; } // Set bucket properties response - no message defined, just send @@ -71,8 +73,29 @@ message RpbSetBucketReq { // Reset bucket properties request message RpbResetBucketReq { required bytes bucket = 1; + optional bytes type = 2; } +// Get bucket properties request +message RpbGetBucketTypeReq { + required bytes type = 1; +} + +// Set bucket properties request +message RpbSetBucketTypeReq { + required bytes type = 1; + required RpbBucketProps props = 2; +} + +// Set bucket properties response - no message defined, just send +// RpbSetBucketResp + +// Reset bucket properties request +message RpbResetBucketTypeReq { + required bytes type = 1; +} + + // Reset bucket properties response - no message defined, just send // RpbResetBucketResp From fbc4e1fd72fa94864909d3c4c9e9c4e0f0de6367 Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Mon, 19 Aug 2013 17:04:24 -0400 Subject: [PATCH 3/5] Messages for bucket type properties --- src/riak_pb_codec.erl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/riak_pb_codec.erl b/src/riak_pb_codec.erl index 26cae8f6..66041087 100644 --- a/src/riak_pb_codec.erl +++ b/src/riak_pb_codec.erl @@ -119,6 +119,9 @@ msg_type(27) -> rpbsearchqueryreq; msg_type(28) -> rpbsearchqueryresp; msg_type(29) -> rpbresetbucketreq; msg_type(30) -> rpbresetbucketresp; +msg_type(31) -> rpbgetbuckettypereq; +msg_type(32) -> rpbsetbuckettypereq; +msg_type(33) -> rpbresetbuckettypereq; msg_type(40) -> rpbcsbucketreq; msg_type(41) -> rpbcsbucketresp; msg_type(50) -> rpbcounterupdatereq; @@ -161,6 +164,9 @@ msg_code(rpbsearchqueryreq) -> 27; msg_code(rpbsearchqueryresp) -> 28; msg_code(rpbresetbucketreq) -> 29; msg_code(rpbresetbucketresp) -> 30; +msg_code(rpbsetbuckettypereq) -> 31; +msg_code(rpbresetbuckettypereq) -> 32; +msg_code(rpbgetbuckettypereq) -> 33; msg_code(rpbcsbucketreq) -> 40; msg_code(rpbcsbucketresp) -> 41; msg_code(rpbcounterupdatereq) -> 50; @@ -172,7 +178,10 @@ msg_code(rpbcountergetresp) -> 53. -spec decoder_for(pos_integer()) -> module(). decoder_for(N) when N >= 0, N < 3; N == 7; N == 8; - N == 29; N == 30 -> + (N >= 19 andalso N =< 22); + N == 29; N == 30, + N == 30; N == 31; + N == 32 -> riak_pb; decoder_for(N) when N >= 3, N < 7; N >= 9, N =< 26; From d5b8dd5ed0083da4cf6e55951e76d7636c37a06a Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Mon, 19 Aug 2013 18:43:25 -0400 Subject: [PATCH 4/5] Tweak --- src/riak_pb_codec.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/riak_pb_codec.erl b/src/riak_pb_codec.erl index 66041087..ace4fb76 100644 --- a/src/riak_pb_codec.erl +++ b/src/riak_pb_codec.erl @@ -164,9 +164,9 @@ msg_code(rpbsearchqueryreq) -> 27; msg_code(rpbsearchqueryresp) -> 28; msg_code(rpbresetbucketreq) -> 29; msg_code(rpbresetbucketresp) -> 30; -msg_code(rpbsetbuckettypereq) -> 31; -msg_code(rpbresetbuckettypereq) -> 32; -msg_code(rpbgetbuckettypereq) -> 33; +msg_code(rpbgetbuckettypereq) -> 31; +msg_code(rpbsetbuckettypereq) -> 32; +msg_code(rpbresetbuckettypereq) -> 33; msg_code(rpbcsbucketreq) -> 40; msg_code(rpbcsbucketresp) -> 41; msg_code(rpbcounterupdatereq) -> 50; @@ -180,8 +180,8 @@ decoder_for(N) when N >= 0, N < 3; N == 7; N == 8; (N >= 19 andalso N =< 22); N == 29; N == 30, - N == 30; N == 31; - N == 32 -> + N == 31; N == 32; + N == 33 -> riak_pb; decoder_for(N) when N >= 3, N < 7; N >= 9, N =< 26; From a9a73b467554a5c3f643ce2fb395da09b4b506cb Mon Sep 17 00:00:00 2001 From: Andrew Thompson Date: Mon, 19 Aug 2013 18:56:18 -0400 Subject: [PATCH 5/5] Typo --- src/riak_pb_codec.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/riak_pb_codec.erl b/src/riak_pb_codec.erl index ace4fb76..62b95ac2 100644 --- a/src/riak_pb_codec.erl +++ b/src/riak_pb_codec.erl @@ -179,7 +179,7 @@ msg_code(rpbcountergetresp) -> 53. decoder_for(N) when N >= 0, N < 3; N == 7; N == 8; (N >= 19 andalso N =< 22); - N == 29; N == 30, + N == 29; N == 30; N == 31; N == 32; N == 33 -> riak_pb;