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<executor_message::ExecutorMessageKind>,
42}
43pub mod executor_message {
45 #[derive(Clone, PartialEq, ::prost::Oneof)]
47 pub enum ExecutorMessageKind {
48 #[prost(message, tag = "1")]
55 Capabilities(super::ExecutorCapabilities),
56 #[prost(message, tag = "2")]
58 Heartbeat(super::ExecutorHeartbeat),
59 #[prost(message, tag = "3")]
61 ExecutionSucceeded(super::ExecutionSucceeded),
62 #[prost(message, tag = "4")]
64 ExecutionFailed(super::ExecutionFailed),
65 }
66}
67impl ::prost::Name for ExecutorMessage {
68 const NAME: &'static str = "ExecutorMessage";
69 const PACKAGE: &'static str = "ora.executors.v1";
70 fn full_name() -> ::prost::alloc::string::String {
71 "ora.executors.v1.ExecutorMessage".into()
72 }
73 fn type_url() -> ::prost::alloc::string::String {
74 "/ora.executors.v1.ExecutorMessage".into()
75 }
76}
77#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct ExecutorCapabilities {
81 #[prost(string, tag = "1")]
83 pub name: ::prost::alloc::string::String,
84 #[prost(message, repeated, tag = "2")]
86 pub job_queues: ::prost::alloc::vec::Vec<ExecutorJobQueue>,
87}
88impl ::prost::Name for ExecutorCapabilities {
89 const NAME: &'static str = "ExecutorCapabilities";
90 const PACKAGE: &'static str = "ora.executors.v1";
91 fn full_name() -> ::prost::alloc::string::String {
92 "ora.executors.v1.ExecutorCapabilities".into()
93 }
94 fn type_url() -> ::prost::alloc::string::String {
95 "/ora.executors.v1.ExecutorCapabilities".into()
96 }
97}
98#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
100pub struct ExecutorJobQueue {
101 #[prost(message, optional, tag = "1")]
103 pub job_type: ::core::option::Option<super::super::jobs::v1::JobType>,
104 #[prost(uint64, tag = "2")]
106 pub max_concurrent_executions: u64,
107}
108impl ::prost::Name for ExecutorJobQueue {
109 const NAME: &'static str = "ExecutorJobQueue";
110 const PACKAGE: &'static str = "ora.executors.v1";
111 fn full_name() -> ::prost::alloc::string::String {
112 "ora.executors.v1.ExecutorJobQueue".into()
113 }
114 fn type_url() -> ::prost::alloc::string::String {
115 "/ora.executors.v1.ExecutorJobQueue".into()
116 }
117}
118#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
120pub struct ExecutorHeartbeat {}
121impl ::prost::Name for ExecutorHeartbeat {
122 const NAME: &'static str = "ExecutorHeartbeat";
123 const PACKAGE: &'static str = "ora.executors.v1";
124 fn full_name() -> ::prost::alloc::string::String {
125 "ora.executors.v1.ExecutorHeartbeat".into()
126 }
127 fn type_url() -> ::prost::alloc::string::String {
128 "/ora.executors.v1.ExecutorHeartbeat".into()
129 }
130}
131#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
133pub struct ExecutionSucceeded {
134 #[prost(string, tag = "1")]
136 pub execution_id: ::prost::alloc::string::String,
137 #[prost(message, optional, tag = "2")]
139 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
140 #[prost(string, tag = "3")]
142 pub output_payload_json: ::prost::alloc::string::String,
143}
144impl ::prost::Name for ExecutionSucceeded {
145 const NAME: &'static str = "ExecutionSucceeded";
146 const PACKAGE: &'static str = "ora.executors.v1";
147 fn full_name() -> ::prost::alloc::string::String {
148 "ora.executors.v1.ExecutionSucceeded".into()
149 }
150 fn type_url() -> ::prost::alloc::string::String {
151 "/ora.executors.v1.ExecutionSucceeded".into()
152 }
153}
154#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
156pub struct ExecutionFailed {
157 #[prost(string, tag = "1")]
159 pub execution_id: ::prost::alloc::string::String,
160 #[prost(message, optional, tag = "2")]
162 pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
163 #[prost(string, tag = "3")]
165 pub failure_reason: ::prost::alloc::string::String,
166}
167impl ::prost::Name for ExecutionFailed {
168 const NAME: &'static str = "ExecutionFailed";
169 const PACKAGE: &'static str = "ora.executors.v1";
170 fn full_name() -> ::prost::alloc::string::String {
171 "ora.executors.v1.ExecutionFailed".into()
172 }
173 fn type_url() -> ::prost::alloc::string::String {
174 "/ora.executors.v1.ExecutionFailed".into()
175 }
176}
177#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
179pub struct ServerMessage {
180 #[prost(oneof = "server_message::ServerMessageKind", tags = "1, 2, 3")]
182 pub server_message_kind: ::core::option::Option<server_message::ServerMessageKind>,
183}
184pub mod server_message {
186 #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
188 pub enum ServerMessageKind {
189 #[prost(message, tag = "1")]
191 Properties(super::ExecutorProperties),
192 #[prost(message, tag = "2")]
194 ExecutionReady(super::ExecutionReady),
195 #[prost(message, tag = "3")]
197 ExecutionCancelled(super::ExecutionCancelled),
198 }
199}
200impl ::prost::Name for ServerMessage {
201 const NAME: &'static str = "ServerMessage";
202 const PACKAGE: &'static str = "ora.executors.v1";
203 fn full_name() -> ::prost::alloc::string::String {
204 "ora.executors.v1.ServerMessage".into()
205 }
206 fn type_url() -> ::prost::alloc::string::String {
207 "/ora.executors.v1.ServerMessage".into()
208 }
209}
210#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
212pub struct ExecutorProperties {
213 #[prost(string, tag = "1")]
215 pub executor_id: ::prost::alloc::string::String,
216 #[prost(message, optional, tag = "2")]
226 pub max_heartbeat_interval: ::core::option::Option<::prost_types::Duration>,
227}
228impl ::prost::Name for ExecutorProperties {
229 const NAME: &'static str = "ExecutorProperties";
230 const PACKAGE: &'static str = "ora.executors.v1";
231 fn full_name() -> ::prost::alloc::string::String {
232 "ora.executors.v1.ExecutorProperties".into()
233 }
234 fn type_url() -> ::prost::alloc::string::String {
235 "/ora.executors.v1.ExecutorProperties".into()
236 }
237}
238#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
240pub struct ExecutionReady {
241 #[prost(string, tag = "1")]
243 pub job_id: ::prost::alloc::string::String,
244 #[prost(string, tag = "2")]
246 pub execution_id: ::prost::alloc::string::String,
247 #[prost(string, tag = "3")]
249 pub job_type_id: ::prost::alloc::string::String,
250 #[prost(uint64, tag = "4")]
254 pub attempt_number: u64,
255 #[prost(string, tag = "5")]
257 pub input_payload_json: ::prost::alloc::string::String,
258 #[prost(message, optional, tag = "6")]
260 pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
261}
262impl ::prost::Name for ExecutionReady {
263 const NAME: &'static str = "ExecutionReady";
264 const PACKAGE: &'static str = "ora.executors.v1";
265 fn full_name() -> ::prost::alloc::string::String {
266 "ora.executors.v1.ExecutionReady".into()
267 }
268 fn type_url() -> ::prost::alloc::string::String {
269 "/ora.executors.v1.ExecutionReady".into()
270 }
271}
272#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
274pub struct ExecutionCancelled {
275 #[prost(string, tag = "1")]
277 pub execution_id: ::prost::alloc::string::String,
278}
279impl ::prost::Name for ExecutionCancelled {
280 const NAME: &'static str = "ExecutionCancelled";
281 const PACKAGE: &'static str = "ora.executors.v1";
282 fn full_name() -> ::prost::alloc::string::String {
283 "ora.executors.v1.ExecutionCancelled".into()
284 }
285 fn type_url() -> ::prost::alloc::string::String {
286 "/ora.executors.v1.ExecutionCancelled".into()
287 }
288}
289pub mod execution_service_server {
291 #![allow(
292 unused_variables,
293 dead_code,
294 missing_docs,
295 clippy::wildcard_imports,
296 clippy::let_unit_value
297 )]
298 use tonic::codegen::*;
299 #[async_trait]
301 pub trait ExecutionService: std::marker::Send + std::marker::Sync + 'static {
302 async fn executor_connection(
304 &self,
305 request: tonic::Request<tonic::Streaming<super::ExecutorConnectionRequest>>,
306 ) -> std::result::Result<
307 tonic::Response<BoxStream<super::ExecutorConnectionResponse>>,
308 tonic::Status,
309 > {
310 Err(tonic::Status::unimplemented("Not yet implemented"))
311 }
312 }
313 #[derive(Debug)]
315 pub struct ExecutionServiceServer<T> {
316 inner: Arc<T>,
317 accept_compression_encodings: EnabledCompressionEncodings,
318 send_compression_encodings: EnabledCompressionEncodings,
319 max_decoding_message_size: Option<usize>,
320 max_encoding_message_size: Option<usize>,
321 }
322 impl<T> ExecutionServiceServer<T> {
323 pub fn new(inner: T) -> Self {
324 Self::from_arc(Arc::new(inner))
325 }
326 pub fn from_arc(inner: Arc<T>) -> Self {
327 Self {
328 inner,
329 accept_compression_encodings: Default::default(),
330 send_compression_encodings: Default::default(),
331 max_decoding_message_size: None,
332 max_encoding_message_size: None,
333 }
334 }
335 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
336 where
337 F: tonic::service::Interceptor,
338 {
339 InterceptedService::new(Self::new(inner), interceptor)
340 }
341 #[must_use]
343 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
344 self.accept_compression_encodings.enable(encoding);
345 self
346 }
347 #[must_use]
349 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
350 self.send_compression_encodings.enable(encoding);
351 self
352 }
353 #[must_use]
357 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
358 self.max_decoding_message_size = Some(limit);
359 self
360 }
361 #[must_use]
365 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
366 self.max_encoding_message_size = Some(limit);
367 self
368 }
369 }
370 impl<T, B> tonic::codegen::Service<http::Request<B>> for ExecutionServiceServer<T>
371 where
372 T: ExecutionService,
373 B: Body + std::marker::Send + 'static,
374 B::Error: Into<StdError> + std::marker::Send + 'static,
375 {
376 type Response = http::Response<tonic::body::Body>;
377 type Error = std::convert::Infallible;
378 type Future = BoxFuture<Self::Response, Self::Error>;
379 fn poll_ready(
380 &mut self,
381 _cx: &mut Context<'_>,
382 ) -> Poll<std::result::Result<(), Self::Error>> {
383 Poll::Ready(Ok(()))
384 }
385 fn call(&mut self, req: http::Request<B>) -> Self::Future {
386 match req.uri().path() {
387 "/ora.executors.v1.ExecutionService/ExecutorConnection" => {
388 #[allow(non_camel_case_types)]
389 struct ExecutorConnectionSvc<T: ExecutionService>(pub Arc<T>);
390 impl<T: ExecutionService>
391 tonic::server::StreamingService<super::ExecutorConnectionRequest>
392 for ExecutorConnectionSvc<T>
393 {
394 type Response = super::ExecutorConnectionResponse;
395 type ResponseStream = BoxStream<super::ExecutorConnectionResponse>;
396 type Future =
397 BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
398 fn call(
399 &mut self,
400 request: tonic::Request<
401 tonic::Streaming<super::ExecutorConnectionRequest>,
402 >,
403 ) -> Self::Future {
404 let inner = Arc::clone(&self.0);
405 let fut = async move {
406 <T as ExecutionService>::executor_connection(&inner, request).await
407 };
408 Box::pin(fut)
409 }
410 }
411 let accept_compression_encodings = self.accept_compression_encodings;
412 let send_compression_encodings = self.send_compression_encodings;
413 let max_decoding_message_size = self.max_decoding_message_size;
414 let max_encoding_message_size = self.max_encoding_message_size;
415 let inner = self.inner.clone();
416 let fut = async move {
417 let method = ExecutorConnectionSvc(inner);
418 let codec = tonic_prost::ProstCodec::default();
419 let mut grpc = tonic::server::Grpc::new(codec)
420 .apply_compression_config(
421 accept_compression_encodings,
422 send_compression_encodings,
423 )
424 .apply_max_message_size_config(
425 max_decoding_message_size,
426 max_encoding_message_size,
427 );
428 let res = grpc.streaming(method, req).await;
429 Ok(res)
430 };
431 Box::pin(fut)
432 }
433 _ => Box::pin(async move {
434 let mut response = http::Response::new(tonic::body::Body::default());
435 let headers = response.headers_mut();
436 headers.insert(
437 tonic::Status::GRPC_STATUS,
438 (tonic::Code::Unimplemented as i32).into(),
439 );
440 headers.insert(
441 http::header::CONTENT_TYPE,
442 tonic::metadata::GRPC_CONTENT_TYPE,
443 );
444 Ok(response)
445 }),
446 }
447 }
448 }
449 impl<T> Clone for ExecutionServiceServer<T> {
450 fn clone(&self) -> Self {
451 let inner = self.inner.clone();
452 Self {
453 inner,
454 accept_compression_encodings: self.accept_compression_encodings,
455 send_compression_encodings: self.send_compression_encodings,
456 max_decoding_message_size: self.max_decoding_message_size,
457 max_encoding_message_size: self.max_encoding_message_size,
458 }
459 }
460 }
461 pub const SERVICE_NAME: &str = "ora.executors.v1.ExecutionService";
463 impl<T> tonic::server::NamedService for ExecutionServiceServer<T> {
464 const NAME: &'static str = SERVICE_NAME;
465 }
466}