-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,8 +94,9 @@ message ResponseHeader { | |
optional string error = 1; | ||
optional uint64 cluster_id = 2; | ||
optional uint64 member_id = 3; | ||
// index of the store when the requested was processed. | ||
// index of the store when the request was applied. | ||
optional int64 index = 4; | ||
// term of raft when the request was applied. | ||
optional uint64 raft_term = 5; | ||
} | ||
|
@@ -105,12 +106,22 @@ message RangeRequest { | |
// if the end_key is given, it gets the keys in range [key, end_key). | ||
optional bytes end_key = 2; | ||
// limit the number of keys returned. | ||
// if not all the keys are returned, a continue id will be | ||
// returned in the range response. | ||
optional int64 limit = 3; | ||
// continue the previous range request in a consistent | ||
// manner if a continue id is provided. | ||
optional int64 continue_id = 4; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
smarterclayton
Contributor
|
||
} | ||
message RangeResponse { | ||
optional ResponseHeader header = 1; | ||
repeated KeyValue kvs = 2; | ||
optional continue_id = 3; | ||
// the next range request with continue_id must | ||
// be issued with in continue_timeout to the | ||
// same server. | ||
optional continue_timeout = 4; | ||
} | ||
message PutRequest { | ||
|
@@ -239,6 +250,9 @@ message Action { | |
expire = 2; | ||
} | ||
optional ActionType event_type = 1; | ||
// a put action contains the put key-value | ||
// a delete/expire action contains the previous | ||
// key-value | ||
optional KeyValue kv = 2; | ||
} | ||
|
@smarterclayton After think this for quite a while, I think this is probably the best approach to solve the consistent range query problem. I do not want to complicate the API, but more importantly I do not want make it error-prone to users. My previous proposal is too tricky.
Let me know what do you think.