Skip to content
Open
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
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ lazy_static = "1"
log = "0.4"
pin-project = "1"
prometheus = { version = "0.13", default-features = false }
prost = "0.13"
prost = "0.14"
rand = "0.8"
regex = "1"
semver = "1.0"
Expand All @@ -46,7 +46,8 @@ serde_json = "1"
take_mut = "0.2.2"
thiserror = "1"
tokio = { version = "1.21", features = ["sync", "rt-multi-thread", "macros"] }
tonic = { version = "0.12", features = ["tls", "gzip"] }
tonic = { version = "0.14", features = ["tls-ring", "gzip"] }
tonic-prost = "0.14"

[dev-dependencies]
clap = "2"
Expand Down
4 changes: 2 additions & 2 deletions proto-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ edition = "2021"

[dependencies]
glob = "0.3"
tonic-build = { version = "0.10", features = ["cleanup-markdown"] }
# Keep this compatible with rust-toolchain 1.84.1.
tonic-prost-build = { version = "0.14", features = ["cleanup-markdown"] }
# Keep this pinned for reproducible builds.
tempfile = "=3.14.0"
18 changes: 10 additions & 8 deletions proto-build/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
// Copyright 2023 TiKV Project Authors. Licensed under Apache-2.0.

use std::path::PathBuf;

fn main() {
tonic_build::configure()
let protos = glob::glob("proto/*.proto")
.unwrap()
.collect::<Result<Vec<_>, _>>()
.unwrap();
let includes = [PathBuf::from("proto/include"), PathBuf::from("proto")];

tonic_prost_build::configure()
.emit_rerun_if_changed(false)
.build_server(false)
.include_file("mod.rs")
.out_dir("src/generated")
.compile(
&glob::glob("proto/*.proto")
.unwrap()
.collect::<Result<Vec<_>, _>>()
.unwrap(),
&["proto/include", "proto"],
)
.compile_protos(&protos, &includes)
.unwrap();
}
44 changes: 22 additions & 22 deletions src/generated/autoid.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AutoIdRequest {
#[prost(int64, tag = "1")]
pub db_id: i64,
Expand All @@ -17,8 +16,7 @@ pub struct AutoIdRequest {
#[prost(uint32, tag = "7")]
pub keyspace_id: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AutoIdResponse {
#[prost(int64, tag = "1")]
pub min: i64,
Expand All @@ -27,8 +25,7 @@ pub struct AutoIdResponse {
#[prost(bytes = "vec", tag = "3")]
pub errmsg: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RebaseRequest {
#[prost(int64, tag = "1")]
pub db_id: i64,
Expand All @@ -41,15 +38,20 @@ pub struct RebaseRequest {
#[prost(bool, tag = "5")]
pub force: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RebaseResponse {
#[prost(bytes = "vec", tag = "1")]
pub errmsg: ::prost::alloc::vec::Vec<u8>,
}
/// Generated client implementations.
pub mod auto_id_alloc_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
Expand All @@ -69,10 +71,10 @@ pub mod auto_id_alloc_client {
}
impl<T> AutoIdAllocClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Expand All @@ -90,14 +92,14 @@ pub mod auto_id_alloc_client {
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
AutoIdAllocClient::new(InterceptedService::new(inner, interceptor))
}
Expand Down Expand Up @@ -140,12 +142,11 @@ pub mod auto_id_alloc_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/autoid.AutoIDAlloc/AllocAutoID",
);
Expand All @@ -162,12 +163,11 @@ pub mod auto_id_alloc_client {
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/autoid.AutoIDAlloc/Rebase",
);
Expand Down
Loading
Loading