#[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_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value
)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct ExecutionServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl<T> ExecutionServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ExecutionServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<http::Request<tonic::body::Body>>>::Error:
Into<StdError> + std::marker::Send + std::marker::Sync,
{
ExecutionServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn executor_connection(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::ExecutorConnectionRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::ExecutorConnectionResponse>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
})?;
let codec = tonic_prost::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/ora.executors.v1.ExecutionService/ExecutorConnection",
);
let mut req = request.into_streaming_request();
req.extensions_mut().insert(GrpcMethod::new(
"ora.executors.v1.ExecutionService",
"ExecutorConnection",
));
self.inner.streaming(req, path, codec).await
}
}
}