Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ prometheus = ["prometheus/push", "prometheus/process"]
# Enable integration tests with a running TiKV and PD instance.
# Use $PD_ADDRS, comma separated, to set the addresses the tests use.
integration-tests = []
apiv2-no-prefix = []

[lib]
name = "tikv_client"
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export RUSTFLAGS=-Dwarnings
export PD_ADDRS ?= 127.0.0.1:2379
export MULTI_REGION ?= 1

ALL_FEATURES := integration-tests apiv2-no-prefix
ALL_FEATURES := integration-tests

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The TiKV client is a Rust library (crate). To use this crate in your project, ad

```toml
[dependencies]
tikv-client = "0.3"
tikv-client = "0.4"
```

### Prerequisites
Expand Down
6 changes: 1 addition & 5 deletions src/request/keyspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub const TXN_KEY_PREFIX: u8 = b'x';
pub const KEYSPACE_PREFIX_LEN: usize = 4;

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

Expand All @@ -38,7 +38,6 @@ impl Keyspace {
match self {
Keyspace::Disable => kvrpcpb::ApiVersion::V1,
Keyspace::Enable { .. } => kvrpcpb::ApiVersion::V2,
#[cfg(feature = "apiv2-no-prefix")]
Keyspace::ApiV2NoPrefix => kvrpcpb::ApiVersion::V2,
}
}
Expand Down Expand Up @@ -293,7 +292,6 @@ mod tests {
assert_eq!(key.truncate_keyspace(keyspace), expected_key);
}

#[cfg(feature = "apiv2-no-prefix")]
#[test]
fn test_apiv2_no_prefix_api_version() {
assert_eq!(
Expand All @@ -302,7 +300,6 @@ mod tests {
);
}

#[cfg(feature = "apiv2-no-prefix")]
#[test]
fn test_apiv2_no_prefix_encode_is_noop() {
let keyspace = Keyspace::ApiV2NoPrefix;
Expand All @@ -325,7 +322,6 @@ mod tests {
);
}

#[cfg(feature = "apiv2-no-prefix")]
#[test]
fn test_apiv2_no_prefix_truncate_is_noop() {
let keyspace = Keyspace::ApiV2NoPrefix;
Expand Down
1 change: 0 additions & 1 deletion src/transaction/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ impl Client {
/// keyspace/key-mode prefix, with a custom configuration.
///
/// This is intended for **server-side embedding** use cases. `config.keyspace` must be unset.
#[cfg(feature = "apiv2-no-prefix")]
pub async fn new_with_config_api_v2_no_prefix<S: Into<String>>(
pd_endpoints: Vec<S>,
config: Config,
Expand Down