Skip to content

Commit 061c8d1

Browse files
authored
keyspace: Remove the "apiv2-no-prefix" feature (tikv#522)
Signed-off-by: Ping Yu <yuping@pingcap.com>
1 parent 353e52d commit 061c8d1

5 files changed

Lines changed: 4 additions & 10 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ prometheus = ["prometheus/push", "prometheus/process"]
1414
# Enable integration tests with a running TiKV and PD instance.
1515
# Use $PD_ADDRS, comma separated, to set the addresses the tests use.
1616
integration-tests = []
17-
apiv2-no-prefix = []
1817

1918
[lib]
2019
name = "tikv_client"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ export RUSTFLAGS=-Dwarnings
55
export PD_ADDRS ?= 127.0.0.1:2379
66
export MULTI_REGION ?= 1
77

8-
ALL_FEATURES := integration-tests apiv2-no-prefix
8+
ALL_FEATURES := integration-tests
99

1010
NEXTEST_ARGS := --config-file $(shell pwd)/config/nextest.toml
1111

12-
INTEGRATION_TEST_ARGS := --features "integration-tests apiv2-no-prefix" --test-threads 1
12+
INTEGRATION_TEST_ARGS := --features "integration-tests" --test-threads 1
1313

1414
RUN_INTEGRATION_TEST := cargo nextest run ${NEXTEST_ARGS} --all ${INTEGRATION_TEST_ARGS}
1515

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The TiKV client is a Rust library (crate). To use this crate in your project, ad
1717

1818
```toml
1919
[dependencies]
20-
tikv-client = "0.3"
20+
tikv-client = "0.4"
2121
```
2222

2323
### Prerequisites

src/request/keyspace.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub const TXN_KEY_PREFIX: u8 = b'x';
1313
pub const KEYSPACE_PREFIX_LEN: usize = 4;
1414

1515
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
16+
#[non_exhaustive]
1617
pub enum Keyspace {
1718
Disable,
1819
Enable {
@@ -23,7 +24,6 @@ pub enum Keyspace {
2324
/// This mode is intended for **server-side embedding** use cases (e.g. embedding this client in
2425
/// `tikv-server`) where keys are already in API V2 "logical key bytes" form and must be passed
2526
/// through unchanged.
26-
#[cfg(feature = "apiv2-no-prefix")]
2727
ApiV2NoPrefix,
2828
}
2929

@@ -38,7 +38,6 @@ impl Keyspace {
3838
match self {
3939
Keyspace::Disable => kvrpcpb::ApiVersion::V1,
4040
Keyspace::Enable { .. } => kvrpcpb::ApiVersion::V2,
41-
#[cfg(feature = "apiv2-no-prefix")]
4241
Keyspace::ApiV2NoPrefix => kvrpcpb::ApiVersion::V2,
4342
}
4443
}
@@ -293,7 +292,6 @@ mod tests {
293292
assert_eq!(key.truncate_keyspace(keyspace), expected_key);
294293
}
295294

296-
#[cfg(feature = "apiv2-no-prefix")]
297295
#[test]
298296
fn test_apiv2_no_prefix_api_version() {
299297
assert_eq!(
@@ -302,7 +300,6 @@ mod tests {
302300
);
303301
}
304302

305-
#[cfg(feature = "apiv2-no-prefix")]
306303
#[test]
307304
fn test_apiv2_no_prefix_encode_is_noop() {
308305
let keyspace = Keyspace::ApiV2NoPrefix;
@@ -325,7 +322,6 @@ mod tests {
325322
);
326323
}
327324

328-
#[cfg(feature = "apiv2-no-prefix")]
329325
#[test]
330326
fn test_apiv2_no_prefix_truncate_is_noop() {
331327
let keyspace = Keyspace::ApiV2NoPrefix;

src/transaction/client.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ impl Client {
125125
/// keyspace/key-mode prefix, with a custom configuration.
126126
///
127127
/// This is intended for **server-side embedding** use cases. `config.keyspace` must be unset.
128-
#[cfg(feature = "apiv2-no-prefix")]
129128
pub async fn new_with_config_api_v2_no_prefix<S: Into<String>>(
130129
pd_endpoints: Vec<S>,
131130
config: Config,

0 commit comments

Comments
 (0)