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
49 changes: 18 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 9 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,40 @@ name = "tikv_client"
derive-new = "0.5"
failure = "0.1"
futures = { version = "0.3.5", features = ["async-await", "thread-pool"] }
futures-timer = "3.0"
grpcio = { version = "0.6", features = [ "secure", "prost-codec" ], default-features = false }
kvproto = { git = "https://github.com/pingcap/kvproto.git", features = [ "prost-codec" ], default-features = false }
lazy_static = "1"
log = "0.4"
log = "0.4"
prometheus = { version = "0.8", features = [ "push", "process" ], default-features = false }
rand = "0.7"
regex = "1"
serde = "1.0"
serde_derive = "1.0"
futures-timer = "3.0"
async-trait = "0.1"
tokio = { version = "0.2", features = ["sync"] }

tikv-client-common = { path = "tikv-client-common" }
tikv-client-pd = { path = "tikv-client-pd" }
tikv-client-proto = { path = "tikv-client-proto" }
tikv-client-store = { path = "tikv-client-store" }
mock-tikv = {path = "mock-tikv"}

[dependencies.prometheus]
version = "0.8"
default-features = false
features = ["push", "process"]

[dev-dependencies]
clap = "2.32"
tempdir = "0.3"
tokio = { version = "0.2", features = ["rt-threaded", "macros"] }
fail = { version = "0.3", features = [ "failpoints" ] }
proptest = "0.9"
proptest-derive = "0.1.0"
fail = { version = "0.3", features = [ "failpoints" ] }
simple_logger = "1.9.0"
tempdir = "0.3"
serial_test = "0.5.0"

[patch.crates-io]
raft-proto = { git = "https://github.com/tikv/raft-rs", rev = "e624c1d48460940a40d8aa69b5329460d9af87dd" }
simple_logger = "1.9.0"
tokio = { version = "0.2", features = ["rt-threaded", "macros"] }

[workspace]
members = [
"tikv-client-common",
"tikv-client-pd",
"tikv-client-proto",
"tikv-client-store",
"mock-tikv"
]
6 changes: 3 additions & 3 deletions mock-tikv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = "0.0.0"
edition = "2018"

[dependencies]
derive-new = "0.5.8"
futures = "0.3"
grpcio = { version = "0.6", features = [ "secure", "prost-codec" ], default-features = false }
kvproto = { git = "https://github.com/pingcap/kvproto.git", features = [ "prost-codec" ], default-features = false }
derive-new = "0.5.8"
tikv-client-common = { path = "../tikv-client-common"}
log = "0.4"
tikv-client-common = { path = "../tikv-client-common"}
tikv-client-proto = { path = "../tikv-client-proto"}
23 changes: 16 additions & 7 deletions mock-tikv/src/pd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use crate::{spawn_unary_success, MOCK_TIKV_PORT};
use futures::{FutureExt, StreamExt, TryFutureExt};
use grpcio::{Environment, Server, ServerBuilder, WriteFlags};
use kvproto::pdpb::*;
use std::sync::Arc;
use tikv_client_proto::pdpb::*;

pub const MOCK_PD_PORT: u16 = 50021;
/// This is mock pd server, used with mock tikv server.
Expand All @@ -18,22 +18,22 @@ impl MockPd {
MockPd { ts: 0 }
}

fn region() -> kvproto::metapb::Region {
kvproto::metapb::Region {
fn region() -> tikv_client_proto::metapb::Region {
tikv_client_proto::metapb::Region {
start_key: vec![],
end_key: vec![],
peers: vec![Self::leader()],
..Default::default()
}
}

fn leader() -> kvproto::metapb::Peer {
kvproto::metapb::Peer::default()
fn leader() -> tikv_client_proto::metapb::Peer {
tikv_client_proto::metapb::Peer::default()
}

fn store() -> kvproto::metapb::Store {
fn store() -> tikv_client_proto::metapb::Store {
// TODO: start_timestamp?
kvproto::metapb::Store {
tikv_client_proto::metapb::Store {
address: format!("localhost:{}", MOCK_TIKV_PORT),
..Default::default()
}
Expand Down Expand Up @@ -317,4 +317,13 @@ impl Pd for MockPd {
) {
todo!()
}

fn sync_max_ts(
&mut self,
_ctx: ::grpcio::RpcContext,
_req: SyncMaxTsRequest,
_sink: ::grpcio::UnarySink<SyncMaxTsResponse>,
) {
todo!()
}
}
Loading