#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StackTraceRequest {}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StackTraceResponse {
#[prost(btree_map = "uint32, string", tag = "1")]
pub actor_traces: ::prost::alloc::collections::BTreeMap<
u32,
::prost::alloc::string::String,
>,
#[prost(btree_map = "string, string", tag = "2")]
pub rpc_traces: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(btree_map = "string, string", tag = "3")]
pub compaction_task_traces: ::prost::alloc::collections::BTreeMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(btree_map = "uint64, string", tag = "4")]
pub inflight_barrier_traces: ::prost::alloc::collections::BTreeMap<
u64,
::prost::alloc::string::String,
>,
#[prost(btree_map = "uint32, string", tag = "5")]
pub barrier_worker_state: ::prost::alloc::collections::BTreeMap<
u32,
::prost::alloc::string::String,
>,
#[prost(btree_map = "uint32, string", tag = "6")]
pub jvm_stack_traces: ::prost::alloc::collections::BTreeMap<
u32,
::prost::alloc::string::String,
>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ProfilingRequest {
#[prost(uint64, tag = "1")]
pub sleep_s: u64,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProfilingResponse {
#[prost(bytes = "vec", tag = "1")]
pub result: ::prost::alloc::vec::Vec<u8>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HeapProfilingRequest {
#[prost(string, tag = "1")]
pub dir: ::prost::alloc::string::String,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HeapProfilingResponse {}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ListHeapProfilingRequest {}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHeapProfilingResponse {
#[prost(string, tag = "1")]
pub dir: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "2")]
pub name_manually: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "3")]
pub name_auto: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnalyzeHeapRequest {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnalyzeHeapResponse {
#[prost(bytes = "vec", tag = "1")]
pub result: ::prost::alloc::vec::Vec<u8>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetBackPressureRequest {}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BackPressureInfo {
#[prost(uint32, tag = "1")]
pub fragment_id: u32,
#[prost(uint32, tag = "2")]
pub downstream_fragment_id: u32,
#[prost(uint32, tag = "3")]
pub actor_count: u32,
#[prost(double, tag = "4")]
pub value: f64,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBackPressureResponse {
#[prost(message, repeated, tag = "1")]
pub back_pressure_infos: ::prost::alloc::vec::Vec<BackPressureInfo>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TieredCacheTracingRequest {
#[prost(bool, tag = "1")]
pub enable: bool,
#[prost(uint32, optional, tag = "2")]
pub record_hybrid_insert_threshold_ms: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "3")]
pub record_hybrid_get_threshold_ms: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "4")]
pub record_hybrid_obtain_threshold_ms: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "5")]
pub record_hybrid_remove_threshold_ms: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "6")]
pub record_hybrid_fetch_threshold_ms: ::core::option::Option<u32>,
}
#[derive(prost_helpers::AnyPB)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TieredCacheTracingResponse {}
pub mod monitor_service_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 MonitorServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl MonitorServiceClient<tonic::transport::Channel> {
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> MonitorServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
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,
) -> MonitorServiceClient<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> + std::marker::Send + std::marker::Sync,
{
MonitorServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn stack_trace(
&mut self,
request: impl tonic::IntoRequest<super::StackTraceRequest>,
) -> std::result::Result<
tonic::Response<super::StackTraceResponse>,
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(
"/monitor_service.MonitorService/StackTrace",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("monitor_service.MonitorService", "StackTrace"));
self.inner.unary(req, path, codec).await
}
pub async fn profiling(
&mut self,
request: impl tonic::IntoRequest<super::ProfilingRequest>,
) -> std::result::Result<
tonic::Response<super::ProfilingResponse>,
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(
"/monitor_service.MonitorService/Profiling",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("monitor_service.MonitorService", "Profiling"));
self.inner.unary(req, path, codec).await
}
pub async fn heap_profiling(
&mut self,
request: impl tonic::IntoRequest<super::HeapProfilingRequest>,
) -> std::result::Result<
tonic::Response<super::HeapProfilingResponse>,
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(
"/monitor_service.MonitorService/HeapProfiling",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("monitor_service.MonitorService", "HeapProfiling"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_heap_profiling(
&mut self,
request: impl tonic::IntoRequest<super::ListHeapProfilingRequest>,
) -> std::result::Result<
tonic::Response<super::ListHeapProfilingResponse>,
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(
"/monitor_service.MonitorService/ListHeapProfiling",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"monitor_service.MonitorService",
"ListHeapProfiling",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn analyze_heap(
&mut self,
request: impl tonic::IntoRequest<super::AnalyzeHeapRequest>,
) -> std::result::Result<
tonic::Response<super::AnalyzeHeapResponse>,
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(
"/monitor_service.MonitorService/AnalyzeHeap",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("monitor_service.MonitorService", "AnalyzeHeap"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_back_pressure(
&mut self,
request: impl tonic::IntoRequest<super::GetBackPressureRequest>,
) -> std::result::Result<
tonic::Response<super::GetBackPressureResponse>,
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(
"/monitor_service.MonitorService/GetBackPressure",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("monitor_service.MonitorService", "GetBackPressure"),
);
self.inner.unary(req, path, codec).await
}
pub async fn tiered_cache_tracing(
&mut self,
request: impl tonic::IntoRequest<super::TieredCacheTracingRequest>,
) -> std::result::Result<
tonic::Response<super::TieredCacheTracingResponse>,
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(
"/monitor_service.MonitorService/TieredCacheTracing",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"monitor_service.MonitorService",
"TieredCacheTracing",
),
);
self.inner.unary(req, path, codec).await
}
}
}
pub mod monitor_service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait MonitorService: std::marker::Send + std::marker::Sync + 'static {
async fn stack_trace(
&self,
request: tonic::Request<super::StackTraceRequest>,
) -> std::result::Result<
tonic::Response<super::StackTraceResponse>,
tonic::Status,
>;
async fn profiling(
&self,
request: tonic::Request<super::ProfilingRequest>,
) -> std::result::Result<
tonic::Response<super::ProfilingResponse>,
tonic::Status,
>;
async fn heap_profiling(
&self,
request: tonic::Request<super::HeapProfilingRequest>,
) -> std::result::Result<
tonic::Response<super::HeapProfilingResponse>,
tonic::Status,
>;
async fn list_heap_profiling(
&self,
request: tonic::Request<super::ListHeapProfilingRequest>,
) -> std::result::Result<
tonic::Response<super::ListHeapProfilingResponse>,
tonic::Status,
>;
async fn analyze_heap(
&self,
request: tonic::Request<super::AnalyzeHeapRequest>,
) -> std::result::Result<
tonic::Response<super::AnalyzeHeapResponse>,
tonic::Status,
>;
async fn get_back_pressure(
&self,
request: tonic::Request<super::GetBackPressureRequest>,
) -> std::result::Result<
tonic::Response<super::GetBackPressureResponse>,
tonic::Status,
>;
async fn tiered_cache_tracing(
&self,
request: tonic::Request<super::TieredCacheTracingRequest>,
) -> std::result::Result<
tonic::Response<super::TieredCacheTracingResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct MonitorServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> MonitorServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
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)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[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 MonitorServiceServer<T>
where
T: MonitorService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::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 {
match req.uri().path() {
"/monitor_service.MonitorService/StackTrace" => {
#[allow(non_camel_case_types)]
struct StackTraceSvc<T: MonitorService>(pub Arc<T>);
impl<
T: MonitorService,
> tonic::server::UnaryService<super::StackTraceRequest>
for StackTraceSvc<T> {
type Response = super::StackTraceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StackTraceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MonitorService>::stack_trace(&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 method = StackTraceSvc(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)
}
"/monitor_service.MonitorService/Profiling" => {
#[allow(non_camel_case_types)]
struct ProfilingSvc<T: MonitorService>(pub Arc<T>);
impl<
T: MonitorService,
> tonic::server::UnaryService<super::ProfilingRequest>
for ProfilingSvc<T> {
type Response = super::ProfilingResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ProfilingRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MonitorService>::profiling(&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 method = ProfilingSvc(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)
}
"/monitor_service.MonitorService/HeapProfiling" => {
#[allow(non_camel_case_types)]
struct HeapProfilingSvc<T: MonitorService>(pub Arc<T>);
impl<
T: MonitorService,
> tonic::server::UnaryService<super::HeapProfilingRequest>
for HeapProfilingSvc<T> {
type Response = super::HeapProfilingResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::HeapProfilingRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MonitorService>::heap_profiling(&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 method = HeapProfilingSvc(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)
}
"/monitor_service.MonitorService/ListHeapProfiling" => {
#[allow(non_camel_case_types)]
struct ListHeapProfilingSvc<T: MonitorService>(pub Arc<T>);
impl<
T: MonitorService,
> tonic::server::UnaryService<super::ListHeapProfilingRequest>
for ListHeapProfilingSvc<T> {
type Response = super::ListHeapProfilingResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListHeapProfilingRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MonitorService>::list_heap_profiling(&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 method = ListHeapProfilingSvc(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)
}
"/monitor_service.MonitorService/AnalyzeHeap" => {
#[allow(non_camel_case_types)]
struct AnalyzeHeapSvc<T: MonitorService>(pub Arc<T>);
impl<
T: MonitorService,
> tonic::server::UnaryService<super::AnalyzeHeapRequest>
for AnalyzeHeapSvc<T> {
type Response = super::AnalyzeHeapResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AnalyzeHeapRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MonitorService>::analyze_heap(&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 method = AnalyzeHeapSvc(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)
}
"/monitor_service.MonitorService/GetBackPressure" => {
#[allow(non_camel_case_types)]
struct GetBackPressureSvc<T: MonitorService>(pub Arc<T>);
impl<
T: MonitorService,
> tonic::server::UnaryService<super::GetBackPressureRequest>
for GetBackPressureSvc<T> {
type Response = super::GetBackPressureResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetBackPressureRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MonitorService>::get_back_pressure(&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 method = GetBackPressureSvc(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)
}
"/monitor_service.MonitorService/TieredCacheTracing" => {
#[allow(non_camel_case_types)]
struct TieredCacheTracingSvc<T: MonitorService>(pub Arc<T>);
impl<
T: MonitorService,
> tonic::server::UnaryService<super::TieredCacheTracingRequest>
for TieredCacheTracingSvc<T> {
type Response = super::TieredCacheTracingResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::TieredCacheTracingRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as MonitorService>::tiered_cache_tracing(&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 method = TieredCacheTracingSvc(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", tonic::Code::Unimplemented as i32)
.header(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
)
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T> Clone for MonitorServiceServer<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,
}
}
}
pub const SERVICE_NAME: &str = "monitor_service.MonitorService";
impl<T> tonic::server::NamedService for MonitorServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}