Skip to content

Commit

Permalink
doc/rfc: separate consistent request from range request
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang90 committed Apr 21, 2015
1 parent 9cb3376 commit 59573f7
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions Documentation/rfc/v3api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ syntax = "proto3";
// Interface exported by the server.
service etcd {
// Range gets the keys in the range from the store.
// Maybe rename it to GET?
rpc Range(RangeRequest) returns (RangeResponse) {}

// ConsistentRange gets the keys in the range from the store consistently across
// multiple requests. Only etcd leader can serve ConsistentRangeRequest.
rpc ConsistentRange(ConsistentRangeRequest) returns (ConsistentRangeResponse) {}

// Put puts the given key into the store.
// A put request increases the index of the store,
// and generates one event in the event history.
Expand Down Expand Up @@ -75,24 +78,28 @@ message RangeRequest {
optional bytes range_end = 2;
// limit the number of keys returned.
optional int64 limit = 3;
// if not all the keys are returned, a continue id will be
// returned in the range response if consistent is set.
// the returned continue id only works with the previous
// etcdserver the client connected to.
optional bool consistent = 4
// continue the previous range request in a consistent
// manner if a continue id is provided.
optional int64 continue_id = 5;
}

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 ConsistentRangeRequest {
optional RangeRequest request = 1;
// the result is consistent with previous request with same token if the token is
// given and is vaild.
// if the token is not given, a consistent token will be returned in the response
// for future use.
optional int64 consistent_token = 2;
}

message ConsistentRangeResponse {
optional RangeResponse response = 1;
optional consistent_token = 2;
// the next range request with consistent_token must
// be issued with in timeout
optional int64 timeout = 3;
}

message PutRequest {
Expand Down

0 comments on commit 59573f7

Please sign in to comment.