#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutorConnectionRequest {
#[prost(message, optional, tag = "1")]
pub message: ::core::option::Option<ExecutorMessage>,
}
impl ::prost::Name for ExecutorConnectionRequest {
const NAME: &'static str = "ExecutorConnectionRequest";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutorConnectionRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutorConnectionRequest".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutorConnectionResponse {
#[prost(message, optional, tag = "1")]
pub message: ::core::option::Option<ServerMessage>,
}
impl ::prost::Name for ExecutorConnectionResponse {
const NAME: &'static str = "ExecutorConnectionResponse";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutorConnectionResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutorConnectionResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutorMessage {
#[prost(oneof = "executor_message::ExecutorMessageKind", tags = "1, 2, 3, 4")]
pub executor_message_kind: ::core::option::Option<executor_message::ExecutorMessageKind>,
}
pub mod executor_message {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ExecutorMessageKind {
#[prost(message, tag = "1")]
Capabilities(super::ExecutorCapabilities),
#[prost(message, tag = "2")]
Heartbeat(super::ExecutorHeartbeat),
#[prost(message, tag = "3")]
ExecutionSucceeded(super::ExecutionSucceeded),
#[prost(message, tag = "4")]
ExecutionFailed(super::ExecutionFailed),
}
}
impl ::prost::Name for ExecutorMessage {
const NAME: &'static str = "ExecutorMessage";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutorMessage".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutorMessage".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExecutorCapabilities {
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub job_queues: ::prost::alloc::vec::Vec<ExecutorJobQueue>,
}
impl ::prost::Name for ExecutorCapabilities {
const NAME: &'static str = "ExecutorCapabilities";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutorCapabilities".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutorCapabilities".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutorJobQueue {
#[prost(message, optional, tag = "1")]
pub job_type: ::core::option::Option<super::super::jobs::v1::JobType>,
#[prost(uint64, tag = "2")]
pub max_concurrent_executions: u64,
}
impl ::prost::Name for ExecutorJobQueue {
const NAME: &'static str = "ExecutorJobQueue";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutorJobQueue".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutorJobQueue".into()
}
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutorHeartbeat {}
impl ::prost::Name for ExecutorHeartbeat {
const NAME: &'static str = "ExecutorHeartbeat";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutorHeartbeat".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutorHeartbeat".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionSucceeded {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "3")]
pub output_payload_json: ::prost::alloc::string::String,
}
impl ::prost::Name for ExecutionSucceeded {
const NAME: &'static str = "ExecutionSucceeded";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutionSucceeded".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutionSucceeded".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionFailed {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, tag = "3")]
pub failure_reason: ::prost::alloc::string::String,
}
impl ::prost::Name for ExecutionFailed {
const NAME: &'static str = "ExecutionFailed";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutionFailed".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutionFailed".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ServerMessage {
#[prost(oneof = "server_message::ServerMessageKind", tags = "1, 2, 3")]
pub server_message_kind: ::core::option::Option<server_message::ServerMessageKind>,
}
pub mod server_message {
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
pub enum ServerMessageKind {
#[prost(message, tag = "1")]
Properties(super::ExecutorProperties),
#[prost(message, tag = "2")]
ExecutionReady(super::ExecutionReady),
#[prost(message, tag = "3")]
ExecutionCancelled(super::ExecutionCancelled),
}
}
impl ::prost::Name for ServerMessage {
const NAME: &'static str = "ServerMessage";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ServerMessage".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ServerMessage".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutorProperties {
#[prost(string, tag = "1")]
pub executor_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub max_heartbeat_interval: ::core::option::Option<::prost_types::Duration>,
}
impl ::prost::Name for ExecutorProperties {
const NAME: &'static str = "ExecutorProperties";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutorProperties".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutorProperties".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionReady {
#[prost(string, tag = "1")]
pub job_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub execution_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub job_type_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "4")]
pub attempt_number: u64,
#[prost(string, tag = "5")]
pub input_payload_json: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub target_execution_time: ::core::option::Option<::prost_types::Timestamp>,
}
impl ::prost::Name for ExecutionReady {
const NAME: &'static str = "ExecutionReady";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutionReady".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutionReady".into()
}
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ExecutionCancelled {
#[prost(string, tag = "1")]
pub execution_id: ::prost::alloc::string::String,
}
impl ::prost::Name for ExecutionCancelled {
const NAME: &'static str = "ExecutionCancelled";
const PACKAGE: &'static str = "ora.executors.v1";
fn full_name() -> ::prost::alloc::string::String {
"ora.executors.v1.ExecutionCancelled".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ora.executors.v1.ExecutionCancelled".into()
}
}
pub mod execution_service_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::*;
#[async_trait]
pub trait ExecutionService: std::marker::Send + std::marker::Sync + 'static {
async fn executor_connection(
&self,
request: tonic::Request<tonic::Streaming<super::ExecutorConnectionRequest>>,
) -> std::result::Result<
tonic::Response<BoxStream<super::ExecutorConnectionResponse>>,
tonic::Status,
> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
}
#[derive(Debug)]
pub struct ExecutionServiceServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> ExecutionServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for ExecutionServiceServer<T>
where
T: ExecutionService,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/ora.executors.v1.ExecutionService/ExecutorConnection" => {
#[allow(non_camel_case_types)]
struct ExecutorConnectionSvc<T: ExecutionService>(pub Arc<T>);
impl<T: ExecutionService>
tonic::server::StreamingService<super::ExecutorConnectionRequest>
for ExecutorConnectionSvc<T>
{
type Response = super::ExecutorConnectionResponse;
type ResponseStream = BoxStream<super::ExecutorConnectionResponse>;
type Future =
BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::ExecutorConnectionRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as ExecutionService>::executor_connection(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = ExecutorConnectionSvc(inner);
let codec = tonic_prost::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.streaming(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => Box::pin(async move {
let mut response = http::Response::new(tonic::body::Body::default());
let headers = response.headers_mut();
headers.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
}),
}
}
}
impl<T> Clone for ExecutionServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "ora.executors.v1.ExecutionService";
impl<T> tonic::server::NamedService for ExecutionServiceServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}