feat: add BatchGet method in Store service (#7)

* feat: add BatchGet method in Store service

* generated go code
This commit is contained in:
fys
2023-02-20 17:24:19 +08:00
committed by GitHub
parent 36147379c3
commit 38dde5ca2a
5 changed files with 426 additions and 396 deletions
-12
View File
@@ -15,15 +15,3 @@ service Cluster {
// Range get the kvs from leader's in_memory kv store.
rpc Range(RangeRequest) returns (RangeResponse);
}
message BatchGetRequest {
RequestHeader header = 1;
repeated bytes keys = 2;
}
message BatchGetResponse {
ResponseHeader header = 1;
repeated KeyValue kvs = 2;
}
+15
View File
@@ -13,6 +13,9 @@ service Store {
// Put puts the given key into the key-value store.
rpc Put(PutRequest) returns (PutResponse);
// BatchGet atomically get values by the given keys from the key-value store.
rpc BatchGet(BatchGetRequest) returns (BatchGetResponse);
// BatchPut atomically puts the given keys into the key-value store.
rpc BatchPut(BatchPutRequest) returns (BatchPutResponse);
@@ -77,6 +80,18 @@ message PutResponse {
KeyValue prev_kv = 2;
}
message BatchGetRequest {
RequestHeader header = 1;
repeated bytes keys = 2;
}
message BatchGetResponse {
ResponseHeader header = 1;
repeated KeyValue kvs = 2;
}
message BatchPutRequest {
RequestHeader header = 1;