Set verion in mvcc apis

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
Yilin Chen 2019-08-15 11:55:53 +08:00
parent 236c510551
commit bcf73cdf34
No known key found for this signature in database
GPG Key ID: 353E7ED34BF326E0
1 changed files with 4 additions and 1 deletions

View File

@ -32,6 +32,7 @@ impl KvRequest for MvccGet {
) -> Self::RpcRequest {
let mut req = store.request::<Self::RpcRequest>();
req.set_key(key.into());
req.set_version(self.version);
req
}
@ -50,7 +51,7 @@ impl KvRequest for MvccGet {
fn map_result(mut resp: Self::RpcResponse) -> Self::Result {
let result: Value = resp.take_value().into();
if result.is_empty() {
if resp.not_found {
None
} else {
Some(result)
@ -89,6 +90,7 @@ impl KvRequest for MvccBatchGet {
) -> Self::RpcRequest {
let mut req = store.request::<Self::RpcRequest>();
req.set_keys(keys.into_iter().map(Into::into).collect());
req.set_version(self.version);
req
}
@ -152,6 +154,7 @@ impl KvRequest for MvccScan {
req.set_end_key(end_key.into());
req.set_limit(self.limit);
req.set_key_only(self.key_only);
req.set_version(self.version);
req
}