// This file is @generated by prost-build.
/// Fragment metadata primarily stores all data files under a
/// ​​fragment​​
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct FragProperty {
    /// Total file size of fragment.
    #[prost(uint64, tag = "1")]
    pub size: u64,
    /// Distinct handle count in fragment.
    #[prost(uint64, tag = "2")]
    pub count: u64,
    /// Min handle included in fragment.
    #[prost(bytes = "vec", tag = "3")]
    pub min_handle: ::prost::alloc::vec::Vec<u8>,
    #[prost(bytes = "vec", repeated, tag = "4")]
    pub split_handles: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
    /// Max handle included in fragment.
    #[prost(bytes = "vec", tag = "5")]
    pub max_handle: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "6")]
    pub delete_count: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FragStorageRef {
    /// full_key = frag_path/sub_key
    #[prost(string, tag = "1")]
    pub sub_key: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub offset: u64,
    #[prost(uint64, tag = "3")]
    pub size: u64,
}
/// Represent metadata for an uploaded fragment on S3
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct FragMeta {
    /// Data format version​​, used for future iterative upgrades
    #[prost(uint64, tag = "1")]
    pub format_version: u64,
    /// Root path of the fragment​​
    #[prost(string, tag = "2")]
    pub frag_path: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub property: ::core::option::Option<FragProperty>,
    /// Object storage references for uploaded fragment bundles. Must not be empty.
    #[prost(message, repeated, tag = "4")]
    pub storage_refs: ::prost::alloc::vec::Vec<FragStorageRef>,
    /// Number of index segments in the fragment.
    #[prost(uint32, tag = "5")]
    pub seg_count: u32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugGetShardInfoRequest {
    #[prost(uint64, repeated, tag = "1")]
    pub shard_ids: ::prost::alloc::vec::Vec<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShardInfo {
    #[prost(message, optional, tag = "1")]
    pub table_info: ::core::option::Option<super::schema::TableInfo>,
    #[prost(message, optional, tag = "2")]
    pub index_info: ::core::option::Option<super::schema::IndexInfo>,
    #[prost(message, optional, tag = "3")]
    pub shard_info: ::core::option::Option<super::tici::ShardManifestHeader>,
    #[prost(message, repeated, tag = "4")]
    pub frag_metas: ::prost::alloc::vec::Vec<FragMeta>,
    #[prost(string, tag = "5")]
    pub s3_bucket: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugGetShardInfoResponse {
    #[prost(int32, tag = "1")]
    pub status: i32,
    #[prost(message, repeated, tag = "2")]
    pub shards: ::prost::alloc::vec::Vec<ShardInfo>,
}
/// GetIndexMetaRequest is a request to get TableInfo and IndexInfo by keyspace_id,
/// table_id and index_id.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIndexMetaRequest {
    #[prost(uint32, tag = "1")]
    pub keyspace_id: u32,
    #[prost(int64, tag = "2")]
    pub table_id: i64,
    #[prost(int64, tag = "3")]
    pub index_id: i64,
}
/// GetIndexMetaResponse is a response containing TableInfo and IndexInfo.
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIndexMetaResponse {
    #[prost(enumeration = "super::tici::ErrorCode", tag = "1")]
    pub status: i32,
    /// Error message, only valid when status is non-zero
    #[prost(string, tag = "2")]
    pub error_message: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "3")]
    pub table_info: ::core::option::Option<super::schema::TableInfo>,
    #[prost(message, optional, tag = "4")]
    pub index_info: ::core::option::Option<super::schema::IndexInfo>,
}
/// Reader node status information
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReaderNodeStatus {
    /// CPU usage percentage (0.0 to 100.0)
    #[prost(double, tag = "1")]
    pub cpu_usage: f64,
    /// Memory usage in bytes
    #[prost(uint64, tag = "2")]
    pub memory_usage: u64,
    /// Number of requests processed in current heartbeat cycle
    #[prost(uint32, tag = "3")]
    pub requests_in_cycle: u32,
    /// Cache hit rate percentage (0.0 to 100.0)
    #[prost(double, tag = "4")]
    pub cache_hit_rate: f64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReaderCachedShard {
    #[prost(uint64, tag = "1")]
    pub shard_id: u64,
    #[prost(uint64, tag = "2")]
    pub seq: u64,
}
/// Reader node heartbeat request
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReaderNodeHeartbeatRequest {
    /// Reader node address
    #[prost(string, tag = "1")]
    pub addr: ::prost::alloc::string::String,
    /// Reader node status
    #[prost(message, optional, tag = "2")]
    pub status: ::core::option::Option<ReaderNodeStatus>,
    /// TiFlash server address
    #[prost(string, tag = "3")]
    pub tiflash_server_addr: ::prost::alloc::string::String,
    /// Legacy list of cached shard IDs on this reader.
    #[prost(uint64, repeated, tag = "4")]
    pub cached_shard_ids: ::prost::alloc::vec::Vec<u64>,
    /// Cached shards on this reader with locally observed seq.
    #[prost(message, repeated, tag = "5")]
    pub cached_shards: ::prost::alloc::vec::Vec<ReaderCachedShard>,
}
/// Reader node heartbeat response
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReaderNodeHeartbeatResponse {
    #[prost(enumeration = "super::tici::ErrorCode", tag = "1")]
    pub status: i32,
    /// Error message, only valid when status is non-zero
    #[prost(string, tag = "2")]
    pub error_message: ::prost::alloc::string::String,
    /// List of shard headers that should be kept in cache
    #[prost(message, repeated, tag = "3")]
    pub shards_to_keep: ::prost::alloc::vec::Vec<super::tici::ShardManifestHeader>,
    /// List of shard headers that should be removed from cache
    #[prost(message, repeated, tag = "4")]
    pub shards_to_remove: ::prost::alloc::vec::Vec<super::tici::ShardManifestHeader>,
}
/// - If the index is built successfully, the `status` field should be 0,
///   and the `frag_metas` field should contain the metadata of the uploaded
///   baseline fragments. MetaService is responsible for
///   1. Find the overlapped Shards for the given table_id, index_id and key_range
///   2. Append the frags to all the overlapped shards' baseline frags
///   3. Update the ImportTask with task_id status as finished
/// - If the index building meet unrecoverable errors, then MetaService should
///   update the ImportTask with task_id status as failed
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinishImportPartitionBuildRequest {
    #[prost(uint32, tag = "1")]
    pub keyspace_id: u32,
    #[prost(int64, tag = "2")]
    pub table_id: i64,
    #[prost(int64, tag = "3")]
    pub index_id: i64,
    #[prost(uint64, tag = "4")]
    pub task_id: u64,
    #[prost(enumeration = "super::tici::ErrorCode", tag = "5")]
    pub status: i32,
    /// The uploaded fragment metadata when status is 0.
    #[prost(message, repeated, tag = "6")]
    pub frag_metas: ::prost::alloc::vec::Vec<FragMeta>,
    /// The error message if the status is not SUCCESS.
    #[prost(string, tag = "7")]
    pub error_message: ::prost::alloc::string::String,
    /// The number of rows processed by this task.
    #[prost(uint64, tag = "8")]
    pub rows_processed: u64,
    /// The bytes processed by this task.
    #[prost(uint64, tag = "9")]
    pub bytes_processed: u64,
    /// The original import file size in bytes.
    #[prost(uint64, tag = "10")]
    pub input_file_size: u64,
    #[prost(string, tag = "11")]
    pub owner_addr: ::prost::alloc::string::String,
    #[prost(uint64, tag = "12")]
    pub owner_seq: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugGetShardManifestRequest {
    #[prost(uint32, tag = "1")]
    pub keyspace_id: u32,
    #[prost(int64, tag = "2")]
    pub table_id: i64,
    #[prost(int64, tag = "3")]
    pub index_id: i64,
    #[prost(message, optional, tag = "4")]
    pub key_range: ::core::option::Option<super::tici::KeyRange>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugGetShardManifestResponse {
    #[prost(int32, tag = "1")]
    pub status: i32,
    #[prost(message, repeated, tag = "2")]
    pub frag_metas: ::prost::alloc::vec::Vec<FragMeta>,
    #[prost(uint64, tag = "3")]
    pub shard_id: u64,
    #[prost(uint64, tag = "4")]
    pub seq: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetShardManifestRequest {
    #[prost(uint32, tag = "1")]
    pub keyspace_id: u32,
    #[prost(int64, tag = "2")]
    pub table_id: i64,
    #[prost(int64, tag = "3")]
    pub index_id: i64,
    #[prost(uint64, tag = "4")]
    pub shard_id: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetShardManifestResponse {
    #[prost(enumeration = "super::tici::ErrorCode", tag = "1")]
    pub status: i32,
    #[prost(message, repeated, tag = "2")]
    pub frag_metas: ::prost::alloc::vec::Vec<FragMeta>,
    #[prost(uint64, tag = "3")]
    pub shard_id: u64,
    #[prost(uint64, tag = "4")]
    pub seq: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct ShardProgress {
    #[prost(string, tag = "1")]
    pub last_cdc_file: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct AppendDeltaFragMetaRequest {
    #[prost(uint32, tag = "1")]
    pub keyspace_id: u32,
    #[prost(int64, tag = "2")]
    pub table_id: i64,
    #[prost(int64, tag = "3")]
    pub index_id: i64,
    #[prost(uint64, tag = "4")]
    pub shard_id: u64,
    #[prost(string, tag = "5")]
    pub worker_node_addr: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "6")]
    pub frag_metas: ::prost::alloc::vec::Vec<FragMeta>,
    #[prost(message, optional, tag = "7")]
    pub progress: ::core::option::Option<ShardProgress>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppendFragMetaResponse {
    #[prost(enumeration = "super::tici::ErrorCode", tag = "1")]
    pub status: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AppendBaseFragMetaRequest {
    #[prost(uint32, tag = "1")]
    pub keyspace_id: u32,
    #[prost(int64, tag = "2")]
    pub table_id: i64,
    #[prost(int64, tag = "3")]
    pub index_id: i64,
    #[prost(message, repeated, tag = "4")]
    pub frag_metas: ::prost::alloc::vec::Vec<FragMeta>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinishCompactFragRequest {
    #[prost(string, tag = "1")]
    pub addr: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub shard: ::core::option::Option<super::tici::ShardManifestHeader>,
    #[prost(uint32, tag = "3")]
    pub keyspace_id: u32,
    #[prost(int64, tag = "4")]
    pub table_id: i64,
    #[prost(int64, tag = "5")]
    pub index_id: i64,
    #[prost(uint64, tag = "6")]
    pub seq: u64,
    #[prost(uint64, tag = "7")]
    pub timestamp: u64,
    #[prost(string, tag = "8")]
    pub leader_term: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "9")]
    pub input_frags: ::prost::alloc::vec::Vec<FragMeta>,
    #[prost(message, repeated, tag = "10")]
    pub output_frags: ::prost::alloc::vec::Vec<FragMeta>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FinishCompactFragResponse {
    #[prost(enumeration = "super::tici::ErrorCode", tag = "1")]
    pub status: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerNodeStatus {
    /// TODO Need more metrics, such as disk usage, quotas, cache miss rates
    #[prost(double, tag = "1")]
    pub cpu_usage: f64,
    #[prost(uint64, tag = "2")]
    pub memory_usage: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerNodeHeartbeatRequest {
    #[prost(string, tag = "1")]
    pub addr: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub status: ::core::option::Option<WorkerNodeStatus>,
    #[prost(message, repeated, tag = "3")]
    pub shards: ::prost::alloc::vec::Vec<WorkerNodeShardStatus>,
    #[prost(message, repeated, tag = "4")]
    pub compactions: ::prost::alloc::vec::Vec<WorkerNodeCompactionStatus>,
    #[prost(message, repeated, tag = "5")]
    pub import_writes: ::prost::alloc::vec::Vec<super::import::ImportWriteStatus>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerNodeHeartbeatResponse {
    #[prost(enumeration = "super::tici::ErrorCode", tag = "1")]
    pub status: i32,
    #[prost(message, repeated, tag = "2")]
    pub to_add_shards: ::prost::alloc::vec::Vec<AddShardRequest>,
    /// We assume the `shard_id`s are unique across tables,
    /// So using `shard_id` is enough here.
    #[prost(uint64, repeated, tag = "3")]
    pub to_remove_shards: ::prost::alloc::vec::Vec<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerNodeShardStatus {
    #[prost(bytes = "vec", tag = "1")]
    pub start_key: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "5")]
    pub shard_id: u64,
}
/// AddShardRequest is sent from meta service to worker node
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddShardRequest {
    #[prost(message, optional, tag = "1")]
    pub shard: ::core::option::Option<super::tici::ShardManifestHeader>,
    /// Index information
    #[prost(message, optional, tag = "2")]
    pub index_info: ::core::option::Option<super::schema::IndexInfo>,
    /// Table information
    #[prost(message, optional, tag = "3")]
    pub table_info: ::core::option::Option<super::schema::TableInfo>,
    /// If the shard is created from scratch, this field is empty
    #[prost(string, tag = "4")]
    pub cdc_s3_last_file: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "5")]
    pub cdc_location: ::core::option::Option<super::tici::S3Location>,
    #[prost(message, optional, tag = "6")]
    pub upload_location: ::core::option::Option<super::tici::S3Location>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactFragRequest {
    #[prost(message, optional, tag = "1")]
    pub shard: ::core::option::Option<super::tici::ShardManifestHeader>,
    #[prost(uint32, tag = "2")]
    pub keyspace_id: u32,
    #[prost(int64, tag = "3")]
    pub table_id: i64,
    #[prost(int64, tag = "4")]
    pub index_id: i64,
    #[prost(uint64, tag = "5")]
    pub seq: u64,
    #[prost(uint64, tag = "6")]
    pub timestamp: u64,
    #[prost(string, tag = "7")]
    pub leader_term: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "8")]
    pub input_frags: ::prost::alloc::vec::Vec<FragMeta>,
    #[prost(message, optional, tag = "9")]
    pub upload_location: ::core::option::Option<super::tici::S3Location>,
    #[prost(enumeration = "CompactType", tag = "10")]
    pub compact_type: i32,
    #[prost(string, tag = "11")]
    pub worker: ::prost::alloc::string::String,
    /// min_split_row_count means the minimum row count in a split.
    /// For example, if min_split_row_count=5000, then a shard with 15000 lines can only be splitted into 3 shards at most.
    #[prost(uint64, tag = "12")]
    pub min_split_row_count: u64,
    /// max_split_point_count means the maximum shards we can split.
    /// For example, if min_split_row_count=1 and max_split_point_count=4, then a shard with 15000 lines can only be splitted into 4 shards at most.
    #[prost(uint64, tag = "13")]
    pub max_split_point_count: u64,
    #[prost(message, optional, tag = "14")]
    pub index_info: ::core::option::Option<super::schema::IndexInfo>,
    #[prost(message, optional, tag = "15")]
    pub table_info: ::core::option::Option<super::schema::TableInfo>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WorkerNodeCompactionStatus {
    #[prost(message, optional, tag = "1")]
    pub req: ::core::option::Option<CompactFragRequest>,
}
/// AddShardResponse
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddShardResponse {
    /// Operation result status code, 0 means success
    #[prost(enumeration = "super::tici::ErrorCode", tag = "1")]
    pub status: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactFragResponse {
    #[prost(enumeration = "super::tici::ErrorCode", tag = "1")]
    pub status: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CompactType {
    Delta = 0,
    Base = 1,
    Full = 2,
}
impl CompactType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            CompactType::Delta => "Delta",
            CompactType::Base => "Base",
            CompactType::Full => "Full",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "Delta" => Some(Self::Delta),
            "Base" => Some(Self::Base),
            "Full" => Some(Self::Full),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod meta_service_internal_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct MetaServiceInternalClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl MetaServiceInternalClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> MetaServiceInternalClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> MetaServiceInternalClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            MetaServiceInternalClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Maintains heartbeat from reader nodes to meta service.
        pub async fn reader_node_heartbeat(
            &mut self,
            request: impl tonic::IntoRequest<super::ReaderNodeHeartbeatRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ReaderNodeHeartbeatResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/ReaderNodeHeartbeat",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "ReaderNodeHeartbeat",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Maintains heartbeat from worker nodes(such as writers, compactors) to meta
        /// service.
        pub async fn worker_node_heartbeat(
            &mut self,
            request: impl tonic::IntoRequest<super::WorkerNodeHeartbeatRequest>,
        ) -> std::result::Result<
            tonic::Response<tonic::codec::Streaming<super::WorkerNodeHeartbeatResponse>>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/WorkerNodeHeartbeat",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "WorkerNodeHeartbeat",
                    ),
                );
            self.inner.server_streaming(req, path, codec).await
        }
        pub async fn finish_compact_fragments(
            &mut self,
            request: impl tonic::IntoRequest<super::FinishCompactFragRequest>,
        ) -> std::result::Result<
            tonic::Response<super::FinishCompactFragResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/FinishCompactFragments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "FinishCompactFragments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn append_delta_frag_meta(
            &mut self,
            request: impl tonic::IntoRequest<super::AppendDeltaFragMetaRequest>,
        ) -> std::result::Result<
            tonic::Response<super::AppendFragMetaResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/AppendDeltaFragMeta",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "AppendDeltaFragMeta",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// TODO: this method should be replace by `FinishPartitionBuild`
        /// / Append base fragment metadata, used for baseline shards
        /// / MetaService is responsible for
        /// / 1. Find the overlapped Shards for the given table_id, index_id and
        /// / key_range
        /// / 2. Append the frags to all the overlapped shards' baseline frags
        pub async fn append_base_frag_meta(
            &mut self,
            request: impl tonic::IntoRequest<super::AppendBaseFragMetaRequest>,
        ) -> std::result::Result<
            tonic::Response<super::AppendFragMetaResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/AppendBaseFragMeta",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "AppendBaseFragMeta",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Debug usage: get shard manifest from meta service writer
        pub async fn debug_get_shard_manifest(
            &mut self,
            request: impl tonic::IntoRequest<super::DebugGetShardManifestRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DebugGetShardManifestResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/DebugGetShardManifest",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "DebugGetShardManifest",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Get shard manifest from shard cache manager
        pub async fn get_shard_manifest(
            &mut self,
            request: impl tonic::IntoRequest<super::GetShardManifestRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetShardManifestResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/GetShardManifest",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "GetShardManifest",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Called by TiCI worker to notify Meta Service after a partition for
        /// the given index is built.
        pub async fn finish_import_partition_build(
            &mut self,
            request: impl tonic::IntoRequest<super::FinishImportPartitionBuildRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::tici::FinishImportResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/FinishImportPartitionBuild",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "FinishImportPartitionBuild",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn debug_get_shard_info(
            &mut self,
            request: impl tonic::IntoRequest<super::DebugGetShardInfoRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DebugGetShardInfoResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/DebugGetShardInfo",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "tici_internal.MetaServiceInternal",
                        "DebugGetShardInfo",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// GetIndexMeta returns TableInfo and IndexInfo for the given keyspace_id,
        /// table_id and index_id.
        pub async fn get_index_meta(
            &mut self,
            request: impl tonic::IntoRequest<super::GetIndexMetaRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetIndexMetaResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.MetaServiceInternal/GetIndexMeta",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("tici_internal.MetaServiceInternal", "GetIndexMeta"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated client implementations.
pub mod worker_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// WorkerService provides index creation and deletion functionality
    #[derive(Debug, Clone)]
    pub struct WorkerServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl WorkerServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> WorkerServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> WorkerServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + Send + Sync,
        {
            WorkerServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Add shard for an index
        pub async fn add_shard(
            &mut self,
            request: impl tonic::IntoRequest<super::AddShardRequest>,
        ) -> std::result::Result<
            tonic::Response<super::AddShardResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.WorkerService/AddShard",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("tici_internal.WorkerService", "AddShard"));
            self.inner.unary(req, path, codec).await
        }
        /// Compact a shard
        pub async fn compact_fragments(
            &mut self,
            request: impl tonic::IntoRequest<super::CompactFragRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CompactFragResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.WorkerService/CompactFragments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("tici_internal.WorkerService", "CompactFragments"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Write import data to a shard
        pub async fn import_write(
            &mut self,
            request: impl tonic::IntoRequest<super::super::import::ImportWriteRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::import::ImportWriteResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/tici_internal.WorkerService/ImportWrite",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("tici_internal.WorkerService", "ImportWrite"));
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod meta_service_internal_server {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with MetaServiceInternalServer.
    #[async_trait]
    pub trait MetaServiceInternal: Send + Sync + 'static {
        /// Maintains heartbeat from reader nodes to meta service.
        async fn reader_node_heartbeat(
            &self,
            request: tonic::Request<super::ReaderNodeHeartbeatRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ReaderNodeHeartbeatResponse>,
            tonic::Status,
        >;
        /// Server streaming response type for the WorkerNodeHeartbeat method.
        type WorkerNodeHeartbeatStream: tonic::codegen::tokio_stream::Stream<
                Item = std::result::Result<
                    super::WorkerNodeHeartbeatResponse,
                    tonic::Status,
                >,
            >
            + Send
            + 'static;
        /// Maintains heartbeat from worker nodes(such as writers, compactors) to meta
        /// service.
        async fn worker_node_heartbeat(
            &self,
            request: tonic::Request<super::WorkerNodeHeartbeatRequest>,
        ) -> std::result::Result<
            tonic::Response<Self::WorkerNodeHeartbeatStream>,
            tonic::Status,
        >;
        async fn finish_compact_fragments(
            &self,
            request: tonic::Request<super::FinishCompactFragRequest>,
        ) -> std::result::Result<
            tonic::Response<super::FinishCompactFragResponse>,
            tonic::Status,
        >;
        async fn append_delta_frag_meta(
            &self,
            request: tonic::Request<super::AppendDeltaFragMetaRequest>,
        ) -> std::result::Result<
            tonic::Response<super::AppendFragMetaResponse>,
            tonic::Status,
        >;
        /// TODO: this method should be replace by `FinishPartitionBuild`
        /// / Append base fragment metadata, used for baseline shards
        /// / MetaService is responsible for
        /// / 1. Find the overlapped Shards for the given table_id, index_id and
        /// / key_range
        /// / 2. Append the frags to all the overlapped shards' baseline frags
        async fn append_base_frag_meta(
            &self,
            request: tonic::Request<super::AppendBaseFragMetaRequest>,
        ) -> std::result::Result<
            tonic::Response<super::AppendFragMetaResponse>,
            tonic::Status,
        >;
        /// Debug usage: get shard manifest from meta service writer
        async fn debug_get_shard_manifest(
            &self,
            request: tonic::Request<super::DebugGetShardManifestRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DebugGetShardManifestResponse>,
            tonic::Status,
        >;
        /// Get shard manifest from shard cache manager
        async fn get_shard_manifest(
            &self,
            request: tonic::Request<super::GetShardManifestRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetShardManifestResponse>,
            tonic::Status,
        >;
        /// Called by TiCI worker to notify Meta Service after a partition for
        /// the given index is built.
        async fn finish_import_partition_build(
            &self,
            request: tonic::Request<super::FinishImportPartitionBuildRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::tici::FinishImportResponse>,
            tonic::Status,
        >;
        async fn debug_get_shard_info(
            &self,
            request: tonic::Request<super::DebugGetShardInfoRequest>,
        ) -> std::result::Result<
            tonic::Response<super::DebugGetShardInfoResponse>,
            tonic::Status,
        >;
        /// GetIndexMeta returns TableInfo and IndexInfo for the given keyspace_id,
        /// table_id and index_id.
        async fn get_index_meta(
            &self,
            request: tonic::Request<super::GetIndexMetaRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetIndexMetaResponse>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct MetaServiceInternalServer<T: MetaServiceInternal> {
        inner: _Inner<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    struct _Inner<T>(Arc<T>);
    impl<T: MetaServiceInternal> MetaServiceInternalServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            let inner = _Inner(inner);
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for MetaServiceInternalServer<T>
    where
        T: MetaServiceInternal,
        B: Body + Send + 'static,
        B::Error: Into<StdError> + Send + 'static,
    {
        type Response = http::Response<tonic::body::BoxBody>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            let inner = self.inner.clone();
            match req.uri().path() {
                "/tici_internal.MetaServiceInternal/ReaderNodeHeartbeat" => {
                    #[allow(non_camel_case_types)]
                    struct ReaderNodeHeartbeatSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<super::ReaderNodeHeartbeatRequest>
                    for ReaderNodeHeartbeatSvc<T> {
                        type Response = super::ReaderNodeHeartbeatResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::ReaderNodeHeartbeatRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::reader_node_heartbeat(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = ReaderNodeHeartbeatSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/WorkerNodeHeartbeat" => {
                    #[allow(non_camel_case_types)]
                    struct WorkerNodeHeartbeatSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::ServerStreamingService<
                        super::WorkerNodeHeartbeatRequest,
                    > for WorkerNodeHeartbeatSvc<T> {
                        type Response = super::WorkerNodeHeartbeatResponse;
                        type ResponseStream = T::WorkerNodeHeartbeatStream;
                        type Future = BoxFuture<
                            tonic::Response<Self::ResponseStream>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::WorkerNodeHeartbeatRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::worker_node_heartbeat(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = WorkerNodeHeartbeatSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.server_streaming(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/FinishCompactFragments" => {
                    #[allow(non_camel_case_types)]
                    struct FinishCompactFragmentsSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<super::FinishCompactFragRequest>
                    for FinishCompactFragmentsSvc<T> {
                        type Response = super::FinishCompactFragResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::FinishCompactFragRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::finish_compact_fragments(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = FinishCompactFragmentsSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/AppendDeltaFragMeta" => {
                    #[allow(non_camel_case_types)]
                    struct AppendDeltaFragMetaSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<super::AppendDeltaFragMetaRequest>
                    for AppendDeltaFragMetaSvc<T> {
                        type Response = super::AppendFragMetaResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::AppendDeltaFragMetaRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::append_delta_frag_meta(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = AppendDeltaFragMetaSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/AppendBaseFragMeta" => {
                    #[allow(non_camel_case_types)]
                    struct AppendBaseFragMetaSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<super::AppendBaseFragMetaRequest>
                    for AppendBaseFragMetaSvc<T> {
                        type Response = super::AppendFragMetaResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::AppendBaseFragMetaRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::append_base_frag_meta(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = AppendBaseFragMetaSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/DebugGetShardManifest" => {
                    #[allow(non_camel_case_types)]
                    struct DebugGetShardManifestSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<super::DebugGetShardManifestRequest>
                    for DebugGetShardManifestSvc<T> {
                        type Response = super::DebugGetShardManifestResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DebugGetShardManifestRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::debug_get_shard_manifest(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = DebugGetShardManifestSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/GetShardManifest" => {
                    #[allow(non_camel_case_types)]
                    struct GetShardManifestSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<super::GetShardManifestRequest>
                    for GetShardManifestSvc<T> {
                        type Response = super::GetShardManifestResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::GetShardManifestRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::get_shard_manifest(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = GetShardManifestSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/FinishImportPartitionBuild" => {
                    #[allow(non_camel_case_types)]
                    struct FinishImportPartitionBuildSvc<T: MetaServiceInternal>(
                        pub Arc<T>,
                    );
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<
                        super::FinishImportPartitionBuildRequest,
                    > for FinishImportPartitionBuildSvc<T> {
                        type Response = super::super::tici::FinishImportResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::FinishImportPartitionBuildRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::finish_import_partition_build(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = FinishImportPartitionBuildSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/DebugGetShardInfo" => {
                    #[allow(non_camel_case_types)]
                    struct DebugGetShardInfoSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<super::DebugGetShardInfoRequest>
                    for DebugGetShardInfoSvc<T> {
                        type Response = super::DebugGetShardInfoResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::DebugGetShardInfoRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::debug_get_shard_info(
                                        &inner,
                                        request,
                                    )
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = DebugGetShardInfoSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.MetaServiceInternal/GetIndexMeta" => {
                    #[allow(non_camel_case_types)]
                    struct GetIndexMetaSvc<T: MetaServiceInternal>(pub Arc<T>);
                    impl<
                        T: MetaServiceInternal,
                    > tonic::server::UnaryService<super::GetIndexMetaRequest>
                    for GetIndexMetaSvc<T> {
                        type Response = super::GetIndexMetaResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::GetIndexMetaRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as MetaServiceInternal>::get_index_meta(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = GetIndexMetaSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        Ok(
                            http::Response::builder()
                                .status(200)
                                .header("grpc-status", "12")
                                .header("content-type", "application/grpc")
                                .body(empty_body())
                                .unwrap(),
                        )
                    })
                }
            }
        }
    }
    impl<T: MetaServiceInternal> Clone for MetaServiceInternalServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    impl<T: MetaServiceInternal> Clone for _Inner<T> {
        fn clone(&self) -> Self {
            Self(Arc::clone(&self.0))
        }
    }
    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
            write!(f, "{:?}", self.0)
        }
    }
    impl<T: MetaServiceInternal> tonic::server::NamedService
    for MetaServiceInternalServer<T> {
        const NAME: &'static str = "tici_internal.MetaServiceInternal";
    }
}
/// Generated server implementations.
pub mod worker_service_server {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with WorkerServiceServer.
    #[async_trait]
    pub trait WorkerService: Send + Sync + 'static {
        /// Add shard for an index
        async fn add_shard(
            &self,
            request: tonic::Request<super::AddShardRequest>,
        ) -> std::result::Result<
            tonic::Response<super::AddShardResponse>,
            tonic::Status,
        >;
        /// Compact a shard
        async fn compact_fragments(
            &self,
            request: tonic::Request<super::CompactFragRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CompactFragResponse>,
            tonic::Status,
        >;
        /// Write import data to a shard
        async fn import_write(
            &self,
            request: tonic::Request<super::super::import::ImportWriteRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::import::ImportWriteResponse>,
            tonic::Status,
        >;
    }
    /// WorkerService provides index creation and deletion functionality
    #[derive(Debug)]
    pub struct WorkerServiceServer<T: WorkerService> {
        inner: _Inner<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    struct _Inner<T>(Arc<T>);
    impl<T: WorkerService> WorkerServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            let inner = _Inner(inner);
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for WorkerServiceServer<T>
    where
        T: WorkerService,
        B: Body + Send + 'static,
        B::Error: Into<StdError> + Send + 'static,
    {
        type Response = http::Response<tonic::body::BoxBody>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            let inner = self.inner.clone();
            match req.uri().path() {
                "/tici_internal.WorkerService/AddShard" => {
                    #[allow(non_camel_case_types)]
                    struct AddShardSvc<T: WorkerService>(pub Arc<T>);
                    impl<
                        T: WorkerService,
                    > tonic::server::UnaryService<super::AddShardRequest>
                    for AddShardSvc<T> {
                        type Response = super::AddShardResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::AddShardRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as WorkerService>::add_shard(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = AddShardSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.WorkerService/CompactFragments" => {
                    #[allow(non_camel_case_types)]
                    struct CompactFragmentsSvc<T: WorkerService>(pub Arc<T>);
                    impl<
                        T: WorkerService,
                    > tonic::server::UnaryService<super::CompactFragRequest>
                    for CompactFragmentsSvc<T> {
                        type Response = super::CompactFragResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::CompactFragRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as WorkerService>::compact_fragments(&inner, request)
                                    .await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = CompactFragmentsSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/tici_internal.WorkerService/ImportWrite" => {
                    #[allow(non_camel_case_types)]
                    struct ImportWriteSvc<T: WorkerService>(pub Arc<T>);
                    impl<
                        T: WorkerService,
                    > tonic::server::UnaryService<
                        super::super::import::ImportWriteRequest,
                    > for ImportWriteSvc<T> {
                        type Response = super::super::import::ImportWriteResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<
                                super::super::import::ImportWriteRequest,
                            >,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as WorkerService>::import_write(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let inner = inner.0;
                        let method = ImportWriteSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        Ok(
                            http::Response::builder()
                                .status(200)
                                .header("grpc-status", "12")
                                .header("content-type", "application/grpc")
                                .body(empty_body())
                                .unwrap(),
                        )
                    })
                }
            }
        }
    }
    impl<T: WorkerService> Clone for WorkerServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    impl<T: WorkerService> Clone for _Inner<T> {
        fn clone(&self) -> Self {
            Self(Arc::clone(&self.0))
        }
    }
    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
            write!(f, "{:?}", self.0)
        }
    }
    impl<T: WorkerService> tonic::server::NamedService for WorkerServiceServer<T> {
        const NAME: &'static str = "tici_internal.WorkerService";
    }
}
