#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegisterPeerRequest {
#[prost(message, optional, tag = "1")]
pub download: ::core::option::Option<super::super::common::v2::Download>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPeerStartedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPeerBackToSourceStartedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReschedulePeerRequest {
#[prost(message, repeated, tag = "1")]
pub candidate_parents: ::prost::alloc::vec::Vec<super::super::common::v2::Peer>,
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPeerFinishedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPeerBackToSourceFinishedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPeerFailedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPeerBackToSourceFailedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPieceFinishedRequest {
#[prost(message, optional, tag = "1")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPieceBackToSourceFinishedRequest {
#[prost(message, optional, tag = "1")]
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPieceFailedRequest {
#[prost(uint32, optional, tag = "1")]
pub piece_number: ::core::option::Option<u32>,
#[prost(string, tag = "2")]
pub parent_id: ::prost::alloc::string::String,
#[prost(bool, tag = "3")]
pub temporary: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DownloadPieceBackToSourceFailedRequest {
#[prost(uint32, optional, tag = "1")]
pub piece_number: ::core::option::Option<u32>,
#[prost(
oneof = "download_piece_back_to_source_failed_request::Response",
tags = "2, 3"
)]
pub response: ::core::option::Option<
download_piece_back_to_source_failed_request::Response,
>,
}
pub mod download_piece_back_to_source_failed_request {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "2")]
Backend(super::super::super::errordetails::v2::Backend),
#[prost(message, tag = "3")]
Unknown(super::super::super::errordetails::v2::Unknown),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnouncePeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(
oneof = "announce_peer_request::Request",
tags = "4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15"
)]
pub request: ::core::option::Option<announce_peer_request::Request>,
}
pub mod announce_peer_request {
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::large_enum_variant)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Request {
#[prost(message, tag = "4")]
RegisterPeerRequest(super::RegisterPeerRequest),
#[prost(message, tag = "5")]
DownloadPeerStartedRequest(super::DownloadPeerStartedRequest),
#[prost(message, tag = "6")]
DownloadPeerBackToSourceStartedRequest(
super::DownloadPeerBackToSourceStartedRequest,
),
#[prost(message, tag = "7")]
ReschedulePeerRequest(super::ReschedulePeerRequest),
#[prost(message, tag = "8")]
DownloadPeerFinishedRequest(super::DownloadPeerFinishedRequest),
#[prost(message, tag = "9")]
DownloadPeerBackToSourceFinishedRequest(
super::DownloadPeerBackToSourceFinishedRequest,
),
#[prost(message, tag = "10")]
DownloadPeerFailedRequest(super::DownloadPeerFailedRequest),
#[prost(message, tag = "11")]
DownloadPeerBackToSourceFailedRequest(
super::DownloadPeerBackToSourceFailedRequest,
),
#[prost(message, tag = "12")]
DownloadPieceFinishedRequest(super::DownloadPieceFinishedRequest),
#[prost(message, tag = "13")]
DownloadPieceBackToSourceFinishedRequest(
super::DownloadPieceBackToSourceFinishedRequest,
),
#[prost(message, tag = "14")]
DownloadPieceFailedRequest(super::DownloadPieceFailedRequest),
#[prost(message, tag = "15")]
DownloadPieceBackToSourceFailedRequest(
super::DownloadPieceBackToSourceFailedRequest,
),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EmptyTaskResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NormalTaskResponse {
#[prost(message, repeated, tag = "1")]
pub candidate_parents: ::prost::alloc::vec::Vec<super::super::common::v2::Peer>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct NeedBackToSourceResponse {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnouncePeerResponse {
#[prost(oneof = "announce_peer_response::Response", tags = "1, 2, 3")]
pub response: ::core::option::Option<announce_peer_response::Response>,
}
pub mod announce_peer_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "1")]
EmptyTaskResponse(super::EmptyTaskResponse),
#[prost(message, tag = "2")]
NormalTaskResponse(super::NormalTaskResponse),
#[prost(message, tag = "3")]
NeedBackToSourceResponse(super::NeedBackToSourceResponse),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatTaskRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteTaskRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnounceHostRequest {
#[prost(message, optional, tag = "1")]
pub host: ::core::option::Option<super::super::common::v2::Host>,
#[prost(message, optional, tag = "2")]
pub interval: ::core::option::Option<::prost_wkt_types::Duration>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListHostsRequest {
#[prost(uint32, optional, tag = "1")]
pub r#type: ::core::option::Option<u32>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListHostsResponse {
#[prost(message, repeated, tag = "1")]
pub hosts: ::prost::alloc::vec::Vec<super::super::common::v2::Host>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteHostRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegisterCachePeerRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub digest: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "3")]
pub range: ::core::option::Option<super::super::common::v2::Range>,
#[prost(enumeration = "super::super::common::v2::TaskType", tag = "4")]
pub r#type: i32,
#[prost(string, optional, tag = "5")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "super::super::common::v2::Priority", tag = "7")]
pub priority: i32,
#[prost(string, repeated, tag = "8")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "9")]
pub request_header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(uint64, optional, tag = "10")]
pub piece_length: ::core::option::Option<u64>,
#[prost(string, optional, tag = "11")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "12")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(bool, tag = "13")]
pub disable_back_to_source: bool,
#[prost(bool, tag = "14")]
pub need_back_to_source: bool,
#[prost(bytes = "vec", repeated, tag = "15")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(bool, tag = "16")]
pub prefetch: bool,
#[prost(message, optional, tag = "17")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(message, optional, tag = "18")]
pub hdfs: ::core::option::Option<super::super::common::v2::Hdfs>,
#[prost(bool, tag = "19")]
pub is_prefetch: bool,
#[prost(bool, tag = "20")]
pub need_piece_content: bool,
#[prost(string, optional, tag = "21")]
pub content_for_calculating_task_id: ::core::option::Option<
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "22")]
pub remote_ip: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "23")]
pub concurrent_piece_count: ::core::option::Option<u32>,
#[prost(uint64, optional, tag = "24")]
pub actual_piece_length: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "25")]
pub actual_content_length: ::core::option::Option<u64>,
#[prost(uint64, optional, tag = "26")]
pub actual_piece_count: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePeerStartedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePeerBackToSourceStartedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RescheduleCachePeerRequest {
#[prost(message, repeated, tag = "1")]
pub candidate_parents: ::prost::alloc::vec::Vec<super::super::common::v2::CachePeer>,
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePeerFinishedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePeerBackToSourceFinishedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePeerFailedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadCachePeerBackToSourceFailedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnounceCachePeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(
oneof = "announce_cache_peer_request::Request",
tags = "4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15"
)]
pub request: ::core::option::Option<announce_cache_peer_request::Request>,
}
pub mod announce_cache_peer_request {
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::large_enum_variant)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Request {
#[prost(message, tag = "4")]
RegisterCachePeerRequest(super::RegisterCachePeerRequest),
#[prost(message, tag = "5")]
DownloadCachePeerStartedRequest(super::DownloadCachePeerStartedRequest),
#[prost(message, tag = "6")]
DownloadCachePeerBackToSourceStartedRequest(
super::DownloadCachePeerBackToSourceStartedRequest,
),
#[prost(message, tag = "7")]
RescheduleCachePeerRequest(super::RescheduleCachePeerRequest),
#[prost(message, tag = "8")]
DownloadCachePeerFinishedRequest(super::DownloadCachePeerFinishedRequest),
#[prost(message, tag = "9")]
DownloadCachePeerBackToSourceFinishedRequest(
super::DownloadCachePeerBackToSourceFinishedRequest,
),
#[prost(message, tag = "10")]
DownloadCachePeerFailedRequest(super::DownloadCachePeerFailedRequest),
#[prost(message, tag = "11")]
DownloadCachePeerBackToSourceFailedRequest(
super::DownloadCachePeerBackToSourceFailedRequest,
),
#[prost(message, tag = "12")]
DownloadPieceFinishedRequest(super::DownloadPieceFinishedRequest),
#[prost(message, tag = "13")]
DownloadPieceBackToSourceFinishedRequest(
super::DownloadPieceBackToSourceFinishedRequest,
),
#[prost(message, tag = "14")]
DownloadPieceFailedRequest(super::DownloadPieceFailedRequest),
#[prost(message, tag = "15")]
DownloadPieceBackToSourceFailedRequest(
super::DownloadPieceBackToSourceFailedRequest,
),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EmptyCacheTaskResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NormalCacheTaskResponse {
#[prost(message, repeated, tag = "1")]
pub candidate_parents: ::prost::alloc::vec::Vec<super::super::common::v2::CachePeer>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnounceCachePeerResponse {
#[prost(oneof = "announce_cache_peer_response::Response", tags = "1, 2, 3")]
pub response: ::core::option::Option<announce_cache_peer_response::Response>,
}
pub mod announce_cache_peer_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "1")]
EmptyCacheTaskResponse(super::EmptyCacheTaskResponse),
#[prost(message, tag = "2")]
NormalCacheTaskResponse(super::NormalCacheTaskResponse),
#[prost(message, tag = "3")]
NeedBackToSourceResponse(super::NeedBackToSourceResponse),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatCachePeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteCachePeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatCacheTaskRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteCacheTaskRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RegisterPersistentPeerRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(bool, tag = "3")]
pub persistent: bool,
#[prost(string, optional, tag = "4")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "5")]
pub concurrent_piece_count: ::core::option::Option<u32>,
#[prost(uint64, tag = "6")]
pub piece_count: u64,
#[prost(bool, tag = "7")]
pub need_back_to_source: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentPeerStartedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentPeerBackToSourceStartedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReschedulePersistentPeerRequest {
#[prost(message, repeated, tag = "1")]
pub candidate_parents: ::prost::alloc::vec::Vec<
super::super::common::v2::PersistentPeer,
>,
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentPeerFinishedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentPeerBackToSourceFinishedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentPeerFailedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentPeerBackToSourceFailedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnouncePersistentPeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(
oneof = "announce_persistent_peer_request::Request",
tags = "4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15"
)]
pub request: ::core::option::Option<announce_persistent_peer_request::Request>,
}
pub mod announce_persistent_peer_request {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Request {
#[prost(message, tag = "4")]
RegisterPersistentPeerRequest(super::RegisterPersistentPeerRequest),
#[prost(message, tag = "5")]
DownloadPersistentPeerStartedRequest(
super::DownloadPersistentPeerStartedRequest,
),
#[prost(message, tag = "6")]
DownloadPersistentPeerBackToSourceStartedRequest(
super::DownloadPersistentPeerBackToSourceStartedRequest,
),
#[prost(message, tag = "7")]
ReschedulePersistentPeerRequest(super::ReschedulePersistentPeerRequest),
#[prost(message, tag = "8")]
DownloadPersistentPeerFinishedRequest(
super::DownloadPersistentPeerFinishedRequest,
),
#[prost(message, tag = "9")]
DownloadPersistentPeerBackToSourceFinishedRequest(
super::DownloadPersistentPeerBackToSourceFinishedRequest,
),
#[prost(message, tag = "10")]
DownloadPersistentPeerFailedRequest(super::DownloadPersistentPeerFailedRequest),
#[prost(message, tag = "11")]
DownloadPersistentPeerBackToSourceFailedRequest(
super::DownloadPersistentPeerBackToSourceFailedRequest,
),
#[prost(message, tag = "12")]
DownloadPieceFinishedRequest(super::DownloadPieceFinishedRequest),
#[prost(message, tag = "13")]
DownloadPieceBackToSourceFinishedRequest(
super::DownloadPieceBackToSourceFinishedRequest,
),
#[prost(message, tag = "14")]
DownloadPieceFailedRequest(super::DownloadPieceFailedRequest),
#[prost(message, tag = "15")]
DownloadPieceBackToSourceFailedRequest(
super::DownloadPieceBackToSourceFailedRequest,
),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EmptyPersistentTaskResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NormalPersistentTaskResponse {
#[prost(message, repeated, tag = "1")]
pub candidate_parents: ::prost::alloc::vec::Vec<
super::super::common::v2::PersistentPeer,
>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnouncePersistentPeerResponse {
#[prost(oneof = "announce_persistent_peer_response::Response", tags = "1, 2, 3")]
pub response: ::core::option::Option<announce_persistent_peer_response::Response>,
}
pub mod announce_persistent_peer_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "1")]
EmptyPersistentTaskResponse(super::EmptyPersistentTaskResponse),
#[prost(message, tag = "2")]
NormalPersistentTaskResponse(super::NormalPersistentTaskResponse),
#[prost(message, tag = "3")]
NeedBackToSourceResponse(super::NeedBackToSourceResponse),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPersistentPeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePersistentPeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentTaskStartedRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub url: ::prost::alloc::string::String,
#[prost(message, optional, tag = "5")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(uint64, tag = "6")]
pub persistent_replica_count: u64,
#[prost(uint64, tag = "7")]
pub content_length: u64,
#[prost(uint32, tag = "8")]
pub piece_count: u32,
#[prost(message, optional, tag = "9")]
pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentTaskFinishedRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentTaskFailedRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "4")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPersistentTaskRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePersistentTaskRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RegisterPersistentCachePeerRequest {
#[prost(bool, tag = "1")]
pub persistent: bool,
#[prost(string, optional, tag = "2")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, tag = "4")]
pub piece_length: u64,
#[prost(string, optional, tag = "5")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "6")]
pub concurrent_piece_count: ::core::option::Option<u32>,
#[prost(uint64, tag = "7")]
pub piece_count: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCachePeerStartedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReschedulePersistentCachePeerRequest {
#[prost(message, repeated, tag = "1")]
pub candidate_parents: ::prost::alloc::vec::Vec<
super::super::common::v2::PersistentCachePeer,
>,
#[prost(string, optional, tag = "2")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCachePeerFinishedRequest {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DownloadPersistentCachePeerFailedRequest {
#[prost(string, optional, tag = "1")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnouncePersistentCachePeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(
oneof = "announce_persistent_cache_peer_request::Request",
tags = "4, 5, 6, 7, 8, 9, 10"
)]
pub request: ::core::option::Option<announce_persistent_cache_peer_request::Request>,
}
pub mod announce_persistent_cache_peer_request {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Request {
#[prost(message, tag = "4")]
RegisterPersistentCachePeerRequest(super::RegisterPersistentCachePeerRequest),
#[prost(message, tag = "5")]
DownloadPersistentCachePeerStartedRequest(
super::DownloadPersistentCachePeerStartedRequest,
),
#[prost(message, tag = "6")]
ReschedulePersistentCachePeerRequest(
super::ReschedulePersistentCachePeerRequest,
),
#[prost(message, tag = "7")]
DownloadPersistentCachePeerFinishedRequest(
super::DownloadPersistentCachePeerFinishedRequest,
),
#[prost(message, tag = "8")]
DownloadPersistentCachePeerFailedRequest(
super::DownloadPersistentCachePeerFailedRequest,
),
#[prost(message, tag = "9")]
DownloadPieceFinishedRequest(super::DownloadPieceFinishedRequest),
#[prost(message, tag = "10")]
DownloadPieceFailedRequest(super::DownloadPieceFailedRequest),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EmptyPersistentCacheTaskResponse {}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NormalPersistentCacheTaskResponse {
#[prost(message, repeated, tag = "1")]
pub candidate_cache_parents: ::prost::alloc::vec::Vec<
super::super::common::v2::PersistentCachePeer,
>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AnnouncePersistentCachePeerResponse {
#[prost(oneof = "announce_persistent_cache_peer_response::Response", tags = "1, 2")]
pub response: ::core::option::Option<
announce_persistent_cache_peer_response::Response,
>,
}
pub mod announce_persistent_cache_peer_response {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag = "1")]
EmptyPersistentCacheTaskResponse(super::EmptyPersistentCacheTaskResponse),
#[prost(message, tag = "2")]
NormalPersistentCacheTaskResponse(super::NormalPersistentCacheTaskResponse),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPersistentCachePeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePersistentCachePeerRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentCacheTaskStartedRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(uint64, tag = "4")]
pub persistent_replica_count: u64,
#[prost(string, optional, tag = "5")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(uint64, tag = "7")]
pub piece_length: u64,
#[prost(uint64, tag = "8")]
pub content_length: u64,
#[prost(uint32, tag = "9")]
pub piece_count: u32,
#[prost(message, optional, tag = "10")]
pub ttl: ::core::option::Option<::prost_wkt_types::Duration>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentCacheTaskFinishedRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadPersistentCacheTaskFailedRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub peer_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "4")]
pub description: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StatPersistentCacheTaskRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletePersistentCacheTaskRequest {
#[prost(string, tag = "1")]
pub host_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub task_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PreheatImageRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "2")]
pub piece_length: ::core::option::Option<u64>,
#[prost(string, optional, tag = "3")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "5")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "6")]
pub header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "7")]
pub username: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "8")]
pub password: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "9")]
pub platform: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag = "10")]
pub scope: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "11")]
pub ips: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "12")]
pub percentage: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "13")]
pub count: ::core::option::Option<u32>,
#[prost(int64, optional, tag = "14")]
pub concurrent_task_count: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "15")]
pub concurrent_peer_count: ::core::option::Option<i64>,
#[prost(message, optional, tag = "16")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(enumeration = "super::super::common::v2::Priority", tag = "17")]
pub priority: i32,
#[prost(bytes = "vec", repeated, tag = "18")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(bool, tag = "19")]
pub insecure_skip_verify: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatImageRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "2")]
pub piece_length: ::core::option::Option<u64>,
#[prost(string, optional, tag = "3")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "5")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "6")]
pub header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, optional, tag = "7")]
pub username: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "8")]
pub password: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "9")]
pub platform: ::core::option::Option<::prost::alloc::string::String>,
#[prost(int64, optional, tag = "10")]
pub concurrent_layer_count: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "11")]
pub concurrent_peer_count: ::core::option::Option<i64>,
#[prost(message, optional, tag = "12")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(bytes = "vec", repeated, tag = "13")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(bool, tag = "14")]
pub insecure_skip_verify: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatImageResponse {
#[prost(message, optional, tag = "1")]
pub image: ::core::option::Option<Image>,
#[prost(message, repeated, tag = "2")]
pub peers: ::prost::alloc::vec::Vec<PeerImage>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PeerImage {
#[prost(string, tag = "1")]
pub ip: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub hostname: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub cached_layers: ::prost::alloc::vec::Vec<Layer>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Image {
#[prost(message, repeated, tag = "1")]
pub layers: ::prost::alloc::vec::Vec<Layer>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Layer {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub is_finished: ::core::option::Option<bool>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PreheatFileRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "2")]
pub piece_length: ::core::option::Option<u64>,
#[prost(string, optional, tag = "3")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "5")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "6")]
pub header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(string, tag = "7")]
pub scope: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "8")]
pub ips: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(uint32, optional, tag = "9")]
pub percentage: ::core::option::Option<u32>,
#[prost(uint32, optional, tag = "10")]
pub count: ::core::option::Option<u32>,
#[prost(int64, optional, tag = "11")]
pub concurrent_task_count: ::core::option::Option<i64>,
#[prost(int64, optional, tag = "12")]
pub concurrent_peer_count: ::core::option::Option<i64>,
#[prost(message, optional, tag = "13")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(enumeration = "super::super::common::v2::Priority", tag = "14")]
pub priority: i32,
#[prost(bytes = "vec", repeated, tag = "15")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(bool, tag = "16")]
pub insecure_skip_verify: bool,
#[prost(message, optional, tag = "17")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(message, optional, tag = "18")]
pub hdfs: ::core::option::Option<super::super::common::v2::Hdfs>,
#[prost(string, optional, tag = "19")]
pub output_path: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatFileRequest {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(uint64, optional, tag = "2")]
pub piece_length: ::core::option::Option<u64>,
#[prost(string, optional, tag = "3")]
pub tag: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "4")]
pub application: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "5")]
pub filtered_query_params: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "6")]
pub header: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(int64, optional, tag = "7")]
pub concurrent_peer_count: ::core::option::Option<i64>,
#[prost(message, optional, tag = "8")]
pub timeout: ::core::option::Option<::prost_wkt_types::Duration>,
#[prost(bytes = "vec", repeated, tag = "9")]
pub certificate_chain: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
#[prost(bool, tag = "10")]
pub insecure_skip_verify: bool,
#[prost(message, optional, tag = "11")]
pub object_storage: ::core::option::Option<super::super::common::v2::ObjectStorage>,
#[prost(message, optional, tag = "12")]
pub hdfs: ::core::option::Option<super::super::common::v2::Hdfs>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatFileResponse {
#[prost(message, repeated, tag = "1")]
pub peers: ::prost::alloc::vec::Vec<PeerFile>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PeerFile {
#[prost(string, tag = "1")]
pub ip: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub hostname: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub cached_files: ::prost::alloc::vec::Vec<File>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct File {
#[prost(string, tag = "1")]
pub url: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "2")]
pub is_finished: ::core::option::Option<bool>,
}
pub mod scheduler_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct SchedulerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl SchedulerClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> SchedulerClient<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,
) -> SchedulerClient<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,
{
SchedulerClient::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 announce_peer(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::AnnouncePeerRequest,
>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::AnnouncePeerResponse>>,
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(
"/scheduler.v2.Scheduler/AnnouncePeer",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "AnnouncePeer"));
self.inner.streaming(req, path, codec).await
}
pub async fn stat_peer(
&mut self,
request: impl tonic::IntoRequest<super::StatPeerRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::Peer>,
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(
"/scheduler.v2.Scheduler/StatPeer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatPeer"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_peer(
&mut self,
request: impl tonic::IntoRequest<super::DeletePeerRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeletePeer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "DeletePeer"));
self.inner.unary(req, path, codec).await
}
pub async fn stat_task(
&mut self,
request: impl tonic::IntoRequest<super::StatTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::Task>,
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(
"/scheduler.v2.Scheduler/StatTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatTask"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_task(
&mut self,
request: impl tonic::IntoRequest<super::DeleteTaskRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeleteTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "DeleteTask"));
self.inner.unary(req, path, codec).await
}
pub async fn announce_host(
&mut self,
request: impl tonic::IntoRequest<super::AnnounceHostRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/AnnounceHost",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "AnnounceHost"));
self.inner.unary(req, path, codec).await
}
pub async fn list_hosts(
&mut self,
request: impl tonic::IntoRequest<super::ListHostsRequest>,
) -> std::result::Result<
tonic::Response<super::ListHostsResponse>,
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(
"/scheduler.v2.Scheduler/ListHosts",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "ListHosts"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_host(
&mut self,
request: impl tonic::IntoRequest<super::DeleteHostRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeleteHost",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "DeleteHost"));
self.inner.unary(req, path, codec).await
}
pub async fn announce_cache_peer(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::AnnounceCachePeerRequest,
>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::AnnounceCachePeerResponse>>,
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(
"/scheduler.v2.Scheduler/AnnounceCachePeer",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "AnnounceCachePeer"));
self.inner.streaming(req, path, codec).await
}
pub async fn stat_cache_peer(
&mut self,
request: impl tonic::IntoRequest<super::StatCachePeerRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::CachePeer>,
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(
"/scheduler.v2.Scheduler/StatCachePeer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatCachePeer"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_cache_peer(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCachePeerRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeleteCachePeer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "DeleteCachePeer"));
self.inner.unary(req, path, codec).await
}
pub async fn stat_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::StatCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::CacheTask>,
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(
"/scheduler.v2.Scheduler/StatCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatCacheTask"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DeleteCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeleteCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "DeleteCacheTask"));
self.inner.unary(req, path, codec).await
}
pub async fn announce_persistent_peer(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::AnnouncePersistentPeerRequest,
>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::AnnouncePersistentPeerResponse>,
>,
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(
"/scheduler.v2.Scheduler/AnnouncePersistentPeer",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scheduler.v2.Scheduler", "AnnouncePersistentPeer"),
);
self.inner.streaming(req, path, codec).await
}
pub async fn stat_persistent_peer(
&mut self,
request: impl tonic::IntoRequest<super::StatPersistentPeerRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentPeer>,
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(
"/scheduler.v2.Scheduler/StatPersistentPeer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatPersistentPeer"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_persistent_peer(
&mut self,
request: impl tonic::IntoRequest<super::DeletePersistentPeerRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeletePersistentPeer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scheduler.v2.Scheduler", "DeletePersistentPeer"),
);
self.inner.unary(req, path, codec).await
}
pub async fn upload_persistent_task_started(
&mut self,
request: impl tonic::IntoRequest<super::UploadPersistentTaskStartedRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/UploadPersistentTaskStarted",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"UploadPersistentTaskStarted",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn upload_persistent_task_finished(
&mut self,
request: impl tonic::IntoRequest<super::UploadPersistentTaskFinishedRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
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(
"/scheduler.v2.Scheduler/UploadPersistentTaskFinished",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"UploadPersistentTaskFinished",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn upload_persistent_task_failed(
&mut self,
request: impl tonic::IntoRequest<super::UploadPersistentTaskFailedRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/UploadPersistentTaskFailed",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"UploadPersistentTaskFailed",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn stat_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::StatPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
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(
"/scheduler.v2.Scheduler/StatPersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatPersistentTask"));
self.inner.unary(req, path, codec).await
}
pub async fn delete_persistent_task(
&mut self,
request: impl tonic::IntoRequest<super::DeletePersistentTaskRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeletePersistentTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scheduler.v2.Scheduler", "DeletePersistentTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn announce_persistent_cache_peer(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::AnnouncePersistentCachePeerRequest,
>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<super::AnnouncePersistentCachePeerResponse>,
>,
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(
"/scheduler.v2.Scheduler/AnnouncePersistentCachePeer",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"AnnouncePersistentCachePeer",
),
);
self.inner.streaming(req, path, codec).await
}
pub async fn stat_persistent_cache_peer(
&mut self,
request: impl tonic::IntoRequest<super::StatPersistentCachePeerRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCachePeer>,
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(
"/scheduler.v2.Scheduler/StatPersistentCachePeer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scheduler.v2.Scheduler", "StatPersistentCachePeer"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_persistent_cache_peer(
&mut self,
request: impl tonic::IntoRequest<super::DeletePersistentCachePeerRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeletePersistentCachePeer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"DeletePersistentCachePeer",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn upload_persistent_cache_task_started(
&mut self,
request: impl tonic::IntoRequest<
super::UploadPersistentCacheTaskStartedRequest,
>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/UploadPersistentCacheTaskStarted",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"UploadPersistentCacheTaskStarted",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn upload_persistent_cache_task_finished(
&mut self,
request: impl tonic::IntoRequest<
super::UploadPersistentCacheTaskFinishedRequest,
>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
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(
"/scheduler.v2.Scheduler/UploadPersistentCacheTaskFinished",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"UploadPersistentCacheTaskFinished",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn upload_persistent_cache_task_failed(
&mut self,
request: impl tonic::IntoRequest<
super::UploadPersistentCacheTaskFailedRequest,
>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/UploadPersistentCacheTaskFailed",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"UploadPersistentCacheTaskFailed",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn stat_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::StatPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
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(
"/scheduler.v2.Scheduler/StatPersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("scheduler.v2.Scheduler", "StatPersistentCacheTask"),
);
self.inner.unary(req, path, codec).await
}
pub async fn delete_persistent_cache_task(
&mut self,
request: impl tonic::IntoRequest<super::DeletePersistentCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/DeletePersistentCacheTask",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"scheduler.v2.Scheduler",
"DeletePersistentCacheTask",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn preheat_image(
&mut self,
request: impl tonic::IntoRequest<super::PreheatImageRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/PreheatImage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "PreheatImage"));
self.inner.unary(req, path, codec).await
}
pub async fn stat_image(
&mut self,
request: impl tonic::IntoRequest<super::StatImageRequest>,
) -> std::result::Result<
tonic::Response<super::StatImageResponse>,
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(
"/scheduler.v2.Scheduler/StatImage",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatImage"));
self.inner.unary(req, path, codec).await
}
pub async fn preheat_file(
&mut self,
request: impl tonic::IntoRequest<super::PreheatFileRequest>,
) -> std::result::Result<tonic::Response<()>, 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(
"/scheduler.v2.Scheduler/PreheatFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "PreheatFile"));
self.inner.unary(req, path, codec).await
}
pub async fn stat_file(
&mut self,
request: impl tonic::IntoRequest<super::StatFileRequest>,
) -> std::result::Result<
tonic::Response<super::StatFileResponse>,
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(
"/scheduler.v2.Scheduler/StatFile",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("scheduler.v2.Scheduler", "StatFile"));
self.inner.unary(req, path, codec).await
}
}
}
pub mod scheduler_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Scheduler: std::marker::Send + std::marker::Sync + 'static {
type AnnouncePeerStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<super::AnnouncePeerResponse, tonic::Status>,
>
+ std::marker::Send
+ 'static;
async fn announce_peer(
&self,
request: tonic::Request<tonic::Streaming<super::AnnouncePeerRequest>>,
) -> std::result::Result<
tonic::Response<Self::AnnouncePeerStream>,
tonic::Status,
>;
async fn stat_peer(
&self,
request: tonic::Request<super::StatPeerRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::Peer>,
tonic::Status,
>;
async fn delete_peer(
&self,
request: tonic::Request<super::DeletePeerRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn stat_task(
&self,
request: tonic::Request<super::StatTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::Task>,
tonic::Status,
>;
async fn delete_task(
&self,
request: tonic::Request<super::DeleteTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn announce_host(
&self,
request: tonic::Request<super::AnnounceHostRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn list_hosts(
&self,
request: tonic::Request<super::ListHostsRequest>,
) -> std::result::Result<
tonic::Response<super::ListHostsResponse>,
tonic::Status,
>;
async fn delete_host(
&self,
request: tonic::Request<super::DeleteHostRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type AnnounceCachePeerStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::AnnounceCachePeerResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn announce_cache_peer(
&self,
request: tonic::Request<tonic::Streaming<super::AnnounceCachePeerRequest>>,
) -> std::result::Result<
tonic::Response<Self::AnnounceCachePeerStream>,
tonic::Status,
>;
async fn stat_cache_peer(
&self,
request: tonic::Request<super::StatCachePeerRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::CachePeer>,
tonic::Status,
>;
async fn delete_cache_peer(
&self,
request: tonic::Request<super::DeleteCachePeerRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn stat_cache_task(
&self,
request: tonic::Request<super::StatCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::CacheTask>,
tonic::Status,
>;
async fn delete_cache_task(
&self,
request: tonic::Request<super::DeleteCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type AnnouncePersistentPeerStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::AnnouncePersistentPeerResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn announce_persistent_peer(
&self,
request: tonic::Request<
tonic::Streaming<super::AnnouncePersistentPeerRequest>,
>,
) -> std::result::Result<
tonic::Response<Self::AnnouncePersistentPeerStream>,
tonic::Status,
>;
async fn stat_persistent_peer(
&self,
request: tonic::Request<super::StatPersistentPeerRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentPeer>,
tonic::Status,
>;
async fn delete_persistent_peer(
&self,
request: tonic::Request<super::DeletePersistentPeerRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn upload_persistent_task_started(
&self,
request: tonic::Request<super::UploadPersistentTaskStartedRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn upload_persistent_task_finished(
&self,
request: tonic::Request<super::UploadPersistentTaskFinishedRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
tonic::Status,
>;
async fn upload_persistent_task_failed(
&self,
request: tonic::Request<super::UploadPersistentTaskFailedRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn stat_persistent_task(
&self,
request: tonic::Request<super::StatPersistentTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentTask>,
tonic::Status,
>;
async fn delete_persistent_task(
&self,
request: tonic::Request<super::DeletePersistentTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
type AnnouncePersistentCachePeerStream: tonic::codegen::tokio_stream::Stream<
Item = std::result::Result<
super::AnnouncePersistentCachePeerResponse,
tonic::Status,
>,
>
+ std::marker::Send
+ 'static;
async fn announce_persistent_cache_peer(
&self,
request: tonic::Request<
tonic::Streaming<super::AnnouncePersistentCachePeerRequest>,
>,
) -> std::result::Result<
tonic::Response<Self::AnnouncePersistentCachePeerStream>,
tonic::Status,
>;
async fn stat_persistent_cache_peer(
&self,
request: tonic::Request<super::StatPersistentCachePeerRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCachePeer>,
tonic::Status,
>;
async fn delete_persistent_cache_peer(
&self,
request: tonic::Request<super::DeletePersistentCachePeerRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn upload_persistent_cache_task_started(
&self,
request: tonic::Request<super::UploadPersistentCacheTaskStartedRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn upload_persistent_cache_task_finished(
&self,
request: tonic::Request<super::UploadPersistentCacheTaskFinishedRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
tonic::Status,
>;
async fn upload_persistent_cache_task_failed(
&self,
request: tonic::Request<super::UploadPersistentCacheTaskFailedRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn stat_persistent_cache_task(
&self,
request: tonic::Request<super::StatPersistentCacheTaskRequest>,
) -> std::result::Result<
tonic::Response<super::super::super::common::v2::PersistentCacheTask>,
tonic::Status,
>;
async fn delete_persistent_cache_task(
&self,
request: tonic::Request<super::DeletePersistentCacheTaskRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn preheat_image(
&self,
request: tonic::Request<super::PreheatImageRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn stat_image(
&self,
request: tonic::Request<super::StatImageRequest>,
) -> std::result::Result<
tonic::Response<super::StatImageResponse>,
tonic::Status,
>;
async fn preheat_file(
&self,
request: tonic::Request<super::PreheatFileRequest>,
) -> std::result::Result<tonic::Response<()>, tonic::Status>;
async fn stat_file(
&self,
request: tonic::Request<super::StatFileRequest>,
) -> std::result::Result<
tonic::Response<super::StatFileResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct SchedulerServer<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> SchedulerServer<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 SchedulerServer<T>
where
T: Scheduler,
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() {
"/scheduler.v2.Scheduler/AnnouncePeer" => {
#[allow(non_camel_case_types)]
struct AnnouncePeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::StreamingService<super::AnnouncePeerRequest>
for AnnouncePeerSvc<T> {
type Response = super::AnnouncePeerResponse;
type ResponseStream = T::AnnouncePeerStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::AnnouncePeerRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::announce_peer(&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 = AnnouncePeerSvc(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)
}
"/scheduler.v2.Scheduler/StatPeer" => {
#[allow(non_camel_case_types)]
struct StatPeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatPeerRequest>
for StatPeerSvc<T> {
type Response = super::super::super::common::v2::Peer;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatPeerRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_peer(&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 = StatPeerSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeletePeer" => {
#[allow(non_camel_case_types)]
struct DeletePeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::DeletePeerRequest>
for DeletePeerSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePeerRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_peer(&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 = DeletePeerSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/StatTask" => {
#[allow(non_camel_case_types)]
struct StatTaskSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatTaskRequest>
for StatTaskSvc<T> {
type Response = super::super::super::common::v2::Task;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_task(&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 = StatTaskSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeleteTask" => {
#[allow(non_camel_case_types)]
struct DeleteTaskSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::DeleteTaskRequest>
for DeleteTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_task(&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 = DeleteTaskSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/AnnounceHost" => {
#[allow(non_camel_case_types)]
struct AnnounceHostSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::AnnounceHostRequest>
for AnnounceHostSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AnnounceHostRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::announce_host(&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 = AnnounceHostSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/ListHosts" => {
#[allow(non_camel_case_types)]
struct ListHostsSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::ListHostsRequest>
for ListHostsSvc<T> {
type Response = super::ListHostsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::ListHostsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::list_hosts(&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 = ListHostsSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeleteHost" => {
#[allow(non_camel_case_types)]
struct DeleteHostSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::DeleteHostRequest>
for DeleteHostSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteHostRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_host(&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 = DeleteHostSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/AnnounceCachePeer" => {
#[allow(non_camel_case_types)]
struct AnnounceCachePeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::StreamingService<super::AnnounceCachePeerRequest>
for AnnounceCachePeerSvc<T> {
type Response = super::AnnounceCachePeerResponse;
type ResponseStream = T::AnnounceCachePeerStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::AnnounceCachePeerRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::announce_cache_peer(&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 = AnnounceCachePeerSvc(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)
}
"/scheduler.v2.Scheduler/StatCachePeer" => {
#[allow(non_camel_case_types)]
struct StatCachePeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatCachePeerRequest>
for StatCachePeerSvc<T> {
type Response = super::super::super::common::v2::CachePeer;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatCachePeerRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_cache_peer(&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 = StatCachePeerSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeleteCachePeer" => {
#[allow(non_camel_case_types)]
struct DeleteCachePeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::DeleteCachePeerRequest>
for DeleteCachePeerSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteCachePeerRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_cache_peer(&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 = DeleteCachePeerSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/StatCacheTask" => {
#[allow(non_camel_case_types)]
struct StatCacheTaskSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatCacheTaskRequest>
for StatCacheTaskSvc<T> {
type Response = super::super::super::common::v2::CacheTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatCacheTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_cache_task(&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 = StatCacheTaskSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeleteCacheTask" => {
#[allow(non_camel_case_types)]
struct DeleteCacheTaskSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::DeleteCacheTaskRequest>
for DeleteCacheTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeleteCacheTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_cache_task(&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 = DeleteCacheTaskSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/AnnouncePersistentPeer" => {
#[allow(non_camel_case_types)]
struct AnnouncePersistentPeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::StreamingService<
super::AnnouncePersistentPeerRequest,
> for AnnouncePersistentPeerSvc<T> {
type Response = super::AnnouncePersistentPeerResponse;
type ResponseStream = T::AnnouncePersistentPeerStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::AnnouncePersistentPeerRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::announce_persistent_peer(&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 = AnnouncePersistentPeerSvc(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)
}
"/scheduler.v2.Scheduler/StatPersistentPeer" => {
#[allow(non_camel_case_types)]
struct StatPersistentPeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatPersistentPeerRequest>
for StatPersistentPeerSvc<T> {
type Response = super::super::super::common::v2::PersistentPeer;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatPersistentPeerRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_persistent_peer(&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 = StatPersistentPeerSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeletePersistentPeer" => {
#[allow(non_camel_case_types)]
struct DeletePersistentPeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::DeletePersistentPeerRequest>
for DeletePersistentPeerSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePersistentPeerRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_persistent_peer(&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 = DeletePersistentPeerSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/UploadPersistentTaskStarted" => {
#[allow(non_camel_case_types)]
struct UploadPersistentTaskStartedSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<
super::UploadPersistentTaskStartedRequest,
> for UploadPersistentTaskStartedSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UploadPersistentTaskStartedRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::upload_persistent_task_started(
&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 = UploadPersistentTaskStartedSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/UploadPersistentTaskFinished" => {
#[allow(non_camel_case_types)]
struct UploadPersistentTaskFinishedSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<
super::UploadPersistentTaskFinishedRequest,
> for UploadPersistentTaskFinishedSvc<T> {
type Response = super::super::super::common::v2::PersistentTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UploadPersistentTaskFinishedRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::upload_persistent_task_finished(
&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 = UploadPersistentTaskFinishedSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/UploadPersistentTaskFailed" => {
#[allow(non_camel_case_types)]
struct UploadPersistentTaskFailedSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<
super::UploadPersistentTaskFailedRequest,
> for UploadPersistentTaskFailedSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UploadPersistentTaskFailedRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::upload_persistent_task_failed(
&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 = UploadPersistentTaskFailedSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/StatPersistentTask" => {
#[allow(non_camel_case_types)]
struct StatPersistentTaskSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatPersistentTaskRequest>
for StatPersistentTaskSvc<T> {
type Response = super::super::super::common::v2::PersistentTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatPersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_persistent_task(&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 = StatPersistentTaskSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeletePersistentTask" => {
#[allow(non_camel_case_types)]
struct DeletePersistentTaskSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::DeletePersistentTaskRequest>
for DeletePersistentTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::DeletePersistentTaskRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_persistent_task(&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 = DeletePersistentTaskSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/AnnouncePersistentCachePeer" => {
#[allow(non_camel_case_types)]
struct AnnouncePersistentCachePeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::StreamingService<
super::AnnouncePersistentCachePeerRequest,
> for AnnouncePersistentCachePeerSvc<T> {
type Response = super::AnnouncePersistentCachePeerResponse;
type ResponseStream = T::AnnouncePersistentCachePeerStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
tonic::Streaming<super::AnnouncePersistentCachePeerRequest>,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::announce_persistent_cache_peer(
&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 = AnnouncePersistentCachePeerSvc(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)
}
"/scheduler.v2.Scheduler/StatPersistentCachePeer" => {
#[allow(non_camel_case_types)]
struct StatPersistentCachePeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatPersistentCachePeerRequest>
for StatPersistentCachePeerSvc<T> {
type Response = super::super::super::common::v2::PersistentCachePeer;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::StatPersistentCachePeerRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_persistent_cache_peer(
&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 = StatPersistentCachePeerSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeletePersistentCachePeer" => {
#[allow(non_camel_case_types)]
struct DeletePersistentCachePeerSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<
super::DeletePersistentCachePeerRequest,
> for DeletePersistentCachePeerSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::DeletePersistentCachePeerRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_persistent_cache_peer(
&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 = DeletePersistentCachePeerSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/UploadPersistentCacheTaskStarted" => {
#[allow(non_camel_case_types)]
struct UploadPersistentCacheTaskStartedSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<
super::UploadPersistentCacheTaskStartedRequest,
> for UploadPersistentCacheTaskStartedSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UploadPersistentCacheTaskStartedRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::upload_persistent_cache_task_started(
&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 = UploadPersistentCacheTaskStartedSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/UploadPersistentCacheTaskFinished" => {
#[allow(non_camel_case_types)]
struct UploadPersistentCacheTaskFinishedSvc<T: Scheduler>(
pub Arc<T>,
);
impl<
T: Scheduler,
> tonic::server::UnaryService<
super::UploadPersistentCacheTaskFinishedRequest,
> for UploadPersistentCacheTaskFinishedSvc<T> {
type Response = super::super::super::common::v2::PersistentCacheTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UploadPersistentCacheTaskFinishedRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::upload_persistent_cache_task_finished(
&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 = UploadPersistentCacheTaskFinishedSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/UploadPersistentCacheTaskFailed" => {
#[allow(non_camel_case_types)]
struct UploadPersistentCacheTaskFailedSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<
super::UploadPersistentCacheTaskFailedRequest,
> for UploadPersistentCacheTaskFailedSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::UploadPersistentCacheTaskFailedRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::upload_persistent_cache_task_failed(
&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 = UploadPersistentCacheTaskFailedSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/StatPersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct StatPersistentCacheTaskSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatPersistentCacheTaskRequest>
for StatPersistentCacheTaskSvc<T> {
type Response = super::super::super::common::v2::PersistentCacheTask;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::StatPersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_persistent_cache_task(
&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 = StatPersistentCacheTaskSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/DeletePersistentCacheTask" => {
#[allow(non_camel_case_types)]
struct DeletePersistentCacheTaskSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<
super::DeletePersistentCacheTaskRequest,
> for DeletePersistentCacheTaskSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::DeletePersistentCacheTaskRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::delete_persistent_cache_task(
&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 = DeletePersistentCacheTaskSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/PreheatImage" => {
#[allow(non_camel_case_types)]
struct PreheatImageSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::PreheatImageRequest>
for PreheatImageSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PreheatImageRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::preheat_image(&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 = PreheatImageSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/StatImage" => {
#[allow(non_camel_case_types)]
struct StatImageSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatImageRequest>
for StatImageSvc<T> {
type Response = super::StatImageResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatImageRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_image(&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 = StatImageSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/PreheatFile" => {
#[allow(non_camel_case_types)]
struct PreheatFileSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::PreheatFileRequest>
for PreheatFileSvc<T> {
type Response = ();
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::PreheatFileRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::preheat_file(&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 = PreheatFileSvc(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.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/scheduler.v2.Scheduler/StatFile" => {
#[allow(non_camel_case_types)]
struct StatFileSvc<T: Scheduler>(pub Arc<T>);
impl<
T: Scheduler,
> tonic::server::UnaryService<super::StatFileRequest>
for StatFileSvc<T> {
type Response = super::StatFileResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::StatFileRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Scheduler>::stat_file(&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 = StatFileSvc(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.unary(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 SchedulerServer<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 = "scheduler.v2.Scheduler";
impl<T> tonic::server::NamedService for SchedulerServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}