mirror of https://github.com/tikv/client-rust.git
parent
0536d977bd
commit
1e6ece629a
File diff suppressed because it is too large
Load Diff
|
@ -50,7 +50,7 @@ clap = "2"
|
|||
env_logger = "0.10"
|
||||
fail = { version = "0.4", features = ["failpoints"] }
|
||||
proptest = "1"
|
||||
proptest-derive = "0.3"
|
||||
proptest-derive = "0.5.1"
|
||||
reqwest = { version = "0.11", default-features = false, features = [
|
||||
"native-tls-vendored",
|
||||
] }
|
||||
|
|
4
Makefile
4
Makefile
|
@ -21,7 +21,9 @@ generate:
|
|||
check: generate
|
||||
cargo check --all --all-targets --features "${ALL_FEATURES}"
|
||||
cargo fmt -- --check
|
||||
cargo clippy --all-targets --features "${ALL_FEATURES}" -- -D clippy::all
|
||||
cargo clippy --all-targets --features "${ALL_FEATURES}" -- \
|
||||
-D clippy::all \
|
||||
-A clippy::doc_lazy_continuation
|
||||
|
||||
unit-test: generate
|
||||
cargo nextest run --all --no-default-features
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
[toolchain]
|
||||
channel = "nightly-2023-12-10"
|
||||
components = ["rustfmt", "clippy"]
|
||||
channel = "1.84.1"
|
||||
components = ["rustfmt", "clippy", "rust-analyzer"]
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
use std::fmt;
|
||||
use std::ops::Bound;
|
||||
use std::u8;
|
||||
|
||||
#[allow(unused_imports)]
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
|
||||
use std::fmt;
|
||||
use std::u8;
|
||||
|
||||
mod bound_range;
|
||||
pub mod codec;
|
||||
|
@ -16,7 +15,7 @@ pub use value::Value;
|
|||
|
||||
struct HexRepr<'a>(pub &'a [u8]);
|
||||
|
||||
impl<'a> fmt::Display for HexRepr<'a> {
|
||||
impl fmt::Display for HexRepr<'_> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
for byte in self.0 {
|
||||
write!(f, "{byte:02X}")?;
|
||||
|
|
|
@ -11,5 +11,4 @@ const _PROPTEST_VALUE_MAX: usize = 1024 * 16; // 16 KB
|
|||
/// Since `Value` is just an alias for `Vec<u8>`, conversions to and from it are easy.
|
||||
///
|
||||
/// Many functions which accept a `Value` accept an `Into<Value>`.
|
||||
|
||||
pub type Value = Vec<u8>;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
use core::ops::Range;
|
||||
use std::str::FromStr;
|
||||
use std::sync::Arc;
|
||||
use std::u32;
|
||||
|
||||
use futures::StreamExt;
|
||||
use log::debug;
|
||||
|
|
|
@ -8,7 +8,6 @@ use std::cmp::max;
|
|||
use std::cmp::min;
|
||||
use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use derive_new::new;
|
||||
use futures::prelude::*;
|
||||
use futures::stream::BoxStream;
|
||||
|
@ -38,21 +37,6 @@ pub struct Store {
|
|||
pub client: Arc<dyn KvClient + Send + Sync>,
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
pub trait KvConnectStore: KvConnect {
|
||||
async fn connect_to_store(
|
||||
&self,
|
||||
region: RegionWithLeader,
|
||||
address: String,
|
||||
) -> Result<RegionStore> {
|
||||
log::info!("connect to tikv endpoint: {:?}", &address);
|
||||
let client = self.connect(address.as_str()).await?;
|
||||
Ok(RegionStore::new(region, Arc::new(client)))
|
||||
}
|
||||
}
|
||||
|
||||
impl KvConnectStore for TikvConnect {}
|
||||
|
||||
/// Maps keys to a stream of stores. `key_data` must be sorted in increasing order
|
||||
pub fn store_stream_for_keys<K, KOut, PdC>(
|
||||
key_data: impl Iterator<Item = K> + Send + Sync + 'static,
|
||||
|
|
|
@ -253,7 +253,7 @@ pub fn new_prewrite_request(
|
|||
req.start_version = start_version;
|
||||
req.lock_ttl = lock_ttl;
|
||||
// FIXME: Lite resolve lock is currently disabled
|
||||
req.txn_size = std::u64::MAX;
|
||||
req.txn_size = u64::MAX;
|
||||
|
||||
req
|
||||
}
|
||||
|
@ -906,7 +906,6 @@ impl Merge<kvrpcpb::UnsafeDestroyRangeResponse> for Collect {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg_attr(feature = "protobuf-codec", allow(clippy::useless_conversion))]
|
||||
mod tests {
|
||||
use crate::common::Error::PessimisticLockError;
|
||||
use crate::common::Error::ResolveLockError;
|
||||
|
|
Loading…
Reference in New Issue