Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
add check_and_mutate() (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
HuangWei authored and qinzuoyan committed Aug 17, 2018
1 parent 5822933 commit 7927b4b
Show file tree
Hide file tree
Showing 40 changed files with 6,186 additions and 111 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ target/
.idea
pegasus-client.iml
log.txt
rolling_log/
rolling_log/
.vscode/

37 changes: 37 additions & 0 deletions idl/rrdb.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ enum cas_check_type
CT_VALUE_INT_GREATER // int compare: value > operand
}

enum mutate_operation
{
MO_PUT,
MO_DELETE
}

struct update_request
{
1:base.blob key;
Expand Down Expand Up @@ -182,6 +188,36 @@ struct check_and_set_response
8:string server;
}

struct mutate
{
1:mutate_operation operation;
2:base.blob sort_key;
3:base.blob value;
4:i32 set_expire_ts_seconds;
}

struct check_and_mutate_request
{
1:base.blob hash_key;
2:base.blob check_sort_key;
3:cas_check_type check_type;
4:base.blob check_operand;
5:list<mutate> mutate_list;
6:bool return_check_value;
}

struct check_and_mutate_response
{
1:i32 error; // for errors such as kInvalidArgument etc.
2:bool check_value_returned;
3:bool check_value_exist; // used only if check_value_returned is true
4:base.blob check_value; // used only if check_value_returned and check_value_exist is true
5:i32 app_id;
6:i32 partition_index;
7:i64 decree;
8:string server;
}

struct get_scanner_request
{
1:base.blob start_key;
Expand Down Expand Up @@ -219,6 +255,7 @@ service rrdb
multi_remove_response multi_remove(1:multi_remove_request request);
incr_response incr(1:incr_request request);
check_and_set_response check_and_set(1:check_and_set_request request);
check_and_mutate_response check_and_mutate(1:check_and_mutate_request request);
read_response get(1:base.blob key);
multi_get_response multi_get(1:multi_get_request request);
count_response sortkey_count(1:base.blob hash_key);
Expand Down
Loading

0 comments on commit 7927b4b

Please sign in to comment.