diff --git a/Cargo.lock b/Cargo.lock index 4eb7c85..995f116 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "dragonfly-api" -version = "2.0.158" +version = "2.0.159" dependencies = [ "prost", "prost-types", diff --git a/Cargo.toml b/Cargo.toml index 7cf9cd1..bd1abf3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dragonfly-api" -version = "2.0.158" +version = "2.0.159" authors = ["Gaius "] edition = "2021" license = "Apache-2.0" diff --git a/proto/scheduler.proto b/proto/scheduler.proto index 5cd2da4..0159e8b 100644 --- a/proto/scheduler.proto +++ b/proto/scheduler.proto @@ -178,12 +178,6 @@ message DeletePeerRequest { string peer_id = 3; } -// AnnouncePeersRequest represents request of AnnouncePeers. -message AnnouncePeersRequest{ - // Peers information. - repeated common.v2.Peer peers = 1; -} - // StatTaskRequest represents request of StatTask. message StatTaskRequest { // Host id. @@ -444,9 +438,6 @@ service Scheduler{ // DeletePeer releases peer in scheduler. rpc DeletePeer(DeletePeerRequest)returns(google.protobuf.Empty); - // A host announces that it has the announced peers to scheduler at startup. - rpc AnnouncePeers(stream AnnouncePeersRequest) returns(stream google.protobuf.Empty); - // Checks information of task. rpc StatTask(StatTaskRequest)returns(common.v2.Task); diff --git a/src/descriptor.bin b/src/descriptor.bin index 15168f6..443d033 100644 Binary files a/src/descriptor.bin and b/src/descriptor.bin differ diff --git a/src/scheduler.v2.rs b/src/scheduler.v2.rs index 6e158e3..3311e05 100644 --- a/src/scheduler.v2.rs +++ b/src/scheduler.v2.rs @@ -273,15 +273,6 @@ pub struct DeletePeerRequest { #[prost(string, tag = "3")] pub peer_id: ::prost::alloc::string::String, } -/// AnnouncePeersRequest represents request of AnnouncePeers. -#[derive(serde::Serialize, serde::Deserialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AnnouncePeersRequest { - /// Peers information. - #[prost(message, repeated, tag = "1")] - pub peers: ::prost::alloc::vec::Vec, -} /// StatTaskRequest represents request of StatTask. #[derive(serde::Serialize, serde::Deserialize)] #[allow(clippy::derive_partial_eq_without_eq)] @@ -843,34 +834,6 @@ pub mod scheduler_client { .insert(GrpcMethod::new("scheduler.v2.Scheduler", "DeletePeer")); self.inner.unary(req, path, codec).await } - /// A host announces that it has the announced peers to scheduler at startup. - pub async fn announce_peers( - &mut self, - request: impl tonic::IntoStreamingRequest< - Message = super::AnnouncePeersRequest, - >, - ) -> std::result::Result< - tonic::Response>, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/scheduler.v2.Scheduler/AnnouncePeers", - ); - let mut req = request.into_streaming_request(); - req.extensions_mut() - .insert(GrpcMethod::new("scheduler.v2.Scheduler", "AnnouncePeers")); - self.inner.streaming(req, path, codec).await - } /// Checks information of task. pub async fn stat_task( &mut self, @@ -1258,20 +1221,6 @@ pub mod scheduler_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; - /// Server streaming response type for the AnnouncePeers method. - type AnnouncePeersStream: tonic::codegen::tokio_stream::Stream< - Item = std::result::Result<(), tonic::Status>, - > - + std::marker::Send - + 'static; - /// A host announces that it has the announced peers to scheduler at startup. - async fn announce_peers( - &self, - request: tonic::Request>, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; /// Checks information of task. async fn stat_task( &self, @@ -1591,54 +1540,6 @@ pub mod scheduler_server { }; Box::pin(fut) } - "/scheduler.v2.Scheduler/AnnouncePeers" => { - #[allow(non_camel_case_types)] - struct AnnouncePeersSvc(pub Arc); - impl< - T: Scheduler, - > tonic::server::StreamingService - for AnnouncePeersSvc { - type Response = (); - type ResponseStream = T::AnnouncePeersStream; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - tonic::Streaming, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::announce_peers(&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 = AnnouncePeersSvc(inner); - let codec = tonic::codec::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/StatTask" => { #[allow(non_camel_case_types)] struct StatTaskSvc(pub Arc);