risingwave_pb/
frontend_service.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct GetTableReplacePlanRequest {
5    #[prost(uint32, tag = "1", wrapper = "crate::id::DatabaseId")]
6    pub database_id: crate::id::DatabaseId,
7    #[prost(uint32, tag = "2", wrapper = "crate::id::TableId")]
8    pub table_id: crate::id::TableId,
9    #[prost(message, optional, tag = "3")]
10    pub cdc_table_change: ::core::option::Option<super::ddl_service::TableSchemaChange>,
11}
12#[derive(prost_helpers::AnyPB)]
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct GetTableReplacePlanResponse {
15    #[prost(message, optional, tag = "1")]
16    pub replace_plan: ::core::option::Option<super::ddl_service::ReplaceJobPlan>,
17}
18#[derive(prost_helpers::AnyPB)]
19#[derive(Clone, Copy, PartialEq, ::prost::Message)]
20pub struct GetRunningSqlsRequest {}
21#[derive(prost_helpers::AnyPB)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct GetRunningSqlsResponse {
24    #[prost(message, repeated, tag = "1")]
25    pub running_sqls: ::prost::alloc::vec::Vec<RunningSql>,
26}
27#[derive(prost_helpers::AnyPB)]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct RunningSql {
30    #[prost(int32, tag = "1")]
31    pub process_id: i32,
32    #[prost(string, tag = "2")]
33    pub user_name: ::prost::alloc::string::String,
34    #[prost(string, tag = "3")]
35    pub peer_addr: ::prost::alloc::string::String,
36    #[prost(string, tag = "4")]
37    pub database: ::prost::alloc::string::String,
38    #[prost(uint64, optional, tag = "5")]
39    pub elapsed_millis: ::core::option::Option<u64>,
40    #[prost(string, optional, tag = "6")]
41    pub sql: ::core::option::Option<::prost::alloc::string::String>,
42}
43#[derive(prost_helpers::AnyPB)]
44#[derive(Clone, Copy, PartialEq, ::prost::Message)]
45pub struct GetAllCursorsRequest {}
46#[derive(prost_helpers::AnyPB)]
47#[derive(Clone, PartialEq, ::prost::Message)]
48pub struct GetAllCursorsResponse {
49    #[prost(message, repeated, tag = "1")]
50    pub all_cursors: ::prost::alloc::vec::Vec<AllCursors>,
51}
52#[derive(prost_helpers::AnyPB)]
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct AllCursors {
55    #[prost(int32, tag = "1")]
56    pub session_id: i32,
57    #[prost(string, tag = "2")]
58    pub user_name: ::prost::alloc::string::String,
59    #[prost(string, tag = "3")]
60    pub peer_addr: ::prost::alloc::string::String,
61    #[prost(string, tag = "4")]
62    pub database: ::prost::alloc::string::String,
63    #[prost(string, repeated, tag = "5")]
64    pub cursor_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
65}
66#[derive(prost_helpers::AnyPB)]
67#[derive(Clone, Copy, PartialEq, ::prost::Message)]
68pub struct GetAllSubCursorsRequest {}
69#[derive(prost_helpers::AnyPB)]
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct GetAllSubCursorsResponse {
72    #[prost(message, repeated, tag = "1")]
73    pub subscription_cursors: ::prost::alloc::vec::Vec<SubscriptionCursor>,
74}
75#[derive(prost_helpers::AnyPB)]
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct SubscriptionCursor {
78    #[prost(int32, tag = "1")]
79    pub session_id: i32,
80    #[prost(string, tag = "2")]
81    pub user_name: ::prost::alloc::string::String,
82    #[prost(string, tag = "3")]
83    pub peer_addr: ::prost::alloc::string::String,
84    #[prost(string, tag = "4")]
85    pub database: ::prost::alloc::string::String,
86    #[prost(string, repeated, tag = "5")]
87    pub states: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
88    #[prost(uint64, repeated, tag = "6")]
89    pub idle_durations: ::prost::alloc::vec::Vec<u64>,
90    #[prost(string, repeated, tag = "7")]
91    pub subscription_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
92    #[prost(string, repeated, tag = "8")]
93    pub cursor_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
94}
95#[derive(prost_helpers::AnyPB)]
96#[derive(Clone, Copy, PartialEq, ::prost::Message)]
97pub struct CancelRunningSqlRequest {
98    #[prost(int32, tag = "1")]
99    pub process_id: i32,
100}
101#[derive(prost_helpers::AnyPB)]
102#[derive(Clone, Copy, PartialEq, ::prost::Message)]
103pub struct CancelRunningSqlResponse {}
104/// Generated client implementations.
105pub mod frontend_service_client {
106    #![allow(
107        unused_variables,
108        dead_code,
109        missing_docs,
110        clippy::wildcard_imports,
111        clippy::let_unit_value,
112    )]
113    use tonic::codegen::*;
114    use tonic::codegen::http::Uri;
115    #[derive(Debug, Clone)]
116    pub struct FrontendServiceClient<T> {
117        inner: tonic::client::Grpc<T>,
118    }
119    impl FrontendServiceClient<tonic::transport::Channel> {
120        /// Attempt to create a new client by connecting to a given endpoint.
121        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
122        where
123            D: TryInto<tonic::transport::Endpoint>,
124            D::Error: Into<StdError>,
125        {
126            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
127            Ok(Self::new(conn))
128        }
129    }
130    impl<T> FrontendServiceClient<T>
131    where
132        T: tonic::client::GrpcService<tonic::body::BoxBody>,
133        T::Error: Into<StdError>,
134        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
135        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
136    {
137        pub fn new(inner: T) -> Self {
138            let inner = tonic::client::Grpc::new(inner);
139            Self { inner }
140        }
141        pub fn with_origin(inner: T, origin: Uri) -> Self {
142            let inner = tonic::client::Grpc::with_origin(inner, origin);
143            Self { inner }
144        }
145        pub fn with_interceptor<F>(
146            inner: T,
147            interceptor: F,
148        ) -> FrontendServiceClient<InterceptedService<T, F>>
149        where
150            F: tonic::service::Interceptor,
151            T::ResponseBody: Default,
152            T: tonic::codegen::Service<
153                http::Request<tonic::body::BoxBody>,
154                Response = http::Response<
155                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
156                >,
157            >,
158            <T as tonic::codegen::Service<
159                http::Request<tonic::body::BoxBody>,
160            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
161        {
162            FrontendServiceClient::new(InterceptedService::new(inner, interceptor))
163        }
164        /// Compress requests with the given encoding.
165        ///
166        /// This requires the server to support it otherwise it might respond with an
167        /// error.
168        #[must_use]
169        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
170            self.inner = self.inner.send_compressed(encoding);
171            self
172        }
173        /// Enable decompressing responses.
174        #[must_use]
175        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
176            self.inner = self.inner.accept_compressed(encoding);
177            self
178        }
179        /// Limits the maximum size of a decoded message.
180        ///
181        /// Default: `4MB`
182        #[must_use]
183        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
184            self.inner = self.inner.max_decoding_message_size(limit);
185            self
186        }
187        /// Limits the maximum size of an encoded message.
188        ///
189        /// Default: `usize::MAX`
190        #[must_use]
191        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
192            self.inner = self.inner.max_encoding_message_size(limit);
193            self
194        }
195        pub async fn get_table_replace_plan(
196            &mut self,
197            request: impl tonic::IntoRequest<super::GetTableReplacePlanRequest>,
198        ) -> std::result::Result<
199            tonic::Response<super::GetTableReplacePlanResponse>,
200            tonic::Status,
201        > {
202            self.inner
203                .ready()
204                .await
205                .map_err(|e| {
206                    tonic::Status::unknown(
207                        format!("Service was not ready: {}", e.into()),
208                    )
209                })?;
210            let codec = tonic::codec::ProstCodec::default();
211            let path = http::uri::PathAndQuery::from_static(
212                "/frontend_service.FrontendService/GetTableReplacePlan",
213            );
214            let mut req = request.into_request();
215            req.extensions_mut()
216                .insert(
217                    GrpcMethod::new(
218                        "frontend_service.FrontendService",
219                        "GetTableReplacePlan",
220                    ),
221                );
222            self.inner.unary(req, path, codec).await
223        }
224        pub async fn get_running_sqls(
225            &mut self,
226            request: impl tonic::IntoRequest<super::GetRunningSqlsRequest>,
227        ) -> std::result::Result<
228            tonic::Response<super::GetRunningSqlsResponse>,
229            tonic::Status,
230        > {
231            self.inner
232                .ready()
233                .await
234                .map_err(|e| {
235                    tonic::Status::unknown(
236                        format!("Service was not ready: {}", e.into()),
237                    )
238                })?;
239            let codec = tonic::codec::ProstCodec::default();
240            let path = http::uri::PathAndQuery::from_static(
241                "/frontend_service.FrontendService/GetRunningSqls",
242            );
243            let mut req = request.into_request();
244            req.extensions_mut()
245                .insert(
246                    GrpcMethod::new("frontend_service.FrontendService", "GetRunningSqls"),
247                );
248            self.inner.unary(req, path, codec).await
249        }
250        pub async fn get_all_cursors(
251            &mut self,
252            request: impl tonic::IntoRequest<super::GetAllCursorsRequest>,
253        ) -> std::result::Result<
254            tonic::Response<super::GetAllCursorsResponse>,
255            tonic::Status,
256        > {
257            self.inner
258                .ready()
259                .await
260                .map_err(|e| {
261                    tonic::Status::unknown(
262                        format!("Service was not ready: {}", e.into()),
263                    )
264                })?;
265            let codec = tonic::codec::ProstCodec::default();
266            let path = http::uri::PathAndQuery::from_static(
267                "/frontend_service.FrontendService/GetAllCursors",
268            );
269            let mut req = request.into_request();
270            req.extensions_mut()
271                .insert(
272                    GrpcMethod::new("frontend_service.FrontendService", "GetAllCursors"),
273                );
274            self.inner.unary(req, path, codec).await
275        }
276        pub async fn get_all_sub_cursors(
277            &mut self,
278            request: impl tonic::IntoRequest<super::GetAllSubCursorsRequest>,
279        ) -> std::result::Result<
280            tonic::Response<super::GetAllSubCursorsResponse>,
281            tonic::Status,
282        > {
283            self.inner
284                .ready()
285                .await
286                .map_err(|e| {
287                    tonic::Status::unknown(
288                        format!("Service was not ready: {}", e.into()),
289                    )
290                })?;
291            let codec = tonic::codec::ProstCodec::default();
292            let path = http::uri::PathAndQuery::from_static(
293                "/frontend_service.FrontendService/GetAllSubCursors",
294            );
295            let mut req = request.into_request();
296            req.extensions_mut()
297                .insert(
298                    GrpcMethod::new(
299                        "frontend_service.FrontendService",
300                        "GetAllSubCursors",
301                    ),
302                );
303            self.inner.unary(req, path, codec).await
304        }
305        pub async fn cancel_running_sql(
306            &mut self,
307            request: impl tonic::IntoRequest<super::CancelRunningSqlRequest>,
308        ) -> std::result::Result<
309            tonic::Response<super::CancelRunningSqlResponse>,
310            tonic::Status,
311        > {
312            self.inner
313                .ready()
314                .await
315                .map_err(|e| {
316                    tonic::Status::unknown(
317                        format!("Service was not ready: {}", e.into()),
318                    )
319                })?;
320            let codec = tonic::codec::ProstCodec::default();
321            let path = http::uri::PathAndQuery::from_static(
322                "/frontend_service.FrontendService/CancelRunningSql",
323            );
324            let mut req = request.into_request();
325            req.extensions_mut()
326                .insert(
327                    GrpcMethod::new(
328                        "frontend_service.FrontendService",
329                        "CancelRunningSql",
330                    ),
331                );
332            self.inner.unary(req, path, codec).await
333        }
334    }
335}
336/// Generated server implementations.
337pub mod frontend_service_server {
338    #![allow(
339        unused_variables,
340        dead_code,
341        missing_docs,
342        clippy::wildcard_imports,
343        clippy::let_unit_value,
344    )]
345    use tonic::codegen::*;
346    /// Generated trait containing gRPC methods that should be implemented for use with FrontendServiceServer.
347    #[async_trait]
348    pub trait FrontendService: std::marker::Send + std::marker::Sync + 'static {
349        async fn get_table_replace_plan(
350            &self,
351            request: tonic::Request<super::GetTableReplacePlanRequest>,
352        ) -> std::result::Result<
353            tonic::Response<super::GetTableReplacePlanResponse>,
354            tonic::Status,
355        >;
356        async fn get_running_sqls(
357            &self,
358            request: tonic::Request<super::GetRunningSqlsRequest>,
359        ) -> std::result::Result<
360            tonic::Response<super::GetRunningSqlsResponse>,
361            tonic::Status,
362        >;
363        async fn get_all_cursors(
364            &self,
365            request: tonic::Request<super::GetAllCursorsRequest>,
366        ) -> std::result::Result<
367            tonic::Response<super::GetAllCursorsResponse>,
368            tonic::Status,
369        >;
370        async fn get_all_sub_cursors(
371            &self,
372            request: tonic::Request<super::GetAllSubCursorsRequest>,
373        ) -> std::result::Result<
374            tonic::Response<super::GetAllSubCursorsResponse>,
375            tonic::Status,
376        >;
377        async fn cancel_running_sql(
378            &self,
379            request: tonic::Request<super::CancelRunningSqlRequest>,
380        ) -> std::result::Result<
381            tonic::Response<super::CancelRunningSqlResponse>,
382            tonic::Status,
383        >;
384    }
385    #[derive(Debug)]
386    pub struct FrontendServiceServer<T> {
387        inner: Arc<T>,
388        accept_compression_encodings: EnabledCompressionEncodings,
389        send_compression_encodings: EnabledCompressionEncodings,
390        max_decoding_message_size: Option<usize>,
391        max_encoding_message_size: Option<usize>,
392    }
393    impl<T> FrontendServiceServer<T> {
394        pub fn new(inner: T) -> Self {
395            Self::from_arc(Arc::new(inner))
396        }
397        pub fn from_arc(inner: Arc<T>) -> Self {
398            Self {
399                inner,
400                accept_compression_encodings: Default::default(),
401                send_compression_encodings: Default::default(),
402                max_decoding_message_size: None,
403                max_encoding_message_size: None,
404            }
405        }
406        pub fn with_interceptor<F>(
407            inner: T,
408            interceptor: F,
409        ) -> InterceptedService<Self, F>
410        where
411            F: tonic::service::Interceptor,
412        {
413            InterceptedService::new(Self::new(inner), interceptor)
414        }
415        /// Enable decompressing requests with the given encoding.
416        #[must_use]
417        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
418            self.accept_compression_encodings.enable(encoding);
419            self
420        }
421        /// Compress responses with the given encoding, if the client supports it.
422        #[must_use]
423        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
424            self.send_compression_encodings.enable(encoding);
425            self
426        }
427        /// Limits the maximum size of a decoded message.
428        ///
429        /// Default: `4MB`
430        #[must_use]
431        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
432            self.max_decoding_message_size = Some(limit);
433            self
434        }
435        /// Limits the maximum size of an encoded message.
436        ///
437        /// Default: `usize::MAX`
438        #[must_use]
439        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
440            self.max_encoding_message_size = Some(limit);
441            self
442        }
443    }
444    impl<T, B> tonic::codegen::Service<http::Request<B>> for FrontendServiceServer<T>
445    where
446        T: FrontendService,
447        B: Body + std::marker::Send + 'static,
448        B::Error: Into<StdError> + std::marker::Send + 'static,
449    {
450        type Response = http::Response<tonic::body::BoxBody>;
451        type Error = std::convert::Infallible;
452        type Future = BoxFuture<Self::Response, Self::Error>;
453        fn poll_ready(
454            &mut self,
455            _cx: &mut Context<'_>,
456        ) -> Poll<std::result::Result<(), Self::Error>> {
457            Poll::Ready(Ok(()))
458        }
459        fn call(&mut self, req: http::Request<B>) -> Self::Future {
460            match req.uri().path() {
461                "/frontend_service.FrontendService/GetTableReplacePlan" => {
462                    #[allow(non_camel_case_types)]
463                    struct GetTableReplacePlanSvc<T: FrontendService>(pub Arc<T>);
464                    impl<
465                        T: FrontendService,
466                    > tonic::server::UnaryService<super::GetTableReplacePlanRequest>
467                    for GetTableReplacePlanSvc<T> {
468                        type Response = super::GetTableReplacePlanResponse;
469                        type Future = BoxFuture<
470                            tonic::Response<Self::Response>,
471                            tonic::Status,
472                        >;
473                        fn call(
474                            &mut self,
475                            request: tonic::Request<super::GetTableReplacePlanRequest>,
476                        ) -> Self::Future {
477                            let inner = Arc::clone(&self.0);
478                            let fut = async move {
479                                <T as FrontendService>::get_table_replace_plan(
480                                        &inner,
481                                        request,
482                                    )
483                                    .await
484                            };
485                            Box::pin(fut)
486                        }
487                    }
488                    let accept_compression_encodings = self.accept_compression_encodings;
489                    let send_compression_encodings = self.send_compression_encodings;
490                    let max_decoding_message_size = self.max_decoding_message_size;
491                    let max_encoding_message_size = self.max_encoding_message_size;
492                    let inner = self.inner.clone();
493                    let fut = async move {
494                        let method = GetTableReplacePlanSvc(inner);
495                        let codec = tonic::codec::ProstCodec::default();
496                        let mut grpc = tonic::server::Grpc::new(codec)
497                            .apply_compression_config(
498                                accept_compression_encodings,
499                                send_compression_encodings,
500                            )
501                            .apply_max_message_size_config(
502                                max_decoding_message_size,
503                                max_encoding_message_size,
504                            );
505                        let res = grpc.unary(method, req).await;
506                        Ok(res)
507                    };
508                    Box::pin(fut)
509                }
510                "/frontend_service.FrontendService/GetRunningSqls" => {
511                    #[allow(non_camel_case_types)]
512                    struct GetRunningSqlsSvc<T: FrontendService>(pub Arc<T>);
513                    impl<
514                        T: FrontendService,
515                    > tonic::server::UnaryService<super::GetRunningSqlsRequest>
516                    for GetRunningSqlsSvc<T> {
517                        type Response = super::GetRunningSqlsResponse;
518                        type Future = BoxFuture<
519                            tonic::Response<Self::Response>,
520                            tonic::Status,
521                        >;
522                        fn call(
523                            &mut self,
524                            request: tonic::Request<super::GetRunningSqlsRequest>,
525                        ) -> Self::Future {
526                            let inner = Arc::clone(&self.0);
527                            let fut = async move {
528                                <T as FrontendService>::get_running_sqls(&inner, request)
529                                    .await
530                            };
531                            Box::pin(fut)
532                        }
533                    }
534                    let accept_compression_encodings = self.accept_compression_encodings;
535                    let send_compression_encodings = self.send_compression_encodings;
536                    let max_decoding_message_size = self.max_decoding_message_size;
537                    let max_encoding_message_size = self.max_encoding_message_size;
538                    let inner = self.inner.clone();
539                    let fut = async move {
540                        let method = GetRunningSqlsSvc(inner);
541                        let codec = tonic::codec::ProstCodec::default();
542                        let mut grpc = tonic::server::Grpc::new(codec)
543                            .apply_compression_config(
544                                accept_compression_encodings,
545                                send_compression_encodings,
546                            )
547                            .apply_max_message_size_config(
548                                max_decoding_message_size,
549                                max_encoding_message_size,
550                            );
551                        let res = grpc.unary(method, req).await;
552                        Ok(res)
553                    };
554                    Box::pin(fut)
555                }
556                "/frontend_service.FrontendService/GetAllCursors" => {
557                    #[allow(non_camel_case_types)]
558                    struct GetAllCursorsSvc<T: FrontendService>(pub Arc<T>);
559                    impl<
560                        T: FrontendService,
561                    > tonic::server::UnaryService<super::GetAllCursorsRequest>
562                    for GetAllCursorsSvc<T> {
563                        type Response = super::GetAllCursorsResponse;
564                        type Future = BoxFuture<
565                            tonic::Response<Self::Response>,
566                            tonic::Status,
567                        >;
568                        fn call(
569                            &mut self,
570                            request: tonic::Request<super::GetAllCursorsRequest>,
571                        ) -> Self::Future {
572                            let inner = Arc::clone(&self.0);
573                            let fut = async move {
574                                <T as FrontendService>::get_all_cursors(&inner, request)
575                                    .await
576                            };
577                            Box::pin(fut)
578                        }
579                    }
580                    let accept_compression_encodings = self.accept_compression_encodings;
581                    let send_compression_encodings = self.send_compression_encodings;
582                    let max_decoding_message_size = self.max_decoding_message_size;
583                    let max_encoding_message_size = self.max_encoding_message_size;
584                    let inner = self.inner.clone();
585                    let fut = async move {
586                        let method = GetAllCursorsSvc(inner);
587                        let codec = tonic::codec::ProstCodec::default();
588                        let mut grpc = tonic::server::Grpc::new(codec)
589                            .apply_compression_config(
590                                accept_compression_encodings,
591                                send_compression_encodings,
592                            )
593                            .apply_max_message_size_config(
594                                max_decoding_message_size,
595                                max_encoding_message_size,
596                            );
597                        let res = grpc.unary(method, req).await;
598                        Ok(res)
599                    };
600                    Box::pin(fut)
601                }
602                "/frontend_service.FrontendService/GetAllSubCursors" => {
603                    #[allow(non_camel_case_types)]
604                    struct GetAllSubCursorsSvc<T: FrontendService>(pub Arc<T>);
605                    impl<
606                        T: FrontendService,
607                    > tonic::server::UnaryService<super::GetAllSubCursorsRequest>
608                    for GetAllSubCursorsSvc<T> {
609                        type Response = super::GetAllSubCursorsResponse;
610                        type Future = BoxFuture<
611                            tonic::Response<Self::Response>,
612                            tonic::Status,
613                        >;
614                        fn call(
615                            &mut self,
616                            request: tonic::Request<super::GetAllSubCursorsRequest>,
617                        ) -> Self::Future {
618                            let inner = Arc::clone(&self.0);
619                            let fut = async move {
620                                <T as FrontendService>::get_all_sub_cursors(&inner, request)
621                                    .await
622                            };
623                            Box::pin(fut)
624                        }
625                    }
626                    let accept_compression_encodings = self.accept_compression_encodings;
627                    let send_compression_encodings = self.send_compression_encodings;
628                    let max_decoding_message_size = self.max_decoding_message_size;
629                    let max_encoding_message_size = self.max_encoding_message_size;
630                    let inner = self.inner.clone();
631                    let fut = async move {
632                        let method = GetAllSubCursorsSvc(inner);
633                        let codec = tonic::codec::ProstCodec::default();
634                        let mut grpc = tonic::server::Grpc::new(codec)
635                            .apply_compression_config(
636                                accept_compression_encodings,
637                                send_compression_encodings,
638                            )
639                            .apply_max_message_size_config(
640                                max_decoding_message_size,
641                                max_encoding_message_size,
642                            );
643                        let res = grpc.unary(method, req).await;
644                        Ok(res)
645                    };
646                    Box::pin(fut)
647                }
648                "/frontend_service.FrontendService/CancelRunningSql" => {
649                    #[allow(non_camel_case_types)]
650                    struct CancelRunningSqlSvc<T: FrontendService>(pub Arc<T>);
651                    impl<
652                        T: FrontendService,
653                    > tonic::server::UnaryService<super::CancelRunningSqlRequest>
654                    for CancelRunningSqlSvc<T> {
655                        type Response = super::CancelRunningSqlResponse;
656                        type Future = BoxFuture<
657                            tonic::Response<Self::Response>,
658                            tonic::Status,
659                        >;
660                        fn call(
661                            &mut self,
662                            request: tonic::Request<super::CancelRunningSqlRequest>,
663                        ) -> Self::Future {
664                            let inner = Arc::clone(&self.0);
665                            let fut = async move {
666                                <T as FrontendService>::cancel_running_sql(&inner, request)
667                                    .await
668                            };
669                            Box::pin(fut)
670                        }
671                    }
672                    let accept_compression_encodings = self.accept_compression_encodings;
673                    let send_compression_encodings = self.send_compression_encodings;
674                    let max_decoding_message_size = self.max_decoding_message_size;
675                    let max_encoding_message_size = self.max_encoding_message_size;
676                    let inner = self.inner.clone();
677                    let fut = async move {
678                        let method = CancelRunningSqlSvc(inner);
679                        let codec = tonic::codec::ProstCodec::default();
680                        let mut grpc = tonic::server::Grpc::new(codec)
681                            .apply_compression_config(
682                                accept_compression_encodings,
683                                send_compression_encodings,
684                            )
685                            .apply_max_message_size_config(
686                                max_decoding_message_size,
687                                max_encoding_message_size,
688                            );
689                        let res = grpc.unary(method, req).await;
690                        Ok(res)
691                    };
692                    Box::pin(fut)
693                }
694                _ => {
695                    Box::pin(async move {
696                        let mut response = http::Response::new(empty_body());
697                        let headers = response.headers_mut();
698                        headers
699                            .insert(
700                                tonic::Status::GRPC_STATUS,
701                                (tonic::Code::Unimplemented as i32).into(),
702                            );
703                        headers
704                            .insert(
705                                http::header::CONTENT_TYPE,
706                                tonic::metadata::GRPC_CONTENT_TYPE,
707                            );
708                        Ok(response)
709                    })
710                }
711            }
712        }
713    }
714    impl<T> Clone for FrontendServiceServer<T> {
715        fn clone(&self) -> Self {
716            let inner = self.inner.clone();
717            Self {
718                inner,
719                accept_compression_encodings: self.accept_compression_encodings,
720                send_compression_encodings: self.send_compression_encodings,
721                max_decoding_message_size: self.max_decoding_message_size,
722                max_encoding_message_size: self.max_encoding_message_size,
723            }
724        }
725    }
726    /// Generated gRPC service name
727    pub const SERVICE_NAME: &str = "frontend_service.FrontendService";
728    impl<T> tonic::server::NamedService for FrontendServiceServer<T> {
729        const NAME: &'static str = SERVICE_NAME;
730    }
731}