From ac0a2a42a0679c1b6d28cf457c3624afedf20d59 Mon Sep 17 00:00:00 2001 From: Gaius Date: Tue, 12 Dec 2023 14:48:04 +0800 Subject: [PATCH] feat: remove concurrent_piece_count in scheduler (#228) Signed-off-by: Gaius --- Cargo.toml | 2 +- pkg/apis/scheduler/v1/scheduler.pb.go | 16 ++--------- .../scheduler/v1/scheduler.pb.validate.go | 11 ------- pkg/apis/scheduler/v1/scheduler.proto | 2 -- pkg/apis/scheduler/v2/scheduler.pb.go | 27 +++++------------- .../scheduler/v2/scheduler.pb.validate.go | 11 ------- pkg/apis/scheduler/v2/scheduler.proto | 2 -- proto/scheduler.proto | 2 -- src/descriptor.bin | Bin 75787 -> 75619 bytes src/scheduler.v2.rs | 3 -- 10 files changed, 10 insertions(+), 66 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8a86d64f..66e1e377 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dragonfly-api" -version = "2.0.61" +version = "2.0.62" authors = ["Gaius "] edition = "2021" license = "Apache-2.0" diff --git a/pkg/apis/scheduler/v1/scheduler.pb.go b/pkg/apis/scheduler/v1/scheduler.pb.go index 17817be0..10eedc08 100644 --- a/pkg/apis/scheduler/v1/scheduler.pb.go +++ b/pkg/apis/scheduler/v1/scheduler.pb.go @@ -578,8 +578,6 @@ type PeerPacket struct { TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` // Source peer id. SrcPid string `protobuf:"bytes,3,opt,name=src_pid,json=srcPid,proto3" json:"src_pid,omitempty"` - // Concurrent downloading count from main peer. - ParallelCount int32 `protobuf:"varint,4,opt,name=parallel_count,json=parallelCount,proto3" json:"parallel_count,omitempty"` // Main peer. MainPeer *PeerPacket_DestPeer `protobuf:"bytes,5,opt,name=main_peer,json=mainPeer,proto3" json:"main_peer,omitempty"` // Candidate peers. @@ -640,13 +638,6 @@ func (x *PeerPacket) GetSrcPid() string { return "" } -func (x *PeerPacket) GetParallelCount() int32 { - if x != nil { - return x.ParallelCount - } - return 0 -} - func (x *PeerPacket) GetMainPeer() *PeerPacket_DestPeer { if x != nil { return x.MainPeer @@ -2577,15 +2568,12 @@ var file_pkg_apis_scheduler_v1_scheduler_proto_rawDesc = []byte{ 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0xe8, 0x03, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, + 0x69, 0x62, 0x75, 0x74, 0x65, 0x22, 0xb8, 0x03, 0x0a, 0x0a, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x74, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x0e, 0x70, 0x61, 0x72, 0x61, - 0x6c, 0x6c, 0x65, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x1a, 0x02, 0x28, 0x01, 0x52, 0x0d, 0x70, 0x61, 0x72, 0x61, 0x6c, - 0x6c, 0x65, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, + 0x52, 0x06, 0x73, 0x72, 0x63, 0x50, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x65, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x72, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x44, 0x65, 0x73, 0x74, 0x50, 0x65, 0x65, 0x72, 0x52, 0x08, 0x6d, 0x61, 0x69, diff --git a/pkg/apis/scheduler/v1/scheduler.pb.validate.go b/pkg/apis/scheduler/v1/scheduler.pb.validate.go index 42494ca4..794799fe 100644 --- a/pkg/apis/scheduler/v1/scheduler.pb.validate.go +++ b/pkg/apis/scheduler/v1/scheduler.pb.validate.go @@ -1022,17 +1022,6 @@ func (m *PeerPacket) validate(all bool) error { errors = append(errors, err) } - if m.GetParallelCount() < 1 { - err := PeerPacketValidationError{ - field: "ParallelCount", - reason: "value must be greater than or equal to 1", - } - if !all { - return err - } - errors = append(errors, err) - } - if all { switch v := interface{}(m.GetMainPeer()).(type) { case interface{ ValidateAll() error }: diff --git a/pkg/apis/scheduler/v1/scheduler.proto b/pkg/apis/scheduler/v1/scheduler.proto index 5b85be5c..58a2407a 100644 --- a/pkg/apis/scheduler/v1/scheduler.proto +++ b/pkg/apis/scheduler/v1/scheduler.proto @@ -133,8 +133,6 @@ message PeerPacket{ string task_id = 2 [(validate.rules).string.min_len = 1]; // Source peer id. string src_pid = 3 [(validate.rules).string.min_len = 1]; - // Concurrent downloading count from main peer. - int32 parallel_count = 4 [(validate.rules).int32.gte = 1]; // Main peer. DestPeer main_peer = 5; // Candidate peers. diff --git a/pkg/apis/scheduler/v2/scheduler.pb.go b/pkg/apis/scheduler/v2/scheduler.pb.go index a666fe0a..c52de946 100644 --- a/pkg/apis/scheduler/v2/scheduler.pb.go +++ b/pkg/apis/scheduler/v2/scheduler.pb.go @@ -1110,8 +1110,6 @@ type NormalTaskResponse struct { // Candidate parents. CandidateParents []*v2.Peer `protobuf:"bytes,1,rep,name=candidate_parents,json=candidateParents,proto3" json:"candidate_parents,omitempty"` - // Concurrent downloading piece count from the peers. - ConcurrentPieceCount uint32 `protobuf:"varint,2,opt,name=concurrent_piece_count,json=concurrentPieceCount,proto3" json:"concurrent_piece_count,omitempty"` } func (x *NormalTaskResponse) Reset() { @@ -1153,13 +1151,6 @@ func (x *NormalTaskResponse) GetCandidateParents() []*v2.Peer { return nil } -func (x *NormalTaskResponse) GetConcurrentPieceCount() uint32 { - if x != nil { - return x.ConcurrentPieceCount - } - return 0 -} - // NeedBackToSourceResponse represents need back-to-source response of AnnouncePeerResponse. type NeedBackToSourceResponse struct { state protoimpl.MessageState @@ -2331,17 +2322,13 @@ var file_pkg_apis_scheduler_v2_scheduler_proto_rawDesc = []byte{ 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0x13, 0x0a, 0x11, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9b, - 0x01, 0x0a, 0x12, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x11, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x65, 0x65, - 0x72, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x10, 0x63, 0x61, 0x6e, - 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3d, 0x0a, - 0x16, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x69, 0x65, 0x63, - 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x2a, 0x02, 0x28, 0x01, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x50, 0x69, 0x65, 0x63, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x5a, 0x0a, 0x18, + 0x74, 0x79, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5c, + 0x0a, 0x12, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x11, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x65, 0x65, 0x72, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x10, 0x63, 0x61, 0x6e, 0x64, + 0x69, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x5a, 0x0a, 0x18, 0x4e, 0x65, 0x65, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, diff --git a/pkg/apis/scheduler/v2/scheduler.pb.validate.go b/pkg/apis/scheduler/v2/scheduler.pb.validate.go index eab525f4..b0eebcd6 100644 --- a/pkg/apis/scheduler/v2/scheduler.pb.validate.go +++ b/pkg/apis/scheduler/v2/scheduler.pb.validate.go @@ -2678,17 +2678,6 @@ func (m *NormalTaskResponse) validate(all bool) error { } - if m.GetConcurrentPieceCount() < 1 { - err := NormalTaskResponseValidationError{ - field: "ConcurrentPieceCount", - reason: "value must be greater than or equal to 1", - } - if !all { - return err - } - errors = append(errors, err) - } - if len(errors) > 0 { return NormalTaskResponseMultiError(errors) } diff --git a/pkg/apis/scheduler/v2/scheduler.proto b/pkg/apis/scheduler/v2/scheduler.proto index 6a47915d..de572ed7 100644 --- a/pkg/apis/scheduler/v2/scheduler.proto +++ b/pkg/apis/scheduler/v2/scheduler.proto @@ -162,8 +162,6 @@ message EmptyTaskResponse { message NormalTaskResponse { // Candidate parents. repeated common.v2.Peer candidate_parents = 1 [(validate.rules).repeated = {min_items: 1}]; - // Concurrent downloading piece count from the peers. - uint32 concurrent_piece_count = 2 [(validate.rules).uint32.gte = 1]; } // NeedBackToSourceResponse represents need back-to-source response of AnnouncePeerResponse. diff --git a/proto/scheduler.proto b/proto/scheduler.proto index ac3fd66e..44337449 100644 --- a/proto/scheduler.proto +++ b/proto/scheduler.proto @@ -155,8 +155,6 @@ message EmptyTaskResponse { message NormalTaskResponse { // Candidate parents. repeated common.v2.Peer candidate_parents = 1; - // Concurrent downloading piece count from the peers. - uint32 concurrent_piece_count = 2; } // NeedBackToSourceResponse represents need back-to-source response of AnnouncePeerResponse. diff --git a/src/descriptor.bin b/src/descriptor.bin index 12c6bc4a1a1cf1030f1748449c2b477211b25b47..1f8b9146df1f53b133fdcc15e86d80bec6712d00 100644 GIT binary patch delta 2683 zcmZuzTWnNS6uo9}Ovn zATN_zPe>!78lX@E3>8g~R4~B=8-#>lLQn`OMnaluNC~7tT>H#Dxj+6)W}SW3+H385 z=APMo)&Biw`_$I^{MWXDZTD}DrcUNXOAv~O0F(*i@l;U>-4~z zZEN`3I;Q;|eXhQa()XnsUAD_T=MY(6s*y?bPV^9kvTmzu+vRL|_7}u8i6(Wvh+^uQ zjgOuRa$B+Lx)akMXyb(} z&pArmPvbNR7#c?@ROXJCvbg9YyRlGY%h7O>f!Nze6;ljEzdo9t^QkBvBYTElBv1h> z1hzw%bh&bxDT8~A8k>ABd-id%+x#Mf3z#wx)Z>(%Yapn{X@0Bw0%Ary=OkI*C^trJ z;gb}qbYsX7ksNuoJW0_Oe8<%C#39WGgj}9V$_#{Do+447h~j|yCr;6h2os0{0Z}3h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G^({o!a%KAQ!ubfs_TmGewXcf&v}KcSBZRnI5;|UEu*qUTCEN= z(Cx`rC=s|la8=KiXHTm0SiEDBIBbJOw3(#ZdaVnHHk0Hv8;CZO6tuecqK)S{r^xy< z+H6zf4b-4~pEBx4X<9u3*R^hy?SXxY5_xwm8hQ!Kb50XaQfF^*7C%#D zcZNl_91R-`#IsY>xZXe*nWBxQh>GGFvTu%xGy*Pgqrtk|w821d&rs*4h|8XRmh9fB z$e;q|4FvTpHE%T#)U$M3k9#}vr#$C1vi^$vw*>bO?-}mHe)SJLacJP6+Qziz=_*F~WWAyR~zwr`SFj)Z6Zoy;$M7ssavRxBVTvWHU(2mj~v9AZ0W7)|?%C#5>$|AL{ zgBR(Aom^69TBxmai8vQMBYU_+`3?g?S)%nfxevj9-gCYn>r1uLLJuatkRw`zP+m+g zt33s3?_D;pa4f?8GS!AV0SMh?s&CS|fY4ngKj+>E-Dc1EnylZk`X_=XzotY=Por6c zS7aI+yH?B`un46UGY3E@t;ig@;H6pYUngGYx2YMM((18*a(7`NyjW1i7G5_O3!r{H zx>x|AbzLr&ezFej4whAGHoUSzvVZvYT10*3nmsH>Th zsY3ZhzWEkVN5l<|$~fEIQB`gyz>I<5j&pXCf#8mF*XF1#&=HO<#R6A>3K&iX5Y!_a z-HCwuVcdy#Vlsi}yv)`g6c=e%@@1L$dc+K5GDAy$Y0*oYH?~bdlkn zTWLD(QVq&<+@%_nY2LIe%7OvS zsHZ!SWhTzzfHD(jaX^`oESq(fRq}E2Ne6AYr^1eYeZc%G^saFD`Va_(3TO0pm_W3t YaMur`;jDsSg}2`Kh;v}5JY3%V4U6%mq5uE@ diff --git a/src/scheduler.v2.rs b/src/scheduler.v2.rs index 90b4ec6a..96901e6b 100644 --- a/src/scheduler.v2.rs +++ b/src/scheduler.v2.rs @@ -235,9 +235,6 @@ pub struct NormalTaskResponse { /// Candidate parents. #[prost(message, repeated, tag = "1")] pub candidate_parents: ::prost::alloc::vec::Vec, - /// Concurrent downloading piece count from the peers. - #[prost(uint32, tag = "2")] - pub concurrent_piece_count: u32, } /// NeedBackToSourceResponse represents need back-to-source response of AnnouncePeerResponse. #[derive(serde::Serialize, serde::Deserialize)]