1#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct ExecutorConnectionRequest {
5 #[prost(message, optional, tag = "1")]
7 pub message: ::core::option::Option<ExecutorMessage>,
8}
9impl ::prost::Name for ExecutorConnectionRequest {
10 const NAME: &'static str = "ExecutorConnectionRequest";
11 const PACKAGE: &'static str = "ora.executors.v1";
12 fn full_name() -> ::prost::alloc::string::String {
13 "ora.executors.v1.ExecutorConnectionRequest".into()
14 }
15 fn type_url() -> ::prost::alloc::string::String {
16 "/ora.executors.v1.ExecutorConnectionRequest".into()
17 }
18}
19#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
21pub struct ExecutorConnectionResponse {
22 #[prost(message, optional, tag = "1")]
24 pub message: ::core::option::Option<ServerMessage>,
25}
26impl ::prost::Name for ExecutorConnectionResponse {
27 const NAME: &'static str = "ExecutorConnectionResponse";
28 const PACKAGE: &'static str = "ora.executors.v1";
29 fn full_name() -> ::prost::alloc::string::String {
30 "ora.executors.v1.ExecutorConnectionResponse".into()
31 }
32 fn type_url() -> ::prost::alloc::string::String {
33 "/ora.executors.v1.ExecutorConnectionResponse".into()
34 }
35}
36#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct ExecutorMessage {
39 #[prost(oneof = "executor_message::ExecutorMessageKind", tags = "1, 2, 3, 4")]
41 pub executor_message_kind: ::core::option::Option<
42 executor_message::ExecutorMessageKind,
43 >,
44}
45pub mod executor_message {
47 #[derive(Clone, PartialEq, ::prost::Oneof)]
49 pub enum ExecutorMessageKind {
50 #[prost(message, tag = "1")]
57 Capabilities(super::ExecutorCapabilities),
58 #[prost(message, tag = "2")]
60 Heartbeat(super::ExecutorHeartbeat),
61 #[prost(message, tag = "3")]
63 ExecutionSucceeded(super::ExecutionSucceeded),
64 #[prost(message, tag = "4")]
66 ExecutionFailed(super::ExecutionFailed),
67 }
68}
69impl ::prost::Name for ExecutorMessage {
70 const NAME: &'static str = "ExecutorMessage";
71 const PACKAGE: &'static str = "ora.executors.v1";
72 fn full_name() -> ::prost::alloc::string::String {
73 "ora.executors.v1.ExecutorMessage".into()
74 }
75 fn type_url() -> ::prost::alloc::string::String {
76 "/ora.executors.v1.ExecutorMessage".into()
77 }
78}
79#[derive(Clone, PartialEq, ::prost::Message)]
82pub struct ExecutorCapabilities {
83 #[prost(string, tag = "1")]
85 pub name: ::prost::alloc::string::String,
86 #[prost(message, repeated, tag = "2")]
88 pub job_queues: ::prost::alloc::vec::Vec<ExecutorJobQueue>,
89}
90impl ::prost::Name for ExecutorCapabilities {
91 const NAME: &'static str = "ExecutorCapabilities";
92 const PACKAGE: &'static str = "ora.executors.v1";
93 fn full_name() -> ::prost::alloc::string::String {
94 "ora.executors.v1.ExecutorCapabilities".into()
95 }
96 fn type_url() -> ::prost::alloc::string::String {
97 "/ora.executors.v1.ExecutorCapabilities".into()
98 }
99}
100#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
102pub struct ExecutorJobQueue {
103 #[prost(message, optional, tag = "1")]
105 pub job_type: ::core::option::Option<super::super::jobs::v1::JobType>,
106 #[prost(uint64, tag = "2")]
108 pub max_concurrent_executions: u64,
109}
110impl ::prost::Name for ExecutorJobQueue {
111 const NAME: &'static str = "ExecutorJobQueue";
112 const PACKAGE: &'static str = "ora.executors.v1";
113 fn full_name() -> ::prost::alloc::string::String {
114 "ora.executors.v1.ExecutorJobQueue".into()
115 }
116 fn type_url() -> ::prost::alloc::string::String {
117 "/ora.executors.v1.ExecutorJobQueue".into()
118 }
119}
120#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
122pub struct ExecutorHeartbeat {}
123impl ::prost::Name for ExecutorHeartbeat {
124 const NAME: &'static str = "ExecutorHeartbeat";
125 const PACKAGE: &'static str = "ora.executors.v1";
126 fn full_name() -> ::prost::alloc::string::String {
127 "ora.executors.v1.ExecutorHeartbeat".into()
128 }
129 fn type_url() -> ::prost::alloc::string::String {
130 "/ora.executors.v1.ExecutorHeartbeat".into()
131 }
132}
133#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
135pub struct ExecutionSucceeded {
136 #[prost(string, tag = "1")]
138 pub execution_id: ::prost::alloc::string::String,
139 #[prost(message, optional, tag = "2")]
141 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
142 #[prost(string, tag = "3")]
144 pub output_payload_json: ::prost::alloc::string::String,
145}
146impl ::prost::Name for ExecutionSucceeded {
147 const NAME: &'static str = "ExecutionSucceeded";
148 const PACKAGE: &'static str = "ora.executors.v1";
149 fn full_name() -> ::prost::alloc::string::String {
150 "ora.executors.v1.ExecutionSucceeded".into()
151 }
152 fn type_url() -> ::prost::alloc::string::String {
153 "/ora.executors.v1.ExecutionSucceeded".into()
154 }
155}
156#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
158pub struct ExecutionFailed {
159 #[prost(string, tag = "1")]
161 pub execution_id: ::prost::alloc::string::String,
162 #[prost(message, optional, tag = "2")]
164 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
165 #[prost(string, tag = "3")]
167 pub failure_reason: ::prost::alloc::string::String,
168}
169impl ::prost::Name for ExecutionFailed {
170 const NAME: &'static str = "ExecutionFailed";
171 const PACKAGE: &'static str = "ora.executors.v1";
172 fn full_name() -> ::prost::alloc::string::String {
173 "ora.executors.v1.ExecutionFailed".into()
174 }
175 fn type_url() -> ::prost::alloc::string::String {
176 "/ora.executors.v1.ExecutionFailed".into()
177 }
178}
179#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
181pub struct ServerMessage {
182 #[prost(oneof = "server_message::ServerMessageKind", tags = "1, 2, 3")]
184 pub server_message_kind: ::core::option::Option<server_message::ServerMessageKind>,
185}
186pub mod server_message {
188 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
190 pub enum ServerMessageKind {
191 #[prost(message, tag = "1")]
193 Properties(super::ExecutorProperties),
194 #[prost(message, tag = "2")]
196 ExecutionReady(super::ExecutionReady),
197 #[prost(message, tag = "3")]
199 ExecutionCancelled(super::ExecutionCancelled),
200 }
201}
202impl ::prost::Name for ServerMessage {
203 const NAME: &'static str = "ServerMessage";
204 const PACKAGE: &'static str = "ora.executors.v1";
205 fn full_name() -> ::prost::alloc::string::String {
206 "ora.executors.v1.ServerMessage".into()
207 }
208 fn type_url() -> ::prost::alloc::string::String {
209 "/ora.executors.v1.ServerMessage".into()
210 }
211}
212#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
214pub struct ExecutorProperties {
215 #[prost(string, tag = "1")]
217 pub executor_id: ::prost::alloc::string::String,
218 #[prost(message, optional, tag = "2")]
228 pub max_heartbeat_interval: ::core::option::Option<::prost_types::Duration>,
229}
230impl ::prost::Name for ExecutorProperties {
231 const NAME: &'static str = "ExecutorProperties";
232 const PACKAGE: &'static str = "ora.executors.v1";
233 fn full_name() -> ::prost::alloc::string::String {
234 "ora.executors.v1.ExecutorProperties".into()
235 }
236 fn type_url() -> ::prost::alloc::string::String {
237 "/ora.executors.v1.ExecutorProperties".into()
238 }
239}
240#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
242pub struct ExecutionReady {
243 #[prost(string, tag = "1")]
245 pub job_id: ::prost::alloc::string::String,
246 #[prost(string, tag = "2")]
248 pub execution_id: ::prost::alloc::string::String,
249 #[prost(string, tag = "3")]
251 pub job_type_id: ::prost::alloc::string::String,
252 #[prost(uint64, tag = "4")]
256 pub attempt_number: u64,
257 #[prost(string, tag = "5")]
259 pub input_payload_json: ::prost::alloc::string::String,
260 #[prost(message, optional, tag = "6")]
262 pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
263}
264impl ::prost::Name for ExecutionReady {
265 const NAME: &'static str = "ExecutionReady";
266 const PACKAGE: &'static str = "ora.executors.v1";
267 fn full_name() -> ::prost::alloc::string::String {
268 "ora.executors.v1.ExecutionReady".into()
269 }
270 fn type_url() -> ::prost::alloc::string::String {
271 "/ora.executors.v1.ExecutionReady".into()
272 }
273}
274#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
276pub struct ExecutionCancelled {
277 #[prost(string, tag = "1")]
279 pub execution_id: ::prost::alloc::string::String,
280}
281impl ::prost::Name for ExecutionCancelled {
282 const NAME: &'static str = "ExecutionCancelled";
283 const PACKAGE: &'static str = "ora.executors.v1";
284 fn full_name() -> ::prost::alloc::string::String {
285 "ora.executors.v1.ExecutionCancelled".into()
286 }
287 fn type_url() -> ::prost::alloc::string::String {
288 "/ora.executors.v1.ExecutionCancelled".into()
289 }
290}
291pub mod execution_service_server {
293 #![allow(
294 unused_variables,
295 dead_code,
296 missing_docs,
297 clippy::wildcard_imports,
298 clippy::let_unit_value,
299 )]
300 use tonic::codegen::*;
301 #[async_trait]
303 pub trait ExecutionService: std::marker::Send + std::marker::Sync + 'static {
304 async fn executor_connection(
306 &self,
307 request: tonic::Request<tonic::Streaming<super::ExecutorConnectionRequest>>,
308 ) -> std::result::Result<
309 tonic::Response<BoxStream<super::ExecutorConnectionResponse>>,
310 tonic::Status,
311 > {
312 Err(tonic::Status::unimplemented("Not yet implemented"))
313 }
314 }
315 #[derive(Debug)]
317 pub struct ExecutionServiceServer<T> {
318 inner: Arc<T>,
319 accept_compression_encodings: EnabledCompressionEncodings,
320 send_compression_encodings: EnabledCompressionEncodings,
321 max_decoding_message_size: Option<usize>,
322 max_encoding_message_size: Option<usize>,
323 }
324 impl<T> ExecutionServiceServer<T> {
325 pub fn new(inner: T) -> Self {
326 Self::from_arc(Arc::new(inner))
327 }
328 pub fn from_arc(inner: Arc<T>) -> Self {
329 Self {
330 inner,
331 accept_compression_encodings: Default::default(),
332 send_compression_encodings: Default::default(),
333 max_decoding_message_size: None,
334 max_encoding_message_size: None,
335 }
336 }
337 pub fn with_interceptor<F>(
338 inner: T,
339 interceptor: F,
340 ) -> InterceptedService<Self, F>
341 where
342 F: tonic::service::Interceptor,
343 {
344 InterceptedService::new(Self::new(inner), interceptor)
345 }
346 #[must_use]
348 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
349 self.accept_compression_encodings.enable(encoding);
350 self
351 }
352 #[must_use]
354 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
355 self.send_compression_encodings.enable(encoding);
356 self
357 }
358 #[must_use]
362 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
363 self.max_decoding_message_size = Some(limit);
364 self
365 }
366 #[must_use]
370 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
371 self.max_encoding_message_size = Some(limit);
372 self
373 }
374 }
375 impl<T, B> tonic::codegen::Service<http::Request<B>> for ExecutionServiceServer<T>
376 where
377 T: ExecutionService,
378 B: Body + std::marker::Send + 'static,
379 B::Error: Into<StdError> + std::marker::Send + 'static,
380 {
381 type Response = http::Response<tonic::body::Body>;
382 type Error = std::convert::Infallible;
383 type Future = BoxFuture<Self::Response, Self::Error>;
384 fn poll_ready(
385 &mut self,
386 _cx: &mut Context<'_>,
387 ) -> Poll<std::result::Result<(), Self::Error>> {
388 Poll::Ready(Ok(()))
389 }
390 fn call(&mut self, req: http::Request<B>) -> Self::Future {
391 match req.uri().path() {
392 "/ora.executors.v1.ExecutionService/ExecutorConnection" => {
393 #[allow(non_camel_case_types)]
394 struct ExecutorConnectionSvc<T: ExecutionService>(pub Arc<T>);
395 impl<
396 T: ExecutionService,
397 > tonic::server::StreamingService<super::ExecutorConnectionRequest>
398 for ExecutorConnectionSvc<T> {
399 type Response = super::ExecutorConnectionResponse;
400 type ResponseStream = BoxStream<
401 super::ExecutorConnectionResponse,
402 >;
403 type Future = BoxFuture<
404 tonic::Response<Self::ResponseStream>,
405 tonic::Status,
406 >;
407 fn call(
408 &mut self,
409 request: tonic::Request<
410 tonic::Streaming<super::ExecutorConnectionRequest>,
411 >,
412 ) -> Self::Future {
413 let inner = Arc::clone(&self.0);
414 let fut = async move {
415 <T as ExecutionService>::executor_connection(
416 &inner,
417 request,
418 )
419 .await
420 };
421 Box::pin(fut)
422 }
423 }
424 let accept_compression_encodings = self.accept_compression_encodings;
425 let send_compression_encodings = self.send_compression_encodings;
426 let max_decoding_message_size = self.max_decoding_message_size;
427 let max_encoding_message_size = self.max_encoding_message_size;
428 let inner = self.inner.clone();
429 let fut = async move {
430 let method = ExecutorConnectionSvc(inner);
431 let codec = tonic_prost::ProstCodec::default();
432 let mut grpc = tonic::server::Grpc::new(codec)
433 .apply_compression_config(
434 accept_compression_encodings,
435 send_compression_encodings,
436 )
437 .apply_max_message_size_config(
438 max_decoding_message_size,
439 max_encoding_message_size,
440 );
441 let res = grpc.streaming(method, req).await;
442 Ok(res)
443 };
444 Box::pin(fut)
445 }
446 _ => {
447 Box::pin(async move {
448 let mut response = http::Response::new(
449 tonic::body::Body::default(),
450 );
451 let headers = response.headers_mut();
452 headers
453 .insert(
454 tonic::Status::GRPC_STATUS,
455 (tonic::Code::Unimplemented as i32).into(),
456 );
457 headers
458 .insert(
459 http::header::CONTENT_TYPE,
460 tonic::metadata::GRPC_CONTENT_TYPE,
461 );
462 Ok(response)
463 })
464 }
465 }
466 }
467 }
468 impl<T> Clone for ExecutionServiceServer<T> {
469 fn clone(&self) -> Self {
470 let inner = self.inner.clone();
471 Self {
472 inner,
473 accept_compression_encodings: self.accept_compression_encodings,
474 send_compression_encodings: self.send_compression_encodings,
475 max_decoding_message_size: self.max_decoding_message_size,
476 max_encoding_message_size: self.max_encoding_message_size,
477 }
478 }
479 }
480 pub const SERVICE_NAME: &str = "ora.executors.v1.ExecutionService";
482 impl<T> tonic::server::NamedService for ExecutionServiceServer<T> {
483 const NAME: &'static str = SERVICE_NAME;
484 }
485}