|
1 | 1 | // Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
|
2 | 2 |
|
3 | 3 | #![feature(async_await, await_macro)]
|
| 4 | +#![type_length_limit = "3081103"] |
4 | 5 |
|
5 | 6 | mod common;
|
6 | 7 |
|
@@ -62,23 +63,22 @@ async fn main() -> Result<()> {
|
62 | 63 | .expect("Could not get just deleted entry");
|
63 | 64 | assert!(value.is_none());
|
64 | 65 |
|
65 |
| - // FIXME: batch commands seem to be broken due to over-large types. |
66 | 66 | // You can ask to write multiple key-values at the same time, it is much more
|
67 | 67 | // performant because it is passed in one request to the key-value store.
|
68 |
| - // let pairs = vec![ |
69 |
| - // KvPair::from(("k1", "v1")), |
70 |
| - // KvPair::from(("k2", "v2")), |
71 |
| - // KvPair::from(("k3", "v3")), |
72 |
| - // ]; |
73 |
| - // client.batch_put(pairs).await.expect("Could not put pairs"); |
| 68 | + let pairs = vec![ |
| 69 | + KvPair::from(("k1", "v1")), |
| 70 | + KvPair::from(("k2", "v2")), |
| 71 | + KvPair::from(("k3", "v3")), |
| 72 | + ]; |
| 73 | + client.batch_put(pairs).await.expect("Could not put pairs"); |
74 | 74 |
|
75 | 75 | // Same thing when you want to retrieve multiple values.
|
76 |
| - // let keys = vec![Key::from("k1"), Key::from("k2")]; |
77 |
| - // let values = client |
78 |
| - // .batch_get(keys.clone()) |
79 |
| - // .await |
80 |
| - // .expect("Could not get values"); |
81 |
| - // println!("Found values: {:?} for keys: {:?}", values, keys); |
| 76 | + let keys = vec![Key::from("k1"), Key::from("k2")]; |
| 77 | + let values = client |
| 78 | + .batch_get(keys.clone()) |
| 79 | + .await |
| 80 | + .expect("Could not get values"); |
| 81 | + println!("Found values: {:?} for keys: {:?}", values, keys); |
82 | 82 |
|
83 | 83 | // Scanning a range of keys is also possible giving it two bounds
|
84 | 84 | // it will returns all entries between these two.
|
|
0 commit comments