Skip to content

Commit 8a128ac

Browse files
committed
Review changes
Signed-off-by: Nick Cameron <nrc@ncameron.org>
1 parent 87e091d commit 8a128ac

File tree

3 files changed

+30
-26
lines changed

3 files changed

+30
-26
lines changed

README.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tikv-client = 0.1
2121

2222
Note, that you will need `tikv-client = { git = "https://github.com/tikv/client-rust.git" }` until we publish the crate (should be any day now).
2323

24-
The minimum supported version of Rust is 1.40.
24+
The minimum supported version of Rust is 1.40. The minimum supported version of TiKV is 5.0.
2525

2626
The general flow of using the client crate is to create either a raw or transaction client object (which can be configured) then send commands using the client object, or use it to create transactions objects. In the latter case, the transaction is built up using various commands and then committed (or rolled back).
2727

@@ -73,32 +73,36 @@ Important note: It is **not recommended or supported** to use both the raw and t
7373

7474
### Raw requests
7575

76-
| Request | Main parameter type | Result type | Noteworthy Behavior |
77-
| -------------- | ------------------- | ---------------- | ---------------------------------------------- |
78-
| `put` | `KvPair` | | |
79-
| `get` | `Key` | `Option<Value>` | |
80-
| `delete` | `Key` | | |
81-
| `delete_range` | `BoundRange` | | |
82-
| `scan` | `BoundRange` | `Vec<KvPair>` | |
83-
| `batch_put` | `Iter<KvPair>` | | |
84-
| `batch_get` | `Iter<Key>` | `Vec<KvPair>` | Skips non-existent keys; does not retain order |
85-
| `batch_delete` | `Iter<Key>` | | |
86-
| `batch_scan` | `Iter<BoundRange>` | `Vec<KvPair>` | See docs for `each_limit` parameter behavior. The order of ranges is retained. |
76+
| Request | Main parameter type | Result type | Noteworthy Behavior |
77+
| ------------------ | ------------------- | ---------------- | ---------------------------------------------- |
78+
| `put` | `KvPair` | | |
79+
| `get` | `Key` | `Option<Value>` | |
80+
| `delete` | `Key` | | |
81+
| `delete_range` | `BoundRange` | | |
82+
| `scan` | `BoundRange` | `Vec<KvPair>` | |
83+
| `batch_put` | `Iter<KvPair>` | | |
84+
| `batch_get` | `Iter<Key>` | `Vec<KvPair>` | Skips non-existent keys; does not retain order |
85+
| `batch_delete` | `Iter<Key>` | | |
86+
| `batch_scan` | `Iter<BoundRange>` | `Vec<KvPair>` | See docs for `each_limit` parameter behavior. The order of ranges is retained. |
87+
| `batch_scan_keys` | `Iter<BoundRange>` | `Vec<Key>` | See docs for `each_limit` parameter behavior. The order of ranges is retained. |
88+
| `compare_and_swap` | `Key` + 2x `Value` | `(Option<Value>, bool)` | |
8789

8890
### Transactional requests
8991

90-
| Request | Main parameter type | Result type | Noteworthy Behavior |
91-
| -------------| ------------------- | --------------- | ------------------------------------------------------------------ |
92-
| `put` | `KvPair` | | |
93-
| `get` | `Key` | `Option<value>` | |
94-
| `key_exists` | `Key` | `bool` | |
95-
| `delete` | `Key` | | |
96-
| `scan` | `BoundRange` | `Iter<KvPair>` | |
97-
| `scan_keys` | `BoundRange` | `Iter<Key>` | |
98-
| `batch_get` | `Iter<Key>` | `Iter<KvPair>` | Skips non-existent keys; does not retain order |
99-
| `lock_keys` | `Iter<Key>` | | |
100-
| `gc` | `Timestamp` | `bool` | Returns true if the latest safepoint in PD equals the parameter |
101-
92+
| Request | Main parameter type | Result type | Noteworthy Behavior |
93+
| ---------------------- | ------------------- | --------------- | ------------------------------------------------------------------ |
94+
| `put` | `KvPair` | | |
95+
| `get` | `Key` | `Option<value>` | |
96+
| `get_for_update` | `Key` | `Option<value>` | |
97+
| `key_exists` | `Key` | `bool` | |
98+
| `delete` | `Key` | | |
99+
| `scan` | `BoundRange` | `Iter<KvPair>` | |
100+
| `scan_keys` | `BoundRange` | `Iter<Key>` | |
101+
| `batch_get` | `Iter<Key>` | `Iter<KvPair>` | Skips non-existent keys; does not retain order |
102+
| `batch_get_for_update` | `Iter<Key>` | `Iter<KvPair>` | Skips non-existent keys; does not retain order |
103+
| `lock_keys` | `Iter<Key>` | | |
104+
| `send_heart_beat` | | `u64` (TTL) | |
105+
| `gc` | `Timestamp` | `bool` | Returns true if the latest safepoint in PD equals the parameter |
102106

103107
# Development and contributing
104108

src/transaction/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl Client {
174174
self.pd.clone().get_timestamp().await
175175
}
176176

177-
/// Trigger garbage collection (GC) of the TiKV cluster.
177+
/// Request garbage collection (GC) of the TiKV cluster.
178178
///
179179
/// GC deletes MVCC records whose timestamp is lower than the given `safepoint`.
180180
///

src/transaction/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use tokio::{sync::RwLock, time::Duration};
2828
/// of the transaction (at the start timestamp, `start_ts`). Once a transaction is commited, a
2929
/// its writes atomically become visible to other transactions at (logically) the commit timestamp.
3030
///
31-
/// In other words, a transaction can read data that was committed at `commit_ts` <= its `start_ts`,
31+
/// In other words, a transaction can read data that was committed at `commit_ts` < its `start_ts`,
3232
/// and its writes are readable by transactions with `start_ts` >= its `commit_ts`.
3333
///
3434
/// Mutations are buffered locally and sent to the TiKV cluster at the time of commit.

0 commit comments

Comments
 (0)