Skip to content

Commit

Permalink
Merge pull request #245 from basho/mas-i1691-ttaaefullsync
Browse files Browse the repository at this point in the history
Mas i1691 ttaaefullsync
  • Loading branch information
martinsumner authored Feb 11, 2020
2 parents 0268d58 + 3ad0e97 commit 6e53a60
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 6 deletions.
3 changes: 1 addition & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
]}.

{deps, [
{protobuffs, "0.9.*", {git, "https://github.com/basho/erlang_protobuffs.git", {tag, "0.9.1"}}},
{hamcrest, "0.4.*", {git, "https://github.com/basho/hamcrest-erlang.git", {tag, "0.4.2"}}}
{protobuffs, "0.9.*", {git, "https://github.com/basho/erlang_protobuffs.git", {tag, "0.9.1"}}}
]}.

{xref_checks, [
Expand Down
126 changes: 125 additions & 1 deletion src/riak_kv.proto
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,23 @@ message RpbRTEReq {

// RTE response - not defined, will return a RpbRTEResp on success or RpbErrorResp on failure

// Fetch request - retrieve an object by a queue name.
message RpbFetchReq{
required bytes queuename = 1;
}

// Fetch response - may be an empty queue, an object, a deleted tombstone
// If it is a deleted tombstone, it will return both an encoded_object and
// a deleted vclock. If the response is an object, just an encoded_object
// will be returned
message RpbFetchResp{
required bool queue_empty = 1;
optional bool deleted = 2; // Present only if queue_empty is false, true if object a tombstone
optional uint32 crc_check = 3; // CRC check of encoded object
optional bytes replencoded_object = 4; // Special repl encoding using for object
optional bytes deleted_vclock = 5;
}

// AAE Fold requests
message RpbAaeFoldMergeRootNValReq{
required uint32 n_val = 1;
Expand All @@ -361,7 +378,6 @@ message RpbAaeFoldMergeBranchNValReq{
message RpbAaeFoldFetchClocksNValReq{
required uint32 n_val = 1;
repeated uint32 id_filter = 2;

}

message RpbAaeFoldMergeTreesRangeReq{
Expand Down Expand Up @@ -413,6 +429,18 @@ message RpbAaeFoldFetchClocksRangeReq{
optional uint32 last_mod_end = 42;
}

message RpbAaeFoldReplKeysReq{
optional bytes type = 1;
required bytes bucket = 2;
required bool key_range = 10;
optional bytes start_key = 11;
optional bytes end_key = 12;
required bool modified_range = 40;
optional uint32 last_mod_start = 41;
optional uint32 last_mod_end = 42;
required bytes queuename = 50;
}

message RpbAaeFoldFindKeysReq{
enum FindType {
sibling_count = 0;
Expand All @@ -431,6 +459,89 @@ message RpbAaeFoldFindKeysReq{
required uint32 find_limit = 51;
}

message RpbAaeFoldFindTombsReq{
enum RpbTreeSize{
xxsmall = 0;
xsmall = 1;
small = 2;
medium = 3;
large = 4;
xlarge = 5;
}

optional bytes type = 1;
required bytes bucket = 2;
required bool key_range = 10;
optional bytes start_key = 11;
optional bytes end_key = 12;
required bool segment_filter = 30;
repeated uint32 id_filter = 31;
optional RpbTreeSize filter_tree_size = 32;
required bool modified_range = 40;
optional uint32 last_mod_start = 41;
optional uint32 last_mod_end = 42;
}

message RpbAaeFoldReapTombsReq{
enum RpbTreeSize{
xxsmall = 0;
xsmall = 1;
small = 2;
medium = 3;
large = 4;
xlarge = 5;
}
enum ChangeMethod {
job = 0;
local = 1;
count = 2;
}

optional bytes type = 1;
required bytes bucket = 2;
required bool key_range = 10;
optional bytes start_key = 11;
optional bytes end_key = 12;
required bool segment_filter = 30;
repeated uint32 id_filter = 31;
optional RpbTreeSize filter_tree_size = 32;
required bool modified_range = 40;
optional uint32 last_mod_start = 41;
optional uint32 last_mod_end = 42;
required ChangeMethod change_method = 50;
optional uint32 job_id = 51;
}

message RpbAaeFoldEraseKeysReq{
enum RpbTreeSize{
xxsmall = 0;
xsmall = 1;
small = 2;
medium = 3;
large = 4;
xlarge = 5;
}
enum ChangeMethod {
job = 0;
local = 1;
count = 2;
}

optional bytes type = 1;
required bytes bucket = 2;
required bool key_range = 10;
optional bytes start_key = 11;
optional bytes end_key = 12;
required bool segment_filter = 30;
repeated uint32 id_filter = 31;
optional RpbTreeSize filter_tree_size = 32;
required bool modified_range = 40;
optional uint32 last_mod_start = 41;
optional uint32 last_mod_end = 42;
required ChangeMethod change_method = 50;
optional uint32 job_id = 51;
}

message RpbAaeFoldObjectStatsReq{
optional bytes type = 1;
required bytes bucket = 2;
Expand All @@ -442,6 +553,19 @@ message RpbAaeFoldObjectStatsReq{
optional uint32 last_mod_end = 42;
}

message RpbAaeFoldListBucketsReq{
optional uint32 n_val = 1;
}

message RpbAaeFoldListBucketsResp{
repeated RpbAaeFoldBucket bucket_list = 1;
}

message RpbAaeFoldBucket{
optional bytes type = 1;
required bytes bucket = 2;
}

message RpbKeysValue {
optional bytes type = 1;
required bytes bucket = 2;
Expand Down
6 changes: 3 additions & 3 deletions src/riak_pb_dt_codec.erl
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,12 @@ encode_set_update({remove_all, Members}, #setop{removes=R}=S) when is_list(Membe


%% @doc Decodes a GSetOp message into a gset operation.
-spec decode_gset_op(#setop{}) -> gset_op().
-spec decode_gset_op(#gsetop{}) -> gset_op().
decode_gset_op(#gsetop{adds=A}) ->
{add_all, A}.

%% @doc Encodes a set operation into a SetOp message.
-spec encode_gset_op(gset_op()) -> #gsetop{}.
%% @doc Encodes a gset operation into a SetOp message.
-spec encode_gset_op(gset_op()|{update, [simple_gset_op()]}) -> #gsetop{}.
encode_gset_op({update, Ops}) when is_list(Ops) ->
lists:foldr(fun encode_gset_update/2, #gsetop{}, Ops);
encode_gset_op({C, _}=Op) when add == C; add_all == C ->
Expand Down
8 changes: 8 additions & 0 deletions src/riak_pb_messages.csv
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,24 @@
104,TsTtbMsg,riak_ts
200,RpbRTEReq,riak_kv
201,RpbRTEResp,riak_kv
202,RpbFetchReq,riak_kv
203,RpbFetchResp,riak_kv
210,RpbAaeFoldMergeRootNValReq,riak_kv
211,RpbAaeFoldMergeBranchNValReq,riak_kv
212,RpbAaeFoldFetchClocksNValReq,riak_kv
213,RpbAaeFoldMergeTreesRangeReq,riak_kv
214,RpbAaeFoldFetchClocksRangeReq,riak_kv
215,RpbAaeFoldFindKeysReq,riak_kv
216,RpbAaeFoldObjectStatsReq,riak_kv
217,RpbAaeFoldReplKeysReq,riak_kv
218,RpbAaeFoldFindTombsReq,riak_kv
220,RpbAaeFoldTreeResp,riak_kv
221,RpbAaeFoldKeyValueResp,riak_kv
222,RpbAaeFoldKeyCountResp,riak_kv
223,RpbAaeFoldListBucketsReq,riak_kv
224,RpbAaeFoldListBucketsResp,riak_kv
230,RpbAaeFoldReapTombsReq,riak_kv
231,RpbAaeFoldEraseKeysReq,riak_kv
253,RpbAuthReq,riak
254,RpbAuthResp,riak
255,RpbStartTls,riak

0 comments on commit 6e53a60

Please sign in to comment.