1#[derive(prost_helpers::AnyPB)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct TableSchema {
5 #[prost(message, repeated, tag = "1")]
6 pub columns: ::prost::alloc::vec::Vec<super::plan_common::ColumnDesc>,
7 #[prost(uint32, repeated, tag = "2")]
8 pub pk_indices: ::prost::alloc::vec::Vec<u32>,
9}
10#[derive(prost_helpers::AnyPB)]
11#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
12pub struct ValidationError {
13 #[prost(string, tag = "1")]
14 pub error_message: ::prost::alloc::string::String,
15}
16#[derive(prost_helpers::AnyPB)]
17#[derive(Clone, PartialEq, ::prost::Message)]
18pub struct SinkParam {
19 #[prost(uint32, tag = "1", wrapper = "crate::id::SinkId")]
20 pub sink_id: crate::id::SinkId,
21 #[prost(btree_map = "string, string", tag = "2")]
22 pub properties: ::prost::alloc::collections::BTreeMap<
23 ::prost::alloc::string::String,
24 ::prost::alloc::string::String,
25 >,
26 #[prost(message, optional, tag = "3")]
27 pub table_schema: ::core::option::Option<TableSchema>,
28 #[prost(enumeration = "super::catalog::SinkType", tag = "4")]
30 pub sink_type: i32,
31 #[prost(string, tag = "5")]
32 pub db_name: ::prost::alloc::string::String,
33 #[prost(string, tag = "6")]
34 pub sink_from_name: ::prost::alloc::string::String,
35 #[prost(message, optional, tag = "7")]
36 pub format_desc: ::core::option::Option<super::catalog::SinkFormatDesc>,
37 #[prost(string, tag = "8")]
38 pub sink_name: ::prost::alloc::string::String,
39 #[prost(bool, tag = "9")]
43 pub raw_ignore_delete: bool,
44}
45#[derive(prost_helpers::AnyPB)]
46#[derive(Clone, PartialEq, ::prost::Message)]
47pub struct SinkWriterStreamRequest {
48 #[prost(oneof = "sink_writer_stream_request::Request", tags = "1, 3, 4")]
49 pub request: ::core::option::Option<sink_writer_stream_request::Request>,
50}
51pub mod sink_writer_stream_request {
53 #[derive(prost_helpers::AnyPB)]
54 #[derive(Clone, PartialEq, ::prost::Message)]
55 pub struct StartSink {
56 #[prost(message, optional, tag = "1")]
57 pub sink_param: ::core::option::Option<super::SinkParam>,
58 #[prost(message, optional, tag = "3")]
59 pub payload_schema: ::core::option::Option<super::TableSchema>,
60 }
61 #[derive(prost_helpers::AnyPB)]
62 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
63 pub struct WriteBatch {
64 #[prost(uint64, tag = "3")]
65 pub batch_id: u64,
66 #[prost(uint64, tag = "4")]
67 pub epoch: u64,
68 #[prost(oneof = "write_batch::Payload", tags = "2, 5")]
69 pub payload: ::core::option::Option<write_batch::Payload>,
70 }
71 pub mod write_batch {
73 #[derive(prost_helpers::AnyPB)]
74 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
75 pub struct StreamChunkPayload {
76 #[prost(bytes = "vec", tag = "1")]
77 pub binary_data: ::prost::alloc::vec::Vec<u8>,
78 }
79 #[derive(prost_helpers::AnyPB)]
80 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
81 pub enum Payload {
82 #[prost(message, tag = "2")]
83 StreamChunkPayload(StreamChunkPayload),
84 #[prost(int64, tag = "5")]
88 StreamChunkRefPointer(i64),
89 }
90 }
91 #[derive(prost_helpers::AnyPB)]
92 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
93 pub struct Barrier {
94 #[prost(uint64, tag = "1")]
95 pub epoch: u64,
96 #[prost(bool, tag = "2")]
97 pub is_checkpoint: bool,
98 }
99 #[derive(prost_helpers::AnyPB)]
100 #[derive(Clone, PartialEq, ::prost::Oneof)]
101 pub enum Request {
102 #[prost(message, tag = "1")]
103 Start(StartSink),
104 #[prost(message, tag = "3")]
105 WriteBatch(WriteBatch),
106 #[prost(message, tag = "4")]
107 Barrier(Barrier),
108 }
109}
110#[derive(prost_helpers::AnyPB)]
111#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
112pub struct SinkWriterStreamResponse {
113 #[prost(oneof = "sink_writer_stream_response::Response", tags = "1, 2, 3")]
114 pub response: ::core::option::Option<sink_writer_stream_response::Response>,
115}
116pub mod sink_writer_stream_response {
118 #[derive(prost_helpers::AnyPB)]
119 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
120 pub struct StartResponse {}
121 #[derive(prost_helpers::AnyPB)]
122 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
123 pub struct CommitResponse {
124 #[prost(uint64, tag = "1")]
125 pub epoch: u64,
126 #[prost(message, optional, tag = "2")]
127 pub metadata: ::core::option::Option<super::SinkMetadata>,
128 }
129 #[derive(prost_helpers::AnyPB)]
130 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
131 pub struct BatchWrittenResponse {
132 #[prost(uint64, tag = "1")]
133 pub epoch: u64,
134 #[prost(uint64, tag = "2")]
135 pub batch_id: u64,
136 }
137 #[derive(prost_helpers::AnyPB)]
138 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
139 pub enum Response {
140 #[prost(message, tag = "1")]
141 Start(StartResponse),
142 #[prost(message, tag = "2")]
143 Commit(CommitResponse),
144 #[prost(message, tag = "3")]
145 Batch(BatchWrittenResponse),
146 }
147}
148#[derive(prost_helpers::AnyPB)]
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct ValidateSinkRequest {
151 #[prost(message, optional, tag = "1")]
152 pub sink_param: ::core::option::Option<SinkParam>,
153}
154#[derive(prost_helpers::AnyPB)]
155#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
156pub struct ValidateSinkResponse {
157 #[prost(message, optional, tag = "1")]
159 pub error: ::core::option::Option<ValidationError>,
160}
161#[derive(prost_helpers::AnyPB)]
162#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
163pub struct SinkMetadata {
164 #[prost(oneof = "sink_metadata::Metadata", tags = "1")]
165 pub metadata: ::core::option::Option<sink_metadata::Metadata>,
166}
167pub mod sink_metadata {
169 #[derive(prost_helpers::AnyPB)]
170 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
171 pub struct SerializedMetadata {
172 #[prost(bytes = "vec", tag = "1")]
173 pub metadata: ::prost::alloc::vec::Vec<u8>,
174 }
175 #[derive(prost_helpers::AnyPB)]
176 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
177 pub enum Metadata {
178 #[prost(message, tag = "1")]
179 Serialized(SerializedMetadata),
180 }
181}
182#[derive(prost_helpers::AnyPB)]
183#[derive(Clone, PartialEq, ::prost::Message)]
184pub struct SinkCoordinatorStreamRequest {
185 #[prost(oneof = "sink_coordinator_stream_request::Request", tags = "1, 2")]
186 pub request: ::core::option::Option<sink_coordinator_stream_request::Request>,
187}
188pub mod sink_coordinator_stream_request {
190 #[derive(prost_helpers::AnyPB)]
191 #[derive(Clone, PartialEq, ::prost::Message)]
192 pub struct StartCoordinator {
193 #[prost(message, optional, tag = "1")]
194 pub param: ::core::option::Option<super::SinkParam>,
195 }
196 #[derive(prost_helpers::AnyPB)]
197 #[derive(Clone, PartialEq, ::prost::Message)]
198 pub struct CommitMetadata {
199 #[prost(uint64, tag = "1")]
200 pub epoch: u64,
201 #[prost(message, repeated, tag = "2")]
202 pub metadata: ::prost::alloc::vec::Vec<super::SinkMetadata>,
203 }
204 #[derive(prost_helpers::AnyPB)]
205 #[derive(Clone, PartialEq, ::prost::Oneof)]
206 pub enum Request {
207 #[prost(message, tag = "1")]
208 Start(StartCoordinator),
209 #[prost(message, tag = "2")]
210 Commit(CommitMetadata),
211 }
212}
213#[derive(prost_helpers::AnyPB)]
214#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
215pub struct SinkCoordinatorStreamResponse {
216 #[prost(oneof = "sink_coordinator_stream_response::Response", tags = "1, 2")]
217 pub response: ::core::option::Option<sink_coordinator_stream_response::Response>,
218}
219pub mod sink_coordinator_stream_response {
221 #[derive(prost_helpers::AnyPB)]
222 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
223 pub struct StartResponse {}
224 #[derive(prost_helpers::AnyPB)]
225 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
226 pub struct CommitResponse {
227 #[prost(uint64, tag = "1")]
228 pub epoch: u64,
229 }
230 #[derive(prost_helpers::AnyPB)]
231 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
232 pub enum Response {
233 #[prost(message, tag = "1")]
234 Start(StartResponse),
235 #[prost(message, tag = "2")]
236 Commit(CommitResponse),
237 }
238}
239#[derive(prost_helpers::AnyPB)]
240#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
241pub struct CdcMessage {
242 #[prost(string, tag = "1")]
244 pub payload: ::prost::alloc::string::String,
245 #[prost(string, tag = "2")]
246 pub partition: ::prost::alloc::string::String,
247 #[prost(string, tag = "3")]
248 pub offset: ::prost::alloc::string::String,
249 #[prost(string, tag = "4")]
250 pub full_table_name: ::prost::alloc::string::String,
251 #[prost(int64, tag = "5")]
252 pub source_ts_ms: i64,
253 #[prost(enumeration = "cdc_message::CdcMessageType", tag = "6")]
254 pub msg_type: i32,
255 #[prost(string, tag = "7")]
257 pub key: ::prost::alloc::string::String,
258}
259pub mod cdc_message {
261 #[derive(prost_helpers::AnyPB)]
262 #[derive(
263 Clone,
264 Copy,
265 Debug,
266 PartialEq,
267 Eq,
268 Hash,
269 PartialOrd,
270 Ord,
271 ::prost::Enumeration
272 )]
273 #[repr(i32)]
274 pub enum CdcMessageType {
275 Unspecified = 0,
276 Heartbeat = 1,
277 Data = 2,
278 TransactionMeta = 3,
279 SchemaChange = 4,
280 }
281 impl CdcMessageType {
282 pub fn as_str_name(&self) -> &'static str {
287 match self {
288 Self::Unspecified => "UNSPECIFIED",
289 Self::Heartbeat => "HEARTBEAT",
290 Self::Data => "DATA",
291 Self::TransactionMeta => "TRANSACTION_META",
292 Self::SchemaChange => "SCHEMA_CHANGE",
293 }
294 }
295 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
297 match value {
298 "UNSPECIFIED" => Some(Self::Unspecified),
299 "HEARTBEAT" => Some(Self::Heartbeat),
300 "DATA" => Some(Self::Data),
301 "TRANSACTION_META" => Some(Self::TransactionMeta),
302 "SCHEMA_CHANGE" => Some(Self::SchemaChange),
303 _ => None,
304 }
305 }
306 }
307}
308#[derive(prost_helpers::AnyPB)]
309#[derive(Clone, PartialEq, ::prost::Message)]
310pub struct GetEventStreamRequest {
311 #[prost(uint64, tag = "1")]
312 pub source_id: u64,
313 #[prost(enumeration = "SourceType", tag = "2")]
314 pub source_type: i32,
315 #[prost(string, tag = "3")]
316 pub start_offset: ::prost::alloc::string::String,
317 #[prost(btree_map = "string, string", tag = "4")]
318 pub properties: ::prost::alloc::collections::BTreeMap<
319 ::prost::alloc::string::String,
320 ::prost::alloc::string::String,
321 >,
322 #[prost(bool, tag = "5")]
323 pub snapshot_done: bool,
324 #[prost(bool, tag = "6")]
325 pub is_source_job: bool,
326}
327#[derive(prost_helpers::AnyPB)]
328#[derive(Clone, PartialEq, ::prost::Message)]
329pub struct GetEventStreamResponse {
330 #[prost(uint64, tag = "1")]
331 pub source_id: u64,
332 #[prost(message, repeated, tag = "2")]
333 pub events: ::prost::alloc::vec::Vec<CdcMessage>,
334 #[prost(message, optional, tag = "3")]
335 pub control: ::core::option::Option<get_event_stream_response::ControlInfo>,
336}
337pub mod get_event_stream_response {
339 #[derive(prost_helpers::AnyPB)]
340 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
341 pub struct ControlInfo {
342 #[prost(bool, tag = "1")]
343 pub handshake_ok: bool,
344 }
345}
346#[derive(prost_helpers::AnyPB)]
347#[derive(Clone, PartialEq, ::prost::Message)]
348pub struct ValidateSourceRequest {
349 #[prost(uint64, tag = "1")]
350 pub source_id: u64,
351 #[prost(enumeration = "SourceType", tag = "2")]
352 pub source_type: i32,
353 #[prost(btree_map = "string, string", tag = "3")]
354 pub properties: ::prost::alloc::collections::BTreeMap<
355 ::prost::alloc::string::String,
356 ::prost::alloc::string::String,
357 >,
358 #[prost(message, optional, tag = "4")]
359 pub table_schema: ::core::option::Option<TableSchema>,
360 #[prost(bool, tag = "5")]
361 pub is_source_job: bool,
362 #[prost(bool, tag = "6")]
363 pub is_backfill_table: bool,
364}
365#[derive(prost_helpers::AnyPB)]
366#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
367pub struct ValidateSourceResponse {
368 #[prost(message, optional, tag = "1")]
370 pub error: ::core::option::Option<ValidationError>,
371}
372#[derive(prost_helpers::AnyPB)]
376#[derive(Clone, PartialEq, ::prost::Message)]
377pub struct OracleConnectionProperties {
378 #[prost(map = "string, string", tag = "1")]
379 pub properties: ::std::collections::HashMap<
380 ::prost::alloc::string::String,
381 ::prost::alloc::string::String,
382 >,
383}
384#[derive(prost_helpers::AnyPB)]
385#[derive(Clone, PartialEq, ::prost::Message)]
386pub struct OracleSnapshotReadRequest {
387 #[prost(string, tag = "1")]
388 pub schema_name: ::prost::alloc::string::String,
389 #[prost(string, tag = "2")]
390 pub table_name: ::prost::alloc::string::String,
391 #[prost(message, optional, tag = "3")]
392 pub table_schema: ::core::option::Option<TableSchema>,
393 #[prost(string, repeated, tag = "4")]
394 pub primary_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
395}
396#[derive(prost_helpers::AnyPB)]
397#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
398pub struct OracleSnapshotReadResponse {
399 #[prost(bytes = "vec", tag = "1")]
401 pub arrow_ipc: ::prost::alloc::vec::Vec<u8>,
402}
403#[derive(prost_helpers::AnyPB)]
404#[derive(Clone, PartialEq, ::prost::Message)]
405pub struct CoordinateRequest {
406 #[prost(oneof = "coordinate_request::Msg", tags = "1, 2, 3, 4, 5")]
407 pub msg: ::core::option::Option<coordinate_request::Msg>,
408}
409pub mod coordinate_request {
411 #[derive(prost_helpers::AnyPB)]
414 #[derive(Clone, PartialEq, ::prost::Message)]
415 pub struct StartCoordinationRequest {
416 #[prost(message, optional, tag = "1")]
417 pub vnode_bitmap: ::core::option::Option<super::super::common::Buffer>,
418 #[prost(message, optional, tag = "2")]
419 pub param: ::core::option::Option<super::SinkParam>,
420 }
421 #[derive(prost_helpers::AnyPB)]
422 #[derive(Clone, PartialEq, ::prost::Message)]
423 pub struct CommitRequest {
424 #[prost(uint64, tag = "1")]
425 pub epoch: u64,
426 #[prost(message, optional, tag = "2")]
427 pub metadata: ::core::option::Option<super::SinkMetadata>,
428 #[prost(message, optional, tag = "3")]
429 pub schema_change: ::core::option::Option<
430 super::super::stream_plan::SinkSchemaChange,
431 >,
432 }
433 #[derive(prost_helpers::AnyPB)]
434 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
435 pub struct UpdateVnodeBitmapRequest {
436 #[prost(message, optional, tag = "1")]
437 pub vnode_bitmap: ::core::option::Option<super::super::common::Buffer>,
438 }
439 #[derive(prost_helpers::AnyPB)]
440 #[derive(Clone, PartialEq, ::prost::Oneof)]
441 pub enum Msg {
442 #[prost(message, tag = "1")]
443 StartRequest(StartCoordinationRequest),
444 #[prost(message, tag = "2")]
445 CommitRequest(CommitRequest),
446 #[prost(message, tag = "3")]
447 UpdateVnodeRequest(UpdateVnodeBitmapRequest),
448 #[prost(bool, tag = "4")]
449 Stop(bool),
450 #[prost(uint64, tag = "5")]
451 AlignInitialEpochRequest(u64),
452 }
453}
454#[derive(prost_helpers::AnyPB)]
455#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
456pub struct CoordinateResponse {
457 #[prost(oneof = "coordinate_response::Msg", tags = "1, 2, 3, 4")]
458 pub msg: ::core::option::Option<coordinate_response::Msg>,
459}
460pub mod coordinate_response {
462 #[derive(prost_helpers::AnyPB)]
463 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
464 pub struct StartCoordinationResponse {
465 #[prost(uint64, optional, tag = "1")]
466 pub log_store_rewind_start_epoch: ::core::option::Option<u64>,
467 }
468 #[derive(prost_helpers::AnyPB)]
469 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
470 pub struct CommitResponse {
471 #[prost(uint64, tag = "1")]
472 pub epoch: u64,
473 }
474 #[derive(prost_helpers::AnyPB)]
475 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
476 pub enum Msg {
477 #[prost(message, tag = "1")]
478 StartResponse(StartCoordinationResponse),
479 #[prost(message, tag = "2")]
480 CommitResponse(CommitResponse),
481 #[prost(bool, tag = "3")]
482 Stopped(bool),
483 #[prost(uint64, tag = "4")]
484 AlignInitialEpochResponse(u64),
485 }
486}
487#[derive(prost_helpers::AnyPB)]
488#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
489pub struct IcebergPkIndexPreCommitState {
490 #[prost(bytes = "vec", tag = "1")]
491 pub agg_result: ::prost::alloc::vec::Vec<u8>,
492 #[prost(int64, tag = "2")]
493 pub snapshot_id: i64,
494}
495#[derive(prost_helpers::AnyPB)]
496#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
497#[repr(i32)]
498pub enum SourceType {
499 Unspecified = 0,
500 Mysql = 1,
501 Postgres = 2,
502 Mongodb = 4,
503 SqlServer = 5,
504 Oracle = 6,
505 Mariadb = 7,
506}
507impl SourceType {
508 pub fn as_str_name(&self) -> &'static str {
513 match self {
514 Self::Unspecified => "UNSPECIFIED",
515 Self::Mysql => "MYSQL",
516 Self::Postgres => "POSTGRES",
517 Self::Mongodb => "MONGODB",
518 Self::SqlServer => "SQL_SERVER",
519 Self::Oracle => "ORACLE",
520 Self::Mariadb => "MARIADB",
521 }
522 }
523 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
525 match value {
526 "UNSPECIFIED" => Some(Self::Unspecified),
527 "MYSQL" => Some(Self::Mysql),
528 "POSTGRES" => Some(Self::Postgres),
529 "MONGODB" => Some(Self::Mongodb),
530 "SQL_SERVER" => Some(Self::SqlServer),
531 "ORACLE" => Some(Self::Oracle),
532 "MARIADB" => Some(Self::Mariadb),
533 _ => None,
534 }
535 }
536}
537pub mod connector_service_client {
539 #![allow(
540 unused_variables,
541 dead_code,
542 missing_docs,
543 clippy::wildcard_imports,
544 clippy::let_unit_value,
545 )]
546 use tonic::codegen::*;
547 use tonic::codegen::http::Uri;
548 #[derive(Debug, Clone)]
549 pub struct ConnectorServiceClient<T> {
550 inner: tonic::client::Grpc<T>,
551 }
552 impl ConnectorServiceClient<tonic::transport::Channel> {
553 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
555 where
556 D: TryInto<tonic::transport::Endpoint>,
557 D::Error: Into<StdError>,
558 {
559 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
560 Ok(Self::new(conn))
561 }
562 }
563 impl<T> ConnectorServiceClient<T>
564 where
565 T: tonic::client::GrpcService<tonic::body::Body>,
566 T::Error: Into<StdError>,
567 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
568 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
569 {
570 pub fn new(inner: T) -> Self {
571 let inner = tonic::client::Grpc::new(inner);
572 Self { inner }
573 }
574 pub fn with_origin(inner: T, origin: Uri) -> Self {
575 let inner = tonic::client::Grpc::with_origin(inner, origin);
576 Self { inner }
577 }
578 pub fn with_interceptor<F>(
579 inner: T,
580 interceptor: F,
581 ) -> ConnectorServiceClient<InterceptedService<T, F>>
582 where
583 F: tonic::service::Interceptor,
584 T::ResponseBody: Default,
585 T: tonic::codegen::Service<
586 http::Request<tonic::body::Body>,
587 Response = http::Response<
588 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
589 >,
590 >,
591 <T as tonic::codegen::Service<
592 http::Request<tonic::body::Body>,
593 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
594 {
595 ConnectorServiceClient::new(InterceptedService::new(inner, interceptor))
596 }
597 #[must_use]
602 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
603 self.inner = self.inner.send_compressed(encoding);
604 self
605 }
606 #[must_use]
608 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
609 self.inner = self.inner.accept_compressed(encoding);
610 self
611 }
612 #[must_use]
616 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
617 self.inner = self.inner.max_decoding_message_size(limit);
618 self
619 }
620 #[must_use]
624 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
625 self.inner = self.inner.max_encoding_message_size(limit);
626 self
627 }
628 pub async fn sink_writer_stream(
629 &mut self,
630 request: impl tonic::IntoStreamingRequest<
631 Message = super::SinkWriterStreamRequest,
632 >,
633 ) -> std::result::Result<
634 tonic::Response<tonic::codec::Streaming<super::SinkWriterStreamResponse>>,
635 tonic::Status,
636 > {
637 self.inner
638 .ready()
639 .await
640 .map_err(|e| {
641 tonic::Status::unknown(
642 format!("Service was not ready: {}", e.into()),
643 )
644 })?;
645 let codec = tonic_prost::ProstCodec::default();
646 let path = http::uri::PathAndQuery::from_static(
647 "/connector_service.ConnectorService/SinkWriterStream",
648 );
649 let mut req = request.into_streaming_request();
650 req.extensions_mut()
651 .insert(
652 GrpcMethod::new(
653 "connector_service.ConnectorService",
654 "SinkWriterStream",
655 ),
656 );
657 self.inner.streaming(req, path, codec).await
658 }
659 pub async fn sink_coordinator_stream(
660 &mut self,
661 request: impl tonic::IntoStreamingRequest<
662 Message = super::SinkCoordinatorStreamRequest,
663 >,
664 ) -> std::result::Result<
665 tonic::Response<
666 tonic::codec::Streaming<super::SinkCoordinatorStreamResponse>,
667 >,
668 tonic::Status,
669 > {
670 self.inner
671 .ready()
672 .await
673 .map_err(|e| {
674 tonic::Status::unknown(
675 format!("Service was not ready: {}", e.into()),
676 )
677 })?;
678 let codec = tonic_prost::ProstCodec::default();
679 let path = http::uri::PathAndQuery::from_static(
680 "/connector_service.ConnectorService/SinkCoordinatorStream",
681 );
682 let mut req = request.into_streaming_request();
683 req.extensions_mut()
684 .insert(
685 GrpcMethod::new(
686 "connector_service.ConnectorService",
687 "SinkCoordinatorStream",
688 ),
689 );
690 self.inner.streaming(req, path, codec).await
691 }
692 pub async fn validate_sink(
693 &mut self,
694 request: impl tonic::IntoRequest<super::ValidateSinkRequest>,
695 ) -> std::result::Result<
696 tonic::Response<super::ValidateSinkResponse>,
697 tonic::Status,
698 > {
699 self.inner
700 .ready()
701 .await
702 .map_err(|e| {
703 tonic::Status::unknown(
704 format!("Service was not ready: {}", e.into()),
705 )
706 })?;
707 let codec = tonic_prost::ProstCodec::default();
708 let path = http::uri::PathAndQuery::from_static(
709 "/connector_service.ConnectorService/ValidateSink",
710 );
711 let mut req = request.into_request();
712 req.extensions_mut()
713 .insert(
714 GrpcMethod::new("connector_service.ConnectorService", "ValidateSink"),
715 );
716 self.inner.unary(req, path, codec).await
717 }
718 pub async fn get_event_stream(
719 &mut self,
720 request: impl tonic::IntoRequest<super::GetEventStreamRequest>,
721 ) -> std::result::Result<
722 tonic::Response<tonic::codec::Streaming<super::GetEventStreamResponse>>,
723 tonic::Status,
724 > {
725 self.inner
726 .ready()
727 .await
728 .map_err(|e| {
729 tonic::Status::unknown(
730 format!("Service was not ready: {}", e.into()),
731 )
732 })?;
733 let codec = tonic_prost::ProstCodec::default();
734 let path = http::uri::PathAndQuery::from_static(
735 "/connector_service.ConnectorService/GetEventStream",
736 );
737 let mut req = request.into_request();
738 req.extensions_mut()
739 .insert(
740 GrpcMethod::new(
741 "connector_service.ConnectorService",
742 "GetEventStream",
743 ),
744 );
745 self.inner.server_streaming(req, path, codec).await
746 }
747 pub async fn validate_source(
748 &mut self,
749 request: impl tonic::IntoRequest<super::ValidateSourceRequest>,
750 ) -> std::result::Result<
751 tonic::Response<super::ValidateSourceResponse>,
752 tonic::Status,
753 > {
754 self.inner
755 .ready()
756 .await
757 .map_err(|e| {
758 tonic::Status::unknown(
759 format!("Service was not ready: {}", e.into()),
760 )
761 })?;
762 let codec = tonic_prost::ProstCodec::default();
763 let path = http::uri::PathAndQuery::from_static(
764 "/connector_service.ConnectorService/ValidateSource",
765 );
766 let mut req = request.into_request();
767 req.extensions_mut()
768 .insert(
769 GrpcMethod::new(
770 "connector_service.ConnectorService",
771 "ValidateSource",
772 ),
773 );
774 self.inner.unary(req, path, codec).await
775 }
776 pub async fn oracle_snapshot_read(
781 &mut self,
782 request: impl tonic::IntoRequest<super::OracleSnapshotReadRequest>,
783 ) -> std::result::Result<
784 tonic::Response<tonic::codec::Streaming<super::OracleSnapshotReadResponse>>,
785 tonic::Status,
786 > {
787 self.inner
788 .ready()
789 .await
790 .map_err(|e| {
791 tonic::Status::unknown(
792 format!("Service was not ready: {}", e.into()),
793 )
794 })?;
795 let codec = tonic_prost::ProstCodec::default();
796 let path = http::uri::PathAndQuery::from_static(
797 "/connector_service.ConnectorService/OracleSnapshotRead",
798 );
799 let mut req = request.into_request();
800 req.extensions_mut()
801 .insert(
802 GrpcMethod::new(
803 "connector_service.ConnectorService",
804 "OracleSnapshotRead",
805 ),
806 );
807 self.inner.server_streaming(req, path, codec).await
808 }
809 }
810}
811pub mod connector_service_server {
813 #![allow(
814 unused_variables,
815 dead_code,
816 missing_docs,
817 clippy::wildcard_imports,
818 clippy::let_unit_value,
819 )]
820 use tonic::codegen::*;
821 #[async_trait]
823 pub trait ConnectorService: std::marker::Send + std::marker::Sync + 'static {
824 type SinkWriterStreamStream: tonic::codegen::tokio_stream::Stream<
826 Item = std::result::Result<
827 super::SinkWriterStreamResponse,
828 tonic::Status,
829 >,
830 >
831 + std::marker::Send
832 + 'static;
833 async fn sink_writer_stream(
834 &self,
835 request: tonic::Request<tonic::Streaming<super::SinkWriterStreamRequest>>,
836 ) -> std::result::Result<
837 tonic::Response<Self::SinkWriterStreamStream>,
838 tonic::Status,
839 >;
840 type SinkCoordinatorStreamStream: tonic::codegen::tokio_stream::Stream<
842 Item = std::result::Result<
843 super::SinkCoordinatorStreamResponse,
844 tonic::Status,
845 >,
846 >
847 + std::marker::Send
848 + 'static;
849 async fn sink_coordinator_stream(
850 &self,
851 request: tonic::Request<
852 tonic::Streaming<super::SinkCoordinatorStreamRequest>,
853 >,
854 ) -> std::result::Result<
855 tonic::Response<Self::SinkCoordinatorStreamStream>,
856 tonic::Status,
857 >;
858 async fn validate_sink(
859 &self,
860 request: tonic::Request<super::ValidateSinkRequest>,
861 ) -> std::result::Result<
862 tonic::Response<super::ValidateSinkResponse>,
863 tonic::Status,
864 >;
865 type GetEventStreamStream: tonic::codegen::tokio_stream::Stream<
867 Item = std::result::Result<super::GetEventStreamResponse, tonic::Status>,
868 >
869 + std::marker::Send
870 + 'static;
871 async fn get_event_stream(
872 &self,
873 request: tonic::Request<super::GetEventStreamRequest>,
874 ) -> std::result::Result<
875 tonic::Response<Self::GetEventStreamStream>,
876 tonic::Status,
877 >;
878 async fn validate_source(
879 &self,
880 request: tonic::Request<super::ValidateSourceRequest>,
881 ) -> std::result::Result<
882 tonic::Response<super::ValidateSourceResponse>,
883 tonic::Status,
884 >;
885 type OracleSnapshotReadStream: tonic::codegen::tokio_stream::Stream<
887 Item = std::result::Result<
888 super::OracleSnapshotReadResponse,
889 tonic::Status,
890 >,
891 >
892 + std::marker::Send
893 + 'static;
894 async fn oracle_snapshot_read(
899 &self,
900 request: tonic::Request<super::OracleSnapshotReadRequest>,
901 ) -> std::result::Result<
902 tonic::Response<Self::OracleSnapshotReadStream>,
903 tonic::Status,
904 >;
905 }
906 #[derive(Debug)]
907 pub struct ConnectorServiceServer<T> {
908 inner: Arc<T>,
909 accept_compression_encodings: EnabledCompressionEncodings,
910 send_compression_encodings: EnabledCompressionEncodings,
911 max_decoding_message_size: Option<usize>,
912 max_encoding_message_size: Option<usize>,
913 }
914 impl<T> ConnectorServiceServer<T> {
915 pub fn new(inner: T) -> Self {
916 Self::from_arc(Arc::new(inner))
917 }
918 pub fn from_arc(inner: Arc<T>) -> Self {
919 Self {
920 inner,
921 accept_compression_encodings: Default::default(),
922 send_compression_encodings: Default::default(),
923 max_decoding_message_size: None,
924 max_encoding_message_size: None,
925 }
926 }
927 pub fn with_interceptor<F>(
928 inner: T,
929 interceptor: F,
930 ) -> InterceptedService<Self, F>
931 where
932 F: tonic::service::Interceptor,
933 {
934 InterceptedService::new(Self::new(inner), interceptor)
935 }
936 #[must_use]
938 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
939 self.accept_compression_encodings.enable(encoding);
940 self
941 }
942 #[must_use]
944 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
945 self.send_compression_encodings.enable(encoding);
946 self
947 }
948 #[must_use]
952 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
953 self.max_decoding_message_size = Some(limit);
954 self
955 }
956 #[must_use]
960 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
961 self.max_encoding_message_size = Some(limit);
962 self
963 }
964 }
965 impl<T, B> tonic::codegen::Service<http::Request<B>> for ConnectorServiceServer<T>
966 where
967 T: ConnectorService,
968 B: Body + std::marker::Send + 'static,
969 B::Error: Into<StdError> + std::marker::Send + 'static,
970 {
971 type Response = http::Response<tonic::body::Body>;
972 type Error = std::convert::Infallible;
973 type Future = BoxFuture<Self::Response, Self::Error>;
974 fn poll_ready(
975 &mut self,
976 _cx: &mut Context<'_>,
977 ) -> Poll<std::result::Result<(), Self::Error>> {
978 Poll::Ready(Ok(()))
979 }
980 fn call(&mut self, req: http::Request<B>) -> Self::Future {
981 match req.uri().path() {
982 "/connector_service.ConnectorService/SinkWriterStream" => {
983 #[allow(non_camel_case_types)]
984 struct SinkWriterStreamSvc<T: ConnectorService>(pub Arc<T>);
985 impl<
986 T: ConnectorService,
987 > tonic::server::StreamingService<super::SinkWriterStreamRequest>
988 for SinkWriterStreamSvc<T> {
989 type Response = super::SinkWriterStreamResponse;
990 type ResponseStream = T::SinkWriterStreamStream;
991 type Future = BoxFuture<
992 tonic::Response<Self::ResponseStream>,
993 tonic::Status,
994 >;
995 fn call(
996 &mut self,
997 request: tonic::Request<
998 tonic::Streaming<super::SinkWriterStreamRequest>,
999 >,
1000 ) -> Self::Future {
1001 let inner = Arc::clone(&self.0);
1002 let fut = async move {
1003 <T as ConnectorService>::sink_writer_stream(&inner, request)
1004 .await
1005 };
1006 Box::pin(fut)
1007 }
1008 }
1009 let accept_compression_encodings = self.accept_compression_encodings;
1010 let send_compression_encodings = self.send_compression_encodings;
1011 let max_decoding_message_size = self.max_decoding_message_size;
1012 let max_encoding_message_size = self.max_encoding_message_size;
1013 let inner = self.inner.clone();
1014 let fut = async move {
1015 let method = SinkWriterStreamSvc(inner);
1016 let codec = tonic_prost::ProstCodec::default();
1017 let mut grpc = tonic::server::Grpc::new(codec)
1018 .apply_compression_config(
1019 accept_compression_encodings,
1020 send_compression_encodings,
1021 )
1022 .apply_max_message_size_config(
1023 max_decoding_message_size,
1024 max_encoding_message_size,
1025 );
1026 let res = grpc.streaming(method, req).await;
1027 Ok(res)
1028 };
1029 Box::pin(fut)
1030 }
1031 "/connector_service.ConnectorService/SinkCoordinatorStream" => {
1032 #[allow(non_camel_case_types)]
1033 struct SinkCoordinatorStreamSvc<T: ConnectorService>(pub Arc<T>);
1034 impl<
1035 T: ConnectorService,
1036 > tonic::server::StreamingService<
1037 super::SinkCoordinatorStreamRequest,
1038 > for SinkCoordinatorStreamSvc<T> {
1039 type Response = super::SinkCoordinatorStreamResponse;
1040 type ResponseStream = T::SinkCoordinatorStreamStream;
1041 type Future = BoxFuture<
1042 tonic::Response<Self::ResponseStream>,
1043 tonic::Status,
1044 >;
1045 fn call(
1046 &mut self,
1047 request: tonic::Request<
1048 tonic::Streaming<super::SinkCoordinatorStreamRequest>,
1049 >,
1050 ) -> Self::Future {
1051 let inner = Arc::clone(&self.0);
1052 let fut = async move {
1053 <T as ConnectorService>::sink_coordinator_stream(
1054 &inner,
1055 request,
1056 )
1057 .await
1058 };
1059 Box::pin(fut)
1060 }
1061 }
1062 let accept_compression_encodings = self.accept_compression_encodings;
1063 let send_compression_encodings = self.send_compression_encodings;
1064 let max_decoding_message_size = self.max_decoding_message_size;
1065 let max_encoding_message_size = self.max_encoding_message_size;
1066 let inner = self.inner.clone();
1067 let fut = async move {
1068 let method = SinkCoordinatorStreamSvc(inner);
1069 let codec = tonic_prost::ProstCodec::default();
1070 let mut grpc = tonic::server::Grpc::new(codec)
1071 .apply_compression_config(
1072 accept_compression_encodings,
1073 send_compression_encodings,
1074 )
1075 .apply_max_message_size_config(
1076 max_decoding_message_size,
1077 max_encoding_message_size,
1078 );
1079 let res = grpc.streaming(method, req).await;
1080 Ok(res)
1081 };
1082 Box::pin(fut)
1083 }
1084 "/connector_service.ConnectorService/ValidateSink" => {
1085 #[allow(non_camel_case_types)]
1086 struct ValidateSinkSvc<T: ConnectorService>(pub Arc<T>);
1087 impl<
1088 T: ConnectorService,
1089 > tonic::server::UnaryService<super::ValidateSinkRequest>
1090 for ValidateSinkSvc<T> {
1091 type Response = super::ValidateSinkResponse;
1092 type Future = BoxFuture<
1093 tonic::Response<Self::Response>,
1094 tonic::Status,
1095 >;
1096 fn call(
1097 &mut self,
1098 request: tonic::Request<super::ValidateSinkRequest>,
1099 ) -> Self::Future {
1100 let inner = Arc::clone(&self.0);
1101 let fut = async move {
1102 <T as ConnectorService>::validate_sink(&inner, request)
1103 .await
1104 };
1105 Box::pin(fut)
1106 }
1107 }
1108 let accept_compression_encodings = self.accept_compression_encodings;
1109 let send_compression_encodings = self.send_compression_encodings;
1110 let max_decoding_message_size = self.max_decoding_message_size;
1111 let max_encoding_message_size = self.max_encoding_message_size;
1112 let inner = self.inner.clone();
1113 let fut = async move {
1114 let method = ValidateSinkSvc(inner);
1115 let codec = tonic_prost::ProstCodec::default();
1116 let mut grpc = tonic::server::Grpc::new(codec)
1117 .apply_compression_config(
1118 accept_compression_encodings,
1119 send_compression_encodings,
1120 )
1121 .apply_max_message_size_config(
1122 max_decoding_message_size,
1123 max_encoding_message_size,
1124 );
1125 let res = grpc.unary(method, req).await;
1126 Ok(res)
1127 };
1128 Box::pin(fut)
1129 }
1130 "/connector_service.ConnectorService/GetEventStream" => {
1131 #[allow(non_camel_case_types)]
1132 struct GetEventStreamSvc<T: ConnectorService>(pub Arc<T>);
1133 impl<
1134 T: ConnectorService,
1135 > tonic::server::ServerStreamingService<super::GetEventStreamRequest>
1136 for GetEventStreamSvc<T> {
1137 type Response = super::GetEventStreamResponse;
1138 type ResponseStream = T::GetEventStreamStream;
1139 type Future = BoxFuture<
1140 tonic::Response<Self::ResponseStream>,
1141 tonic::Status,
1142 >;
1143 fn call(
1144 &mut self,
1145 request: tonic::Request<super::GetEventStreamRequest>,
1146 ) -> Self::Future {
1147 let inner = Arc::clone(&self.0);
1148 let fut = async move {
1149 <T as ConnectorService>::get_event_stream(&inner, request)
1150 .await
1151 };
1152 Box::pin(fut)
1153 }
1154 }
1155 let accept_compression_encodings = self.accept_compression_encodings;
1156 let send_compression_encodings = self.send_compression_encodings;
1157 let max_decoding_message_size = self.max_decoding_message_size;
1158 let max_encoding_message_size = self.max_encoding_message_size;
1159 let inner = self.inner.clone();
1160 let fut = async move {
1161 let method = GetEventStreamSvc(inner);
1162 let codec = tonic_prost::ProstCodec::default();
1163 let mut grpc = tonic::server::Grpc::new(codec)
1164 .apply_compression_config(
1165 accept_compression_encodings,
1166 send_compression_encodings,
1167 )
1168 .apply_max_message_size_config(
1169 max_decoding_message_size,
1170 max_encoding_message_size,
1171 );
1172 let res = grpc.server_streaming(method, req).await;
1173 Ok(res)
1174 };
1175 Box::pin(fut)
1176 }
1177 "/connector_service.ConnectorService/ValidateSource" => {
1178 #[allow(non_camel_case_types)]
1179 struct ValidateSourceSvc<T: ConnectorService>(pub Arc<T>);
1180 impl<
1181 T: ConnectorService,
1182 > tonic::server::UnaryService<super::ValidateSourceRequest>
1183 for ValidateSourceSvc<T> {
1184 type Response = super::ValidateSourceResponse;
1185 type Future = BoxFuture<
1186 tonic::Response<Self::Response>,
1187 tonic::Status,
1188 >;
1189 fn call(
1190 &mut self,
1191 request: tonic::Request<super::ValidateSourceRequest>,
1192 ) -> Self::Future {
1193 let inner = Arc::clone(&self.0);
1194 let fut = async move {
1195 <T as ConnectorService>::validate_source(&inner, request)
1196 .await
1197 };
1198 Box::pin(fut)
1199 }
1200 }
1201 let accept_compression_encodings = self.accept_compression_encodings;
1202 let send_compression_encodings = self.send_compression_encodings;
1203 let max_decoding_message_size = self.max_decoding_message_size;
1204 let max_encoding_message_size = self.max_encoding_message_size;
1205 let inner = self.inner.clone();
1206 let fut = async move {
1207 let method = ValidateSourceSvc(inner);
1208 let codec = tonic_prost::ProstCodec::default();
1209 let mut grpc = tonic::server::Grpc::new(codec)
1210 .apply_compression_config(
1211 accept_compression_encodings,
1212 send_compression_encodings,
1213 )
1214 .apply_max_message_size_config(
1215 max_decoding_message_size,
1216 max_encoding_message_size,
1217 );
1218 let res = grpc.unary(method, req).await;
1219 Ok(res)
1220 };
1221 Box::pin(fut)
1222 }
1223 "/connector_service.ConnectorService/OracleSnapshotRead" => {
1224 #[allow(non_camel_case_types)]
1225 struct OracleSnapshotReadSvc<T: ConnectorService>(pub Arc<T>);
1226 impl<
1227 T: ConnectorService,
1228 > tonic::server::ServerStreamingService<
1229 super::OracleSnapshotReadRequest,
1230 > for OracleSnapshotReadSvc<T> {
1231 type Response = super::OracleSnapshotReadResponse;
1232 type ResponseStream = T::OracleSnapshotReadStream;
1233 type Future = BoxFuture<
1234 tonic::Response<Self::ResponseStream>,
1235 tonic::Status,
1236 >;
1237 fn call(
1238 &mut self,
1239 request: tonic::Request<super::OracleSnapshotReadRequest>,
1240 ) -> Self::Future {
1241 let inner = Arc::clone(&self.0);
1242 let fut = async move {
1243 <T as ConnectorService>::oracle_snapshot_read(
1244 &inner,
1245 request,
1246 )
1247 .await
1248 };
1249 Box::pin(fut)
1250 }
1251 }
1252 let accept_compression_encodings = self.accept_compression_encodings;
1253 let send_compression_encodings = self.send_compression_encodings;
1254 let max_decoding_message_size = self.max_decoding_message_size;
1255 let max_encoding_message_size = self.max_encoding_message_size;
1256 let inner = self.inner.clone();
1257 let fut = async move {
1258 let method = OracleSnapshotReadSvc(inner);
1259 let codec = tonic_prost::ProstCodec::default();
1260 let mut grpc = tonic::server::Grpc::new(codec)
1261 .apply_compression_config(
1262 accept_compression_encodings,
1263 send_compression_encodings,
1264 )
1265 .apply_max_message_size_config(
1266 max_decoding_message_size,
1267 max_encoding_message_size,
1268 );
1269 let res = grpc.server_streaming(method, req).await;
1270 Ok(res)
1271 };
1272 Box::pin(fut)
1273 }
1274 _ => {
1275 Box::pin(async move {
1276 let mut response = http::Response::new(
1277 tonic::body::Body::default(),
1278 );
1279 let headers = response.headers_mut();
1280 headers
1281 .insert(
1282 tonic::Status::GRPC_STATUS,
1283 (tonic::Code::Unimplemented as i32).into(),
1284 );
1285 headers
1286 .insert(
1287 http::header::CONTENT_TYPE,
1288 tonic::metadata::GRPC_CONTENT_TYPE,
1289 );
1290 Ok(response)
1291 })
1292 }
1293 }
1294 }
1295 }
1296 impl<T> Clone for ConnectorServiceServer<T> {
1297 fn clone(&self) -> Self {
1298 let inner = self.inner.clone();
1299 Self {
1300 inner,
1301 accept_compression_encodings: self.accept_compression_encodings,
1302 send_compression_encodings: self.send_compression_encodings,
1303 max_decoding_message_size: self.max_decoding_message_size,
1304 max_encoding_message_size: self.max_encoding_message_size,
1305 }
1306 }
1307 }
1308 pub const SERVICE_NAME: &str = "connector_service.ConnectorService";
1310 impl<T> tonic::server::NamedService for ConnectorServiceServer<T> {
1311 const NAME: &'static str = SERVICE_NAME;
1312 }
1313}
1314pub mod sink_coordination_service_client {
1316 #![allow(
1317 unused_variables,
1318 dead_code,
1319 missing_docs,
1320 clippy::wildcard_imports,
1321 clippy::let_unit_value,
1322 )]
1323 use tonic::codegen::*;
1324 use tonic::codegen::http::Uri;
1325 #[derive(Debug, Clone)]
1326 pub struct SinkCoordinationServiceClient<T> {
1327 inner: tonic::client::Grpc<T>,
1328 }
1329 impl SinkCoordinationServiceClient<tonic::transport::Channel> {
1330 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1332 where
1333 D: TryInto<tonic::transport::Endpoint>,
1334 D::Error: Into<StdError>,
1335 {
1336 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1337 Ok(Self::new(conn))
1338 }
1339 }
1340 impl<T> SinkCoordinationServiceClient<T>
1341 where
1342 T: tonic::client::GrpcService<tonic::body::Body>,
1343 T::Error: Into<StdError>,
1344 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1345 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1346 {
1347 pub fn new(inner: T) -> Self {
1348 let inner = tonic::client::Grpc::new(inner);
1349 Self { inner }
1350 }
1351 pub fn with_origin(inner: T, origin: Uri) -> Self {
1352 let inner = tonic::client::Grpc::with_origin(inner, origin);
1353 Self { inner }
1354 }
1355 pub fn with_interceptor<F>(
1356 inner: T,
1357 interceptor: F,
1358 ) -> SinkCoordinationServiceClient<InterceptedService<T, F>>
1359 where
1360 F: tonic::service::Interceptor,
1361 T::ResponseBody: Default,
1362 T: tonic::codegen::Service<
1363 http::Request<tonic::body::Body>,
1364 Response = http::Response<
1365 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1366 >,
1367 >,
1368 <T as tonic::codegen::Service<
1369 http::Request<tonic::body::Body>,
1370 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1371 {
1372 SinkCoordinationServiceClient::new(
1373 InterceptedService::new(inner, interceptor),
1374 )
1375 }
1376 #[must_use]
1381 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1382 self.inner = self.inner.send_compressed(encoding);
1383 self
1384 }
1385 #[must_use]
1387 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1388 self.inner = self.inner.accept_compressed(encoding);
1389 self
1390 }
1391 #[must_use]
1395 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1396 self.inner = self.inner.max_decoding_message_size(limit);
1397 self
1398 }
1399 #[must_use]
1403 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1404 self.inner = self.inner.max_encoding_message_size(limit);
1405 self
1406 }
1407 pub async fn coordinate(
1408 &mut self,
1409 request: impl tonic::IntoStreamingRequest<Message = super::CoordinateRequest>,
1410 ) -> std::result::Result<
1411 tonic::Response<tonic::codec::Streaming<super::CoordinateResponse>>,
1412 tonic::Status,
1413 > {
1414 self.inner
1415 .ready()
1416 .await
1417 .map_err(|e| {
1418 tonic::Status::unknown(
1419 format!("Service was not ready: {}", e.into()),
1420 )
1421 })?;
1422 let codec = tonic_prost::ProstCodec::default();
1423 let path = http::uri::PathAndQuery::from_static(
1424 "/connector_service.SinkCoordinationService/Coordinate",
1425 );
1426 let mut req = request.into_streaming_request();
1427 req.extensions_mut()
1428 .insert(
1429 GrpcMethod::new(
1430 "connector_service.SinkCoordinationService",
1431 "Coordinate",
1432 ),
1433 );
1434 self.inner.streaming(req, path, codec).await
1435 }
1436 }
1437}
1438pub mod sink_coordination_service_server {
1440 #![allow(
1441 unused_variables,
1442 dead_code,
1443 missing_docs,
1444 clippy::wildcard_imports,
1445 clippy::let_unit_value,
1446 )]
1447 use tonic::codegen::*;
1448 #[async_trait]
1450 pub trait SinkCoordinationService: std::marker::Send + std::marker::Sync + 'static {
1451 type CoordinateStream: tonic::codegen::tokio_stream::Stream<
1453 Item = std::result::Result<super::CoordinateResponse, tonic::Status>,
1454 >
1455 + std::marker::Send
1456 + 'static;
1457 async fn coordinate(
1458 &self,
1459 request: tonic::Request<tonic::Streaming<super::CoordinateRequest>>,
1460 ) -> std::result::Result<tonic::Response<Self::CoordinateStream>, tonic::Status>;
1461 }
1462 #[derive(Debug)]
1463 pub struct SinkCoordinationServiceServer<T> {
1464 inner: Arc<T>,
1465 accept_compression_encodings: EnabledCompressionEncodings,
1466 send_compression_encodings: EnabledCompressionEncodings,
1467 max_decoding_message_size: Option<usize>,
1468 max_encoding_message_size: Option<usize>,
1469 }
1470 impl<T> SinkCoordinationServiceServer<T> {
1471 pub fn new(inner: T) -> Self {
1472 Self::from_arc(Arc::new(inner))
1473 }
1474 pub fn from_arc(inner: Arc<T>) -> Self {
1475 Self {
1476 inner,
1477 accept_compression_encodings: Default::default(),
1478 send_compression_encodings: Default::default(),
1479 max_decoding_message_size: None,
1480 max_encoding_message_size: None,
1481 }
1482 }
1483 pub fn with_interceptor<F>(
1484 inner: T,
1485 interceptor: F,
1486 ) -> InterceptedService<Self, F>
1487 where
1488 F: tonic::service::Interceptor,
1489 {
1490 InterceptedService::new(Self::new(inner), interceptor)
1491 }
1492 #[must_use]
1494 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1495 self.accept_compression_encodings.enable(encoding);
1496 self
1497 }
1498 #[must_use]
1500 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1501 self.send_compression_encodings.enable(encoding);
1502 self
1503 }
1504 #[must_use]
1508 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1509 self.max_decoding_message_size = Some(limit);
1510 self
1511 }
1512 #[must_use]
1516 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1517 self.max_encoding_message_size = Some(limit);
1518 self
1519 }
1520 }
1521 impl<T, B> tonic::codegen::Service<http::Request<B>>
1522 for SinkCoordinationServiceServer<T>
1523 where
1524 T: SinkCoordinationService,
1525 B: Body + std::marker::Send + 'static,
1526 B::Error: Into<StdError> + std::marker::Send + 'static,
1527 {
1528 type Response = http::Response<tonic::body::Body>;
1529 type Error = std::convert::Infallible;
1530 type Future = BoxFuture<Self::Response, Self::Error>;
1531 fn poll_ready(
1532 &mut self,
1533 _cx: &mut Context<'_>,
1534 ) -> Poll<std::result::Result<(), Self::Error>> {
1535 Poll::Ready(Ok(()))
1536 }
1537 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1538 match req.uri().path() {
1539 "/connector_service.SinkCoordinationService/Coordinate" => {
1540 #[allow(non_camel_case_types)]
1541 struct CoordinateSvc<T: SinkCoordinationService>(pub Arc<T>);
1542 impl<
1543 T: SinkCoordinationService,
1544 > tonic::server::StreamingService<super::CoordinateRequest>
1545 for CoordinateSvc<T> {
1546 type Response = super::CoordinateResponse;
1547 type ResponseStream = T::CoordinateStream;
1548 type Future = BoxFuture<
1549 tonic::Response<Self::ResponseStream>,
1550 tonic::Status,
1551 >;
1552 fn call(
1553 &mut self,
1554 request: tonic::Request<
1555 tonic::Streaming<super::CoordinateRequest>,
1556 >,
1557 ) -> Self::Future {
1558 let inner = Arc::clone(&self.0);
1559 let fut = async move {
1560 <T as SinkCoordinationService>::coordinate(&inner, request)
1561 .await
1562 };
1563 Box::pin(fut)
1564 }
1565 }
1566 let accept_compression_encodings = self.accept_compression_encodings;
1567 let send_compression_encodings = self.send_compression_encodings;
1568 let max_decoding_message_size = self.max_decoding_message_size;
1569 let max_encoding_message_size = self.max_encoding_message_size;
1570 let inner = self.inner.clone();
1571 let fut = async move {
1572 let method = CoordinateSvc(inner);
1573 let codec = tonic_prost::ProstCodec::default();
1574 let mut grpc = tonic::server::Grpc::new(codec)
1575 .apply_compression_config(
1576 accept_compression_encodings,
1577 send_compression_encodings,
1578 )
1579 .apply_max_message_size_config(
1580 max_decoding_message_size,
1581 max_encoding_message_size,
1582 );
1583 let res = grpc.streaming(method, req).await;
1584 Ok(res)
1585 };
1586 Box::pin(fut)
1587 }
1588 _ => {
1589 Box::pin(async move {
1590 let mut response = http::Response::new(
1591 tonic::body::Body::default(),
1592 );
1593 let headers = response.headers_mut();
1594 headers
1595 .insert(
1596 tonic::Status::GRPC_STATUS,
1597 (tonic::Code::Unimplemented as i32).into(),
1598 );
1599 headers
1600 .insert(
1601 http::header::CONTENT_TYPE,
1602 tonic::metadata::GRPC_CONTENT_TYPE,
1603 );
1604 Ok(response)
1605 })
1606 }
1607 }
1608 }
1609 }
1610 impl<T> Clone for SinkCoordinationServiceServer<T> {
1611 fn clone(&self) -> Self {
1612 let inner = self.inner.clone();
1613 Self {
1614 inner,
1615 accept_compression_encodings: self.accept_compression_encodings,
1616 send_compression_encodings: self.send_compression_encodings,
1617 max_decoding_message_size: self.max_decoding_message_size,
1618 max_encoding_message_size: self.max_encoding_message_size,
1619 }
1620 }
1621 }
1622 pub const SERVICE_NAME: &str = "connector_service.SinkCoordinationService";
1624 impl<T> tonic::server::NamedService for SinkCoordinationServiceServer<T> {
1625 const NAME: &'static str = SERVICE_NAME;
1626 }
1627}