@@ -73,24 +73,6 @@ pub fn default_download_request_rate_limit() -> u64 {
7373 4000
7474}
7575
76- /// default_parent_selector_sync_interval is the default interval to sync host information.
77- #[ inline]
78- fn default_parent_selector_sync_interval ( ) -> Duration {
79- Duration :: from_millis ( 500 )
80- }
81-
82- /// default_parent_selector_timeout is the default timeout for the sync host.
83- #[ inline]
84- fn default_parent_selector_timeout ( ) -> Duration {
85- Duration :: from_secs ( 3 )
86- }
87-
88- /// default_parent_selector_capacity is the default capacity of the parent selector's gRPC connections.
89- #[ inline]
90- pub fn default_parent_selector_capacity ( ) -> usize {
91- 20
92- }
93-
9476/// default_host_hostname is the default hostname of the host.
9577#[ inline]
9678fn default_host_hostname ( ) -> String {
@@ -398,9 +380,6 @@ pub struct Download {
398380 #[ serde( default = "default_download_protocol" ) ]
399381 pub protocol : String ,
400382
401- /// parent_selector is the download parent selector configuration for dfdaemon.
402- pub parent_selector : ParentSelector ,
403-
404383 /// rate_limit is the rate limit of the download speed in GiB/Mib/Kib per second.
405384 #[ serde( with = "bytesize_serde" , default = "default_download_rate_limit" ) ]
406385 pub rate_limit : ByteSize ,
@@ -429,7 +408,6 @@ impl Default for Download {
429408 Download {
430409 server : DownloadServer :: default ( ) ,
431410 protocol : default_download_protocol ( ) ,
432- parent_selector : ParentSelector :: default ( ) ,
433411 rate_limit : default_download_rate_limit ( ) ,
434412 piece_timeout : default_download_piece_timeout ( ) ,
435413 collected_piece_timeout : default_collected_download_piece_timeout ( ) ,
@@ -553,59 +531,6 @@ impl UploadClient {
553531 }
554532}
555533
556- /// ParentSelector is the download parent selector configuration for dfdaemon. It will synchronize
557- /// the host info in real-time from the parents and then select the parents for downloading.
558- ///
559- /// The workflow diagram is as follows:
560- ///
561- ///```text
562- /// +----------+
563- /// ----------------| Parent |---------------
564- /// | +----------+ |
565- /// Host Info Piece Metadata
566- /// +------------|-----------------------------------------|------------+
567- /// | | | |
568- /// | | Peer | |
569- /// | v v |
570- /// | +------------------+ +------------------+ |
571- /// | | ParentSelector | ---Optimal Parent---> | PieceCollector | |
572- /// | +------------------+ +------------------+ |
573- /// | | |
574- /// | Piece Metadata |
575- /// | | |
576- /// | v |
577- /// | +------------+ |
578- /// | | Download | |
579- /// | +------------+ |
580- /// +-------------------------------------------------------------------+
581- /// ```
582- #[ derive( Debug , Clone , Default , Validate , Deserialize ) ]
583- #[ serde( default , rename_all = "camelCase" ) ]
584- pub struct ParentSelector {
585- /// enable indicates whether enable parent selector for downloading.
586- ///
587- /// If `enable` is true, the `ParentSelector`'s sync loop will start. It will periodically fetch
588- /// host information from parents and use this information to calculate scores for selecting the
589- /// parents for downloading.
590- pub enable : bool ,
591-
592- /// sync_interval is the interval to sync parents' host info by gRPC streaming.
593- #[ serde(
594- default = "default_parent_selector_sync_interval" ,
595- with = "humantime_serde"
596- ) ]
597- pub sync_interval : Duration ,
598-
599- /// timeout is the timeout for the sync host.
600- #[ serde( default = "default_parent_selector_timeout" , with = "humantime_serde" ) ]
601- pub timeout : Duration ,
602-
603- /// capacity is the maximum number of gRPC connections that `DfdaemonUpload.SyncHost` maintains
604- /// in the `ParentSelector`, the default value is 20.
605- #[ serde( default = "default_parent_selector_capacity" ) ]
606- pub capacity : usize ,
607- }
608-
609534/// Upload is the upload configuration for dfdaemon.
610535#[ derive( Debug , Clone , Validate , Deserialize ) ]
611536#[ serde( default , rename_all = "camelCase" ) ]
0 commit comments