Skip to main content

risingwave_pb/
stream_service.rs

1// This file is @generated by prost-build.
2#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct InjectBarrierRequest {
5    #[prost(string, tag = "1")]
6    pub request_id: ::prost::alloc::string::String,
7    #[prost(message, optional, tag = "2")]
8    pub barrier: ::core::option::Option<super::stream_plan::Barrier>,
9    #[prost(uint32, repeated, tag = "4", wrapper = "crate::id::ActorId")]
10    pub actor_ids_to_collect: ::prost::alloc::vec::Vec<crate::id::ActorId>,
11    #[prost(uint32, repeated, tag = "5", wrapper = "crate::id::TableId")]
12    pub table_ids_to_sync: ::prost::alloc::vec::Vec<crate::id::TableId>,
13    #[prost(uint64, tag = "6", wrapper = "crate::id::PartialGraphId")]
14    pub partial_graph_id: crate::id::PartialGraphId,
15    #[prost(message, repeated, tag = "9")]
16    pub actors_to_build: ::prost::alloc::vec::Vec<
17        inject_barrier_request::FragmentBuildActorInfo,
18    >,
19}
20/// Nested message and enum types in `InjectBarrierRequest`.
21pub mod inject_barrier_request {
22    #[derive(prost_helpers::AnyPB)]
23    #[derive(Clone, PartialEq, ::prost::Message)]
24    pub struct FragmentBuildActorInfo {
25        #[prost(uint32, tag = "1", wrapper = "crate::id::FragmentId")]
26        pub fragment_id: crate::id::FragmentId,
27        #[prost(message, optional, tag = "2")]
28        pub node: ::core::option::Option<super::super::stream_plan::StreamNode>,
29        #[prost(message, repeated, tag = "3")]
30        pub actors: ::prost::alloc::vec::Vec<BuildActorInfo>,
31    }
32    #[derive(prost_helpers::AnyPB)]
33    #[derive(Clone, PartialEq, ::prost::Message)]
34    pub struct BuildActorInfo {
35        #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
36        pub actor_id: crate::id::ActorId,
37        #[prost(map = "uint32, message", tag = "2", wrapper = "crate::id::FragmentId")]
38        pub fragment_upstreams: ::std::collections::HashMap<
39            crate::id::FragmentId,
40            build_actor_info::UpstreamActors,
41        >,
42        #[prost(message, repeated, tag = "3")]
43        pub dispatchers: ::prost::alloc::vec::Vec<super::super::stream_plan::Dispatcher>,
44        #[prost(message, optional, tag = "4")]
45        pub vnode_bitmap: ::core::option::Option<super::super::common::Buffer>,
46        #[prost(string, tag = "5")]
47        pub mview_definition: ::prost::alloc::string::String,
48        #[prost(message, optional, tag = "6")]
49        pub expr_context: ::core::option::Option<super::super::plan_common::ExprContext>,
50        #[prost(string, tag = "9")]
51        pub config_override: ::prost::alloc::string::String,
52        #[prost(uint32, repeated, tag = "7", wrapper = "crate::id::SubscriberId")]
53        pub initial_subscriber_ids: ::prost::alloc::vec::Vec<crate::id::SubscriberId>,
54    }
55    /// Nested message and enum types in `BuildActorInfo`.
56    pub mod build_actor_info {
57        #[derive(prost_helpers::AnyPB)]
58        #[derive(Clone, PartialEq, ::prost::Message)]
59        pub struct UpstreamActors {
60            #[prost(message, repeated, tag = "1")]
61            pub actors: ::prost::alloc::vec::Vec<super::super::super::common::ActorInfo>,
62        }
63    }
64}
65#[derive(prost_helpers::AnyPB)]
66#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct BarrierCompleteResponse {
68    #[prost(string, tag = "1")]
69    pub request_id: ::prost::alloc::string::String,
70    #[prost(message, optional, tag = "2")]
71    pub status: ::core::option::Option<super::common::Status>,
72    #[prost(message, repeated, tag = "3")]
73    pub create_mview_progress: ::prost::alloc::vec::Vec<
74        barrier_complete_response::CreateMviewProgress,
75    >,
76    #[prost(message, repeated, tag = "4")]
77    pub synced_sstables: ::prost::alloc::vec::Vec<
78        barrier_complete_response::LocalSstableInfo,
79    >,
80    #[prost(uint32, tag = "5", wrapper = "crate::id::WorkerId")]
81    pub worker_id: crate::id::WorkerId,
82    #[prost(map = "uint32, message", tag = "6", wrapper = "crate::id::TableId")]
83    pub table_watermarks: ::std::collections::HashMap<
84        crate::id::TableId,
85        super::hummock::TableWatermarks,
86    >,
87    #[prost(message, repeated, tag = "7")]
88    pub old_value_sstables: ::prost::alloc::vec::Vec<super::hummock::SstableInfo>,
89    #[prost(uint64, tag = "8", wrapper = "crate::id::PartialGraphId")]
90    pub partial_graph_id: crate::id::PartialGraphId,
91    /// prev_epoch of barrier
92    #[prost(uint64, tag = "9")]
93    pub epoch: u64,
94    #[prost(message, repeated, tag = "11")]
95    pub load_finished_sources: ::prost::alloc::vec::Vec<
96        barrier_complete_response::LoadFinishedSource,
97    >,
98    #[prost(map = "uint32, message", tag = "12", wrapper = "crate::id::TableId")]
99    pub vector_index_adds: ::std::collections::HashMap<
100        crate::id::TableId,
101        super::hummock::vector_index_delta::VectorIndexAdds,
102    >,
103    #[prost(message, repeated, tag = "13")]
104    pub cdc_table_backfill_progress: ::prost::alloc::vec::Vec<
105        barrier_complete_response::CdcTableBackfillProgress,
106    >,
107    #[prost(message, repeated, tag = "16")]
108    pub list_finished_sources: ::prost::alloc::vec::Vec<
109        barrier_complete_response::ListFinishedSource,
110    >,
111    #[prost(message, repeated, tag = "17")]
112    pub cdc_source_offset_updated: ::prost::alloc::vec::Vec<
113        barrier_complete_response::CdcSourceOffsetUpdated,
114    >,
115    #[prost(message, repeated, tag = "18")]
116    pub iceberg_pk_index_sink_metadata: ::prost::alloc::vec::Vec<
117        barrier_complete_response::IcebergPkIndexSinkMetadata,
118    >,
119    #[prost(message, repeated, tag = "19")]
120    pub refresh_finished_actors: ::prost::alloc::vec::Vec<
121        barrier_complete_response::RefreshFinishedActor,
122    >,
123    #[prost(message, repeated, tag = "20")]
124    pub table_change_log_progress: ::prost::alloc::vec::Vec<
125        barrier_complete_response::TableChangeLogProgress,
126    >,
127}
128/// Nested message and enum types in `BarrierCompleteResponse`.
129pub mod barrier_complete_response {
130    #[derive(prost_helpers::AnyPB)]
131    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
132    pub struct CreateMviewProgress {
133        /// Note: ideally we should use `executor_id`, but `actor_id` is ok-ish.
134        /// See <<https://github.com/risingwavelabs/risingwave/issues/6236>.>
135        #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
136        pub backfill_actor_id: crate::id::ActorId,
137        #[prost(bool, tag = "2")]
138        pub done: bool,
139        /// MV backfill snapshot read epoch (0 for Done / Source backfill)
140        #[prost(uint64, tag = "3")]
141        pub consumed_epoch: u64,
142        /// MV backfill snapshot read rows / Source backfilled rows
143        #[prost(uint64, tag = "4")]
144        pub consumed_rows: u64,
145        /// Buffered rows that are yet to be consumed (used by locality backfill to report precise progress)
146        #[prost(uint64, tag = "6")]
147        pub buffered_rows: u64,
148        #[prost(uint32, tag = "7", wrapper = "crate::id::FragmentId")]
149        pub fragment_id: crate::id::FragmentId,
150    }
151    #[derive(prost_helpers::AnyPB)]
152    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
153    pub struct CdcTableBackfillProgress {
154        #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
155        pub actor_id: crate::id::ActorId,
156        #[prost(uint64, tag = "2")]
157        pub epoch: u64,
158        #[prost(bool, tag = "3")]
159        pub done: bool,
160        #[prost(int64, tag = "4")]
161        pub split_id_start_inclusive: i64,
162        #[prost(int64, tag = "5")]
163        pub split_id_end_inclusive: i64,
164        #[prost(uint64, tag = "6")]
165        pub generation: u64,
166        #[prost(uint32, tag = "7", wrapper = "crate::id::FragmentId")]
167        pub fragment_id: crate::id::FragmentId,
168    }
169    #[derive(prost_helpers::AnyPB)]
170    #[derive(Clone, PartialEq, ::prost::Message)]
171    pub struct LocalSstableInfo {
172        #[prost(message, optional, tag = "2")]
173        pub sst: ::core::option::Option<super::super::hummock::SstableInfo>,
174        #[prost(map = "uint32, message", tag = "3", wrapper = "crate::id::TableId")]
175        pub table_stats_map: ::std::collections::HashMap<
176            crate::id::TableId,
177            super::super::hummock::TableStats,
178        >,
179        #[prost(uint64, tag = "4")]
180        pub created_at: u64,
181    }
182    /// Used for refreshable batch source.
183    /// SourceExecutor reports the source load is finished, and then
184    /// meta will issue a LoadFinish barrier to notify MaterializeExecutor to start diff calculation.
185    #[derive(prost_helpers::AnyPB)]
186    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
187    pub struct LoadFinishedSource {
188        /// The actor that reported the completion event.
189        #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
190        pub reporter_actor_id: crate::id::ActorId,
191        /// The table ID for the refreshable batch source.
192        #[prost(uint32, tag = "2", wrapper = "crate::id::TableId")]
193        pub table_id: crate::id::TableId,
194        /// The source identifier associated with the finished load.
195        #[prost(uint32, tag = "3", wrapper = "crate::id::SourceId")]
196        pub associated_source_id: crate::id::SourceId,
197    }
198    /// SourceExecutor reports the source list is finished, and then
199    /// meta will issue a ListFinish barrier to notify the source to start loading.
200    #[derive(prost_helpers::AnyPB)]
201    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
202    pub struct ListFinishedSource {
203        /// The actor that reported the completion event.
204        #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
205        pub reporter_actor_id: crate::id::ActorId,
206        /// The table ID for the refreshable batch source.
207        #[prost(uint32, tag = "2", wrapper = "crate::id::TableId")]
208        pub table_id: crate::id::TableId,
209        /// The source identifier associated with the completed listing.
210        #[prost(uint32, tag = "3", wrapper = "crate::id::SourceId")]
211        pub associated_source_id: crate::id::SourceId,
212    }
213    /// SourceExecutor reports that CDC source has updated offset at least once.
214    /// Meta will mark the CDC source as created only after receiving this notification.
215    #[derive(prost_helpers::AnyPB)]
216    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
217    pub struct CdcSourceOffsetUpdated {
218        /// The actor that reported the offset update.
219        #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
220        pub reporter_actor_id: crate::id::ActorId,
221        /// The source identifier for the CDC source.
222        #[prost(uint32, tag = "2", wrapper = "crate::id::SourceId")]
223        pub source_id: crate::id::SourceId,
224    }
225    #[derive(prost_helpers::AnyPB)]
226    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
227    pub struct IcebergPkIndexSinkMetadata {
228        #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
229        pub reporter_actor_id: crate::id::ActorId,
230        #[prost(uint32, tag = "2", wrapper = "crate::id::SinkId")]
231        pub sink_id: crate::id::SinkId,
232        #[prost(uint64, tag = "3")]
233        pub prev_epoch: u64,
234        #[prost(enumeration = "super::PbIcebergPkIndexSinkRole", tag = "4")]
235        pub role: i32,
236        #[prost(message, optional, tag = "5")]
237        pub metadata: ::core::option::Option<
238            super::super::connector_service::SinkMetadata,
239        >,
240    }
241    /// A materialize actor has finished its part of a table refresh. Once all materialize actors
242    /// of the table have reported, meta finishes the refresh cycle.
243    #[derive(prost_helpers::AnyPB)]
244    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
245    pub struct RefreshFinishedActor {
246        #[prost(uint32, tag = "1", wrapper = "crate::id::ActorId")]
247        pub reporter_actor_id: crate::id::ActorId,
248        #[prost(uint32, tag = "2", wrapper = "crate::id::TableId")]
249        pub table_id: crate::id::TableId,
250    }
251    #[derive(prost_helpers::AnyPB)]
252    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
253    pub struct TableChangeLogProgress {
254        #[prost(uint32, tag = "1", wrapper = "crate::id::FragmentId")]
255        pub fragment_id: crate::id::FragmentId,
256        #[prost(uint32, tag = "2", wrapper = "crate::id::TableId")]
257        pub upstream_table_id: crate::id::TableId,
258        #[prost(uint32, tag = "3", wrapper = "crate::id::TableId")]
259        pub progress_table_id: crate::id::TableId,
260        /// Minimum truncate epoch across the vnodes covered by this report.
261        #[prost(uint64, tag = "4")]
262        pub min_truncate_epoch: u64,
263        /// Vnodes covered by this compute node's locally aggregated progress.
264        #[prost(message, optional, tag = "5")]
265        pub vnode_bitmap: ::core::option::Option<super::super::common::Buffer>,
266    }
267}
268#[derive(prost_helpers::AnyPB)]
269#[derive(Clone, PartialEq, ::prost::Message)]
270pub struct StreamingControlStreamRequest {
271    #[prost(oneof = "streaming_control_stream_request::Request", tags = "1, 2, 3, 4, 5")]
272    pub request: ::core::option::Option<streaming_control_stream_request::Request>,
273}
274/// Nested message and enum types in `StreamingControlStreamRequest`.
275pub mod streaming_control_stream_request {
276    #[derive(prost_helpers::AnyPB)]
277    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
278    pub struct InitRequest {}
279    #[derive(prost_helpers::AnyPB)]
280    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
281    pub struct CreatePartialGraphRequest {
282        #[prost(uint64, tag = "1", wrapper = "crate::id::PartialGraphId")]
283        pub partial_graph_id: crate::id::PartialGraphId,
284        /// Identifies the database recovery incarnation of this partial graph.
285        #[prost(string, tag = "3")]
286        pub term_id: ::prost::alloc::string::String,
287    }
288    #[derive(prost_helpers::AnyPB)]
289    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
290    pub struct RemovePartialGraphRequest {
291        #[prost(uint64, repeated, tag = "1", wrapper = "crate::id::PartialGraphId")]
292        pub partial_graph_ids: ::prost::alloc::vec::Vec<crate::id::PartialGraphId>,
293    }
294    #[derive(prost_helpers::AnyPB)]
295    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
296    pub struct ResetPartialGraphsRequest {
297        #[prost(uint64, repeated, tag = "1", wrapper = "crate::id::PartialGraphId")]
298        pub partial_graph_ids: ::prost::alloc::vec::Vec<crate::id::PartialGraphId>,
299    }
300    #[derive(prost_helpers::AnyPB)]
301    #[derive(Clone, PartialEq, ::prost::Oneof)]
302    pub enum Request {
303        #[prost(message, tag = "1")]
304        Init(InitRequest),
305        #[prost(message, tag = "2")]
306        InjectBarrier(super::InjectBarrierRequest),
307        #[prost(message, tag = "3")]
308        RemovePartialGraph(RemovePartialGraphRequest),
309        #[prost(message, tag = "4")]
310        CreatePartialGraph(CreatePartialGraphRequest),
311        #[prost(message, tag = "5")]
312        ResetPartialGraphs(ResetPartialGraphsRequest),
313    }
314}
315#[derive(prost_helpers::AnyPB)]
316#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
317pub struct ScoredError {
318    #[prost(string, tag = "1")]
319    pub err_msg: ::prost::alloc::string::String,
320    #[prost(int32, tag = "2")]
321    pub score: i32,
322}
323#[derive(prost_helpers::AnyPB)]
324#[derive(Clone, PartialEq, ::prost::Message)]
325pub struct StreamingControlStreamResponse {
326    #[prost(
327        oneof = "streaming_control_stream_response::Response",
328        tags = "1, 2, 3, 4, 5"
329    )]
330    pub response: ::core::option::Option<streaming_control_stream_response::Response>,
331}
332/// Nested message and enum types in `StreamingControlStreamResponse`.
333pub mod streaming_control_stream_response {
334    #[derive(prost_helpers::AnyPB)]
335    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
336    pub struct InitResponse {}
337    #[derive(prost_helpers::AnyPB)]
338    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
339    pub struct ShutdownResponse {}
340    #[derive(prost_helpers::AnyPB)]
341    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
342    pub struct ReportPartialGraphFailureResponse {
343        #[prost(uint64, tag = "1", wrapper = "crate::id::PartialGraphId")]
344        pub partial_graph_id: crate::id::PartialGraphId,
345    }
346    #[derive(prost_helpers::AnyPB)]
347    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
348    pub struct ResetPartialGraphResponse {
349        #[prost(uint64, tag = "1", wrapper = "crate::id::PartialGraphId")]
350        pub partial_graph_id: crate::id::PartialGraphId,
351        #[prost(message, optional, tag = "2")]
352        pub root_err: ::core::option::Option<super::ScoredError>,
353    }
354    #[derive(prost_helpers::AnyPB)]
355    #[derive(Clone, PartialEq, ::prost::Oneof)]
356    pub enum Response {
357        #[prost(message, tag = "1")]
358        Init(InitResponse),
359        #[prost(message, tag = "2")]
360        CompleteBarrier(super::BarrierCompleteResponse),
361        #[prost(message, tag = "3")]
362        Shutdown(ShutdownResponse),
363        #[prost(message, tag = "4")]
364        ReportPartialGraphFailure(ReportPartialGraphFailureResponse),
365        #[prost(message, tag = "5")]
366        ResetPartialGraph(ResetPartialGraphResponse),
367    }
368}
369#[derive(prost_helpers::AnyPB)]
370#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
371pub struct GetMinUncommittedObjectIdRequest {}
372#[derive(prost_helpers::AnyPB)]
373#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
374pub struct GetMinUncommittedObjectIdResponse {
375    #[prost(uint64, tag = "1", wrapper = "crate::id::HummockRawObjectId")]
376    pub min_uncommitted_object_id: crate::id::HummockRawObjectId,
377}
378#[derive(prost_helpers::AnyPB)]
379#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
380pub struct WarmUpTableCacheRequest {
381    #[prost(uint32, tag = "1", wrapper = "crate::id::TableId")]
382    pub table_id: crate::id::TableId,
383    #[prost(message, optional, tag = "2")]
384    pub vnode_bitmap: ::core::option::Option<super::common::Buffer>,
385    #[prost(uint64, tag = "3")]
386    pub committed_epoch: u64,
387    /// Maximum number of vnodes scanned concurrently on this compute node.
388    #[prost(uint32, tag = "4")]
389    pub concurrency: u32,
390}
391#[derive(prost_helpers::AnyPB)]
392#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
393pub struct WarmUpTableCacheResponse {
394    #[prost(uint64, tag = "1")]
395    pub key_count: u64,
396}
397#[derive(prost_helpers::AnyPB)]
398#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
399#[repr(i32)]
400pub enum PbIcebergPkIndexSinkRole {
401    Unspecified = 0,
402    Writer = 1,
403    PositionDeleteMerger = 2,
404    CompactionResolver = 3,
405}
406impl PbIcebergPkIndexSinkRole {
407    /// String value of the enum field names used in the ProtoBuf definition.
408    ///
409    /// The values are not transformed in any way and thus are considered stable
410    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
411    pub fn as_str_name(&self) -> &'static str {
412        match self {
413            Self::Unspecified => "PB_ICEBERG_PK_INDEX_SINK_ROLE_UNSPECIFIED",
414            Self::Writer => "PB_ICEBERG_PK_INDEX_SINK_ROLE_WRITER",
415            Self::PositionDeleteMerger => {
416                "PB_ICEBERG_PK_INDEX_SINK_ROLE_POSITION_DELETE_MERGER"
417            }
418            Self::CompactionResolver => {
419                "PB_ICEBERG_PK_INDEX_SINK_ROLE_COMPACTION_RESOLVER"
420            }
421        }
422    }
423    /// Creates an enum from field names used in the ProtoBuf definition.
424    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
425        match value {
426            "PB_ICEBERG_PK_INDEX_SINK_ROLE_UNSPECIFIED" => Some(Self::Unspecified),
427            "PB_ICEBERG_PK_INDEX_SINK_ROLE_WRITER" => Some(Self::Writer),
428            "PB_ICEBERG_PK_INDEX_SINK_ROLE_POSITION_DELETE_MERGER" => {
429                Some(Self::PositionDeleteMerger)
430            }
431            "PB_ICEBERG_PK_INDEX_SINK_ROLE_COMPACTION_RESOLVER" => {
432                Some(Self::CompactionResolver)
433            }
434            _ => None,
435        }
436    }
437}
438/// Generated client implementations.
439pub mod stream_service_client {
440    #![allow(
441        unused_variables,
442        dead_code,
443        missing_docs,
444        clippy::wildcard_imports,
445        clippy::let_unit_value,
446    )]
447    use tonic::codegen::*;
448    use tonic::codegen::http::Uri;
449    #[derive(Debug, Clone)]
450    pub struct StreamServiceClient<T> {
451        inner: tonic::client::Grpc<T>,
452    }
453    impl StreamServiceClient<tonic::transport::Channel> {
454        /// Attempt to create a new client by connecting to a given endpoint.
455        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
456        where
457            D: TryInto<tonic::transport::Endpoint>,
458            D::Error: Into<StdError>,
459        {
460            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
461            Ok(Self::new(conn))
462        }
463    }
464    impl<T> StreamServiceClient<T>
465    where
466        T: tonic::client::GrpcService<tonic::body::Body>,
467        T::Error: Into<StdError>,
468        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
469        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
470    {
471        pub fn new(inner: T) -> Self {
472            let inner = tonic::client::Grpc::new(inner);
473            Self { inner }
474        }
475        pub fn with_origin(inner: T, origin: Uri) -> Self {
476            let inner = tonic::client::Grpc::with_origin(inner, origin);
477            Self { inner }
478        }
479        pub fn with_interceptor<F>(
480            inner: T,
481            interceptor: F,
482        ) -> StreamServiceClient<InterceptedService<T, F>>
483        where
484            F: tonic::service::Interceptor,
485            T::ResponseBody: Default,
486            T: tonic::codegen::Service<
487                http::Request<tonic::body::Body>,
488                Response = http::Response<
489                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
490                >,
491            >,
492            <T as tonic::codegen::Service<
493                http::Request<tonic::body::Body>,
494            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
495        {
496            StreamServiceClient::new(InterceptedService::new(inner, interceptor))
497        }
498        /// Compress requests with the given encoding.
499        ///
500        /// This requires the server to support it otherwise it might respond with an
501        /// error.
502        #[must_use]
503        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
504            self.inner = self.inner.send_compressed(encoding);
505            self
506        }
507        /// Enable decompressing responses.
508        #[must_use]
509        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
510            self.inner = self.inner.accept_compressed(encoding);
511            self
512        }
513        /// Limits the maximum size of a decoded message.
514        ///
515        /// Default: `4MB`
516        #[must_use]
517        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
518            self.inner = self.inner.max_decoding_message_size(limit);
519            self
520        }
521        /// Limits the maximum size of an encoded message.
522        ///
523        /// Default: `usize::MAX`
524        #[must_use]
525        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
526            self.inner = self.inner.max_encoding_message_size(limit);
527            self
528        }
529        pub async fn streaming_control_stream(
530            &mut self,
531            request: impl tonic::IntoStreamingRequest<
532                Message = super::StreamingControlStreamRequest,
533            >,
534        ) -> std::result::Result<
535            tonic::Response<
536                tonic::codec::Streaming<super::StreamingControlStreamResponse>,
537            >,
538            tonic::Status,
539        > {
540            self.inner
541                .ready()
542                .await
543                .map_err(|e| {
544                    tonic::Status::unknown(
545                        format!("Service was not ready: {}", e.into()),
546                    )
547                })?;
548            let codec = tonic_prost::ProstCodec::default();
549            let path = http::uri::PathAndQuery::from_static(
550                "/stream_service.StreamService/StreamingControlStream",
551            );
552            let mut req = request.into_streaming_request();
553            req.extensions_mut()
554                .insert(
555                    GrpcMethod::new(
556                        "stream_service.StreamService",
557                        "StreamingControlStream",
558                    ),
559                );
560            self.inner.streaming(req, path, codec).await
561        }
562        pub async fn get_min_uncommitted_object_id(
563            &mut self,
564            request: impl tonic::IntoRequest<super::GetMinUncommittedObjectIdRequest>,
565        ) -> std::result::Result<
566            tonic::Response<super::GetMinUncommittedObjectIdResponse>,
567            tonic::Status,
568        > {
569            self.inner
570                .ready()
571                .await
572                .map_err(|e| {
573                    tonic::Status::unknown(
574                        format!("Service was not ready: {}", e.into()),
575                    )
576                })?;
577            let codec = tonic_prost::ProstCodec::default();
578            let path = http::uri::PathAndQuery::from_static(
579                "/stream_service.StreamService/GetMinUncommittedObjectId",
580            );
581            let mut req = request.into_request();
582            req.extensions_mut()
583                .insert(
584                    GrpcMethod::new(
585                        "stream_service.StreamService",
586                        "GetMinUncommittedObjectId",
587                    ),
588                );
589            self.inner.unary(req, path, codec).await
590        }
591        pub async fn warm_up_table_cache(
592            &mut self,
593            request: impl tonic::IntoRequest<super::WarmUpTableCacheRequest>,
594        ) -> std::result::Result<
595            tonic::Response<super::WarmUpTableCacheResponse>,
596            tonic::Status,
597        > {
598            self.inner
599                .ready()
600                .await
601                .map_err(|e| {
602                    tonic::Status::unknown(
603                        format!("Service was not ready: {}", e.into()),
604                    )
605                })?;
606            let codec = tonic_prost::ProstCodec::default();
607            let path = http::uri::PathAndQuery::from_static(
608                "/stream_service.StreamService/WarmUpTableCache",
609            );
610            let mut req = request.into_request();
611            req.extensions_mut()
612                .insert(
613                    GrpcMethod::new("stream_service.StreamService", "WarmUpTableCache"),
614                );
615            self.inner.unary(req, path, codec).await
616        }
617    }
618}
619/// Generated server implementations.
620pub mod stream_service_server {
621    #![allow(
622        unused_variables,
623        dead_code,
624        missing_docs,
625        clippy::wildcard_imports,
626        clippy::let_unit_value,
627    )]
628    use tonic::codegen::*;
629    /// Generated trait containing gRPC methods that should be implemented for use with StreamServiceServer.
630    #[async_trait]
631    pub trait StreamService: std::marker::Send + std::marker::Sync + 'static {
632        /// Server streaming response type for the StreamingControlStream method.
633        type StreamingControlStreamStream: tonic::codegen::tokio_stream::Stream<
634                Item = std::result::Result<
635                    super::StreamingControlStreamResponse,
636                    tonic::Status,
637                >,
638            >
639            + std::marker::Send
640            + 'static;
641        async fn streaming_control_stream(
642            &self,
643            request: tonic::Request<
644                tonic::Streaming<super::StreamingControlStreamRequest>,
645            >,
646        ) -> std::result::Result<
647            tonic::Response<Self::StreamingControlStreamStream>,
648            tonic::Status,
649        >;
650        async fn get_min_uncommitted_object_id(
651            &self,
652            request: tonic::Request<super::GetMinUncommittedObjectIdRequest>,
653        ) -> std::result::Result<
654            tonic::Response<super::GetMinUncommittedObjectIdResponse>,
655            tonic::Status,
656        >;
657        async fn warm_up_table_cache(
658            &self,
659            request: tonic::Request<super::WarmUpTableCacheRequest>,
660        ) -> std::result::Result<
661            tonic::Response<super::WarmUpTableCacheResponse>,
662            tonic::Status,
663        >;
664    }
665    #[derive(Debug)]
666    pub struct StreamServiceServer<T> {
667        inner: Arc<T>,
668        accept_compression_encodings: EnabledCompressionEncodings,
669        send_compression_encodings: EnabledCompressionEncodings,
670        max_decoding_message_size: Option<usize>,
671        max_encoding_message_size: Option<usize>,
672    }
673    impl<T> StreamServiceServer<T> {
674        pub fn new(inner: T) -> Self {
675            Self::from_arc(Arc::new(inner))
676        }
677        pub fn from_arc(inner: Arc<T>) -> Self {
678            Self {
679                inner,
680                accept_compression_encodings: Default::default(),
681                send_compression_encodings: Default::default(),
682                max_decoding_message_size: None,
683                max_encoding_message_size: None,
684            }
685        }
686        pub fn with_interceptor<F>(
687            inner: T,
688            interceptor: F,
689        ) -> InterceptedService<Self, F>
690        where
691            F: tonic::service::Interceptor,
692        {
693            InterceptedService::new(Self::new(inner), interceptor)
694        }
695        /// Enable decompressing requests with the given encoding.
696        #[must_use]
697        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
698            self.accept_compression_encodings.enable(encoding);
699            self
700        }
701        /// Compress responses with the given encoding, if the client supports it.
702        #[must_use]
703        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
704            self.send_compression_encodings.enable(encoding);
705            self
706        }
707        /// Limits the maximum size of a decoded message.
708        ///
709        /// Default: `4MB`
710        #[must_use]
711        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
712            self.max_decoding_message_size = Some(limit);
713            self
714        }
715        /// Limits the maximum size of an encoded message.
716        ///
717        /// Default: `usize::MAX`
718        #[must_use]
719        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
720            self.max_encoding_message_size = Some(limit);
721            self
722        }
723    }
724    impl<T, B> tonic::codegen::Service<http::Request<B>> for StreamServiceServer<T>
725    where
726        T: StreamService,
727        B: Body + std::marker::Send + 'static,
728        B::Error: Into<StdError> + std::marker::Send + 'static,
729    {
730        type Response = http::Response<tonic::body::Body>;
731        type Error = std::convert::Infallible;
732        type Future = BoxFuture<Self::Response, Self::Error>;
733        fn poll_ready(
734            &mut self,
735            _cx: &mut Context<'_>,
736        ) -> Poll<std::result::Result<(), Self::Error>> {
737            Poll::Ready(Ok(()))
738        }
739        fn call(&mut self, req: http::Request<B>) -> Self::Future {
740            match req.uri().path() {
741                "/stream_service.StreamService/StreamingControlStream" => {
742                    #[allow(non_camel_case_types)]
743                    struct StreamingControlStreamSvc<T: StreamService>(pub Arc<T>);
744                    impl<
745                        T: StreamService,
746                    > tonic::server::StreamingService<
747                        super::StreamingControlStreamRequest,
748                    > for StreamingControlStreamSvc<T> {
749                        type Response = super::StreamingControlStreamResponse;
750                        type ResponseStream = T::StreamingControlStreamStream;
751                        type Future = BoxFuture<
752                            tonic::Response<Self::ResponseStream>,
753                            tonic::Status,
754                        >;
755                        fn call(
756                            &mut self,
757                            request: tonic::Request<
758                                tonic::Streaming<super::StreamingControlStreamRequest>,
759                            >,
760                        ) -> Self::Future {
761                            let inner = Arc::clone(&self.0);
762                            let fut = async move {
763                                <T as StreamService>::streaming_control_stream(
764                                        &inner,
765                                        request,
766                                    )
767                                    .await
768                            };
769                            Box::pin(fut)
770                        }
771                    }
772                    let accept_compression_encodings = self.accept_compression_encodings;
773                    let send_compression_encodings = self.send_compression_encodings;
774                    let max_decoding_message_size = self.max_decoding_message_size;
775                    let max_encoding_message_size = self.max_encoding_message_size;
776                    let inner = self.inner.clone();
777                    let fut = async move {
778                        let method = StreamingControlStreamSvc(inner);
779                        let codec = tonic_prost::ProstCodec::default();
780                        let mut grpc = tonic::server::Grpc::new(codec)
781                            .apply_compression_config(
782                                accept_compression_encodings,
783                                send_compression_encodings,
784                            )
785                            .apply_max_message_size_config(
786                                max_decoding_message_size,
787                                max_encoding_message_size,
788                            );
789                        let res = grpc.streaming(method, req).await;
790                        Ok(res)
791                    };
792                    Box::pin(fut)
793                }
794                "/stream_service.StreamService/GetMinUncommittedObjectId" => {
795                    #[allow(non_camel_case_types)]
796                    struct GetMinUncommittedObjectIdSvc<T: StreamService>(pub Arc<T>);
797                    impl<
798                        T: StreamService,
799                    > tonic::server::UnaryService<
800                        super::GetMinUncommittedObjectIdRequest,
801                    > for GetMinUncommittedObjectIdSvc<T> {
802                        type Response = super::GetMinUncommittedObjectIdResponse;
803                        type Future = BoxFuture<
804                            tonic::Response<Self::Response>,
805                            tonic::Status,
806                        >;
807                        fn call(
808                            &mut self,
809                            request: tonic::Request<
810                                super::GetMinUncommittedObjectIdRequest,
811                            >,
812                        ) -> Self::Future {
813                            let inner = Arc::clone(&self.0);
814                            let fut = async move {
815                                <T as StreamService>::get_min_uncommitted_object_id(
816                                        &inner,
817                                        request,
818                                    )
819                                    .await
820                            };
821                            Box::pin(fut)
822                        }
823                    }
824                    let accept_compression_encodings = self.accept_compression_encodings;
825                    let send_compression_encodings = self.send_compression_encodings;
826                    let max_decoding_message_size = self.max_decoding_message_size;
827                    let max_encoding_message_size = self.max_encoding_message_size;
828                    let inner = self.inner.clone();
829                    let fut = async move {
830                        let method = GetMinUncommittedObjectIdSvc(inner);
831                        let codec = tonic_prost::ProstCodec::default();
832                        let mut grpc = tonic::server::Grpc::new(codec)
833                            .apply_compression_config(
834                                accept_compression_encodings,
835                                send_compression_encodings,
836                            )
837                            .apply_max_message_size_config(
838                                max_decoding_message_size,
839                                max_encoding_message_size,
840                            );
841                        let res = grpc.unary(method, req).await;
842                        Ok(res)
843                    };
844                    Box::pin(fut)
845                }
846                "/stream_service.StreamService/WarmUpTableCache" => {
847                    #[allow(non_camel_case_types)]
848                    struct WarmUpTableCacheSvc<T: StreamService>(pub Arc<T>);
849                    impl<
850                        T: StreamService,
851                    > tonic::server::UnaryService<super::WarmUpTableCacheRequest>
852                    for WarmUpTableCacheSvc<T> {
853                        type Response = super::WarmUpTableCacheResponse;
854                        type Future = BoxFuture<
855                            tonic::Response<Self::Response>,
856                            tonic::Status,
857                        >;
858                        fn call(
859                            &mut self,
860                            request: tonic::Request<super::WarmUpTableCacheRequest>,
861                        ) -> Self::Future {
862                            let inner = Arc::clone(&self.0);
863                            let fut = async move {
864                                <T as StreamService>::warm_up_table_cache(&inner, request)
865                                    .await
866                            };
867                            Box::pin(fut)
868                        }
869                    }
870                    let accept_compression_encodings = self.accept_compression_encodings;
871                    let send_compression_encodings = self.send_compression_encodings;
872                    let max_decoding_message_size = self.max_decoding_message_size;
873                    let max_encoding_message_size = self.max_encoding_message_size;
874                    let inner = self.inner.clone();
875                    let fut = async move {
876                        let method = WarmUpTableCacheSvc(inner);
877                        let codec = tonic_prost::ProstCodec::default();
878                        let mut grpc = tonic::server::Grpc::new(codec)
879                            .apply_compression_config(
880                                accept_compression_encodings,
881                                send_compression_encodings,
882                            )
883                            .apply_max_message_size_config(
884                                max_decoding_message_size,
885                                max_encoding_message_size,
886                            );
887                        let res = grpc.unary(method, req).await;
888                        Ok(res)
889                    };
890                    Box::pin(fut)
891                }
892                _ => {
893                    Box::pin(async move {
894                        let mut response = http::Response::new(
895                            tonic::body::Body::default(),
896                        );
897                        let headers = response.headers_mut();
898                        headers
899                            .insert(
900                                tonic::Status::GRPC_STATUS,
901                                (tonic::Code::Unimplemented as i32).into(),
902                            );
903                        headers
904                            .insert(
905                                http::header::CONTENT_TYPE,
906                                tonic::metadata::GRPC_CONTENT_TYPE,
907                            );
908                        Ok(response)
909                    })
910                }
911            }
912        }
913    }
914    impl<T> Clone for StreamServiceServer<T> {
915        fn clone(&self) -> Self {
916            let inner = self.inner.clone();
917            Self {
918                inner,
919                accept_compression_encodings: self.accept_compression_encodings,
920                send_compression_encodings: self.send_compression_encodings,
921                max_decoding_message_size: self.max_decoding_message_size,
922                max_encoding_message_size: self.max_encoding_message_size,
923            }
924        }
925    }
926    /// Generated gRPC service name
927    pub const SERVICE_NAME: &str = "stream_service.StreamService";
928    impl<T> tonic::server::NamedService for StreamServiceServer<T> {
929        const NAME: &'static str = SERVICE_NAME;
930    }
931}