@@ -111,7 +111,7 @@ pub struct ParentSelector {
111111 id_generator : Arc < IDGenerator > ,
112112
113113 /// Maps parent host IDs to their current bandwidth weights.
114- weights : Arc < DashMap < String , u32 > > ,
114+ weights : Arc < DashMap < String , u64 > > ,
115115
116116 /// Active connections indexed by parent host ID and each connection tracks usage and manages its sync task.
117117 connections : Arc < DashMap < String , Connection > > ,
@@ -149,7 +149,7 @@ impl ParentSelector {
149149 /// (better idle bandwidth) have a higher probability of being selected. If weight
150150 /// calculation fails, falls back to uniform random selection.
151151 pub fn select ( & self , parents : Vec < CollectedParent > ) -> CollectedParent {
152- let weights: Vec < u32 > = parents
152+ let weights: Vec < u64 > = parents
153153 . iter ( )
154154 . map ( |parent| {
155155 let Some ( parent_host) = parent. host . as_ref ( ) else {
@@ -304,7 +304,7 @@ impl ParentSelector {
304304 host_id : String ,
305305 peer_id : String ,
306306 parent_host_id : String ,
307- weights : Arc < DashMap < String , u32 > > ,
307+ weights : Arc < DashMap < String , u64 > > ,
308308 dfdaemon_upload_client : DfdaemonUploadClient ,
309309 mut shutdown : Shutdown ,
310310 mut dfdaemon_shutdown : Shutdown ,
@@ -332,7 +332,7 @@ impl ParentSelector {
332332 let idle_tx_bandwidth = Self :: get_idle_tx_bandwidth( & message) ;
333333
334334 info!( "update host {} idle TX bandwidth to {}" , parent_host_id, idle_tx_bandwidth) ;
335- weights. insert( parent_host_id. clone( ) , idle_tx_bandwidth as u32 ) ;
335+ weights. insert( parent_host_id. clone( ) , idle_tx_bandwidth) ;
336336 }
337337 None => break ,
338338 }
@@ -406,7 +406,7 @@ pub struct PersistentCacheParentSelector {
406406 id_generator : Arc < IDGenerator > ,
407407
408408 /// Maps parent host IDs to their current bandwidth weights.
409- weights : Arc < DashMap < String , u32 > > ,
409+ weights : Arc < DashMap < String , u64 > > ,
410410
411411 /// Active connections indexed by parent host ID and each connection tracks usage and manages its sync task.
412412 connections : Arc < DashMap < String , Connection > > ,
@@ -444,7 +444,7 @@ impl PersistentCacheParentSelector {
444444 /// (better idle bandwidth) have a higher probability of being selected. If weight
445445 /// calculation fails, falls back to uniform random selection.
446446 pub fn select ( & self , parents : Vec < CollectedParent > ) -> CollectedParent {
447- let weights: Vec < u32 > = parents
447+ let weights: Vec < u64 > = parents
448448 . iter ( )
449449 . map ( |parent| {
450450 let Some ( parent_host) = parent. host . as_ref ( ) else {
@@ -605,7 +605,7 @@ impl PersistentCacheParentSelector {
605605 host_id : String ,
606606 peer_id : String ,
607607 parent_host_id : String ,
608- weights : Arc < DashMap < String , u32 > > ,
608+ weights : Arc < DashMap < String , u64 > > ,
609609 dfdaemon_upload_client : DfdaemonUploadClient ,
610610 mut shutdown : Shutdown ,
611611 mut dfdaemon_shutdown : Shutdown ,
@@ -636,7 +636,7 @@ impl PersistentCacheParentSelector {
636636 let idle_tx_bandwidth = Self :: get_idle_tx_bandwidth( & message) ;
637637
638638 info!( "update host {} idle TX bandwidth to {}" , parent_host_id, idle_tx_bandwidth) ;
639- weights. insert( parent_host_id. clone( ) , idle_tx_bandwidth as u32 ) ;
639+ weights. insert( parent_host_id. clone( ) , idle_tx_bandwidth) ;
640640 }
641641 None => break ,
642642 }
0 commit comments