22//!
33//! This splits the work of warming-up and performing the trie update across worker threads.
44
5- use anyhow:: Context ;
65use crossbeam:: channel:: { self , Receiver , Sender } ;
76use page_set:: FrozenSharedPageSet ;
87use parking_lot:: Mutex ;
@@ -14,10 +13,7 @@ use nomt_core::{
1413} ;
1514use seek:: Seek ;
1615
17- use std:: {
18- collections:: HashMap ,
19- sync:: { mpsc:: RecvError , Arc } ,
20- } ;
16+ use std:: { collections:: HashMap , sync:: Arc } ;
2117
2218use crate :: {
2319 io:: PagePool ,
@@ -248,7 +244,7 @@ impl Updater {
248244
249245 let ( worker_tx, worker_rx) = crossbeam_channel:: bounded ( num_workers) ;
250246
251- for ( worker_id , write_pass) in worker_passes. into_iter ( ) . enumerate ( ) {
247+ for write_pass in worker_passes. into_iter ( ) {
252248 let command = UpdateCommand {
253249 shared : shared. clone ( ) ,
254250 write_pass : write_pass. into_envelope ( ) ,
@@ -262,7 +258,6 @@ impl Updater {
262258 warm_ups : warm_ups. clone ( ) ,
263259 warm_page_set : warm_page_set. clone ( ) ,
264260 command,
265- worker_id,
266261 } ;
267262 spawn_updater :: < H > ( & self . worker_tp , params, worker_tx. clone ( ) ) ;
268263 }
@@ -490,7 +485,6 @@ fn spawn_updater<H: HashAlgorithm>(
490485 params : worker:: UpdateParams ,
491486 output_tx : Sender < TaskResult < std:: io:: Result < WorkerOutput > > > ,
492487) {
493- let worker_id = params. worker_id ;
494488 spawn_task ( & worker_tp, || worker:: run_update :: < H > ( params) , output_tx) ;
495489}
496490
0 commit comments