fn regenerate_dataset_channels(
        &mut self,
        thread_map: &BTreeMap<u64, (JoinHandle<()>, Sender<SiemMessage>)>,
        component_map: &BTreeMap<String, Vec<u64>>,
    ) {
        match self.dataset_channels.lock() {
            Ok(mut dataset_channels) => {
                for (dataset_name, comp_names) in self.dataset_map.iter() {
                    let mut channels = vec![];
                    for comp_name in comp_names {
                        match component_map.get(comp_name) {
                            Some(comp_ids) => {
                                for id in comp_ids {
                                    match thread_map.get(id) {
                                        Some((_, chan)) => {
                                            channels.push(chan.clone());
                                        }
                                        None => {}
                                    }
                                }
                            }
                            None => {}
                        }
                    }
                    dataset_channels.insert(dataset_name.clone(), channels);
                }
            }
            Err(_) => {
                //TODO
            }
        }
    }
/// If a component dies, then we need to recreate the Map of channels for the datasetmanager using the information of the components that are still running
If a component dies, then we need to recreate the Map of channels for the datasetmanager using the information of the components that are still running
If a component dies then we need to recreate the Map of channels for the datasetmanager using the information of the components that are still running
fn regenerate_dataset_channels(
        &mut self,
        thread_map: &BTreeMap<u64, (JoinHandle<()>, Sender<SiemMessage>)>,
        component_map: &BTreeMap<String, Vec<u64>>,
    ) {
        match self.dataset_channels.lock() {
            Ok(mut dataset_channels) => {
                for (dataset_name, comp_names) in self.dataset_map.iter() {
                    let mut channels = vec![];
                    for comp_name in comp_names {
                        match component_map.get(comp_name) {
                            Some(comp_ids) => {
                                for id in comp_ids {
                                    match thread_map.get(id) {
                                        Some((_, chan)) => {
                                            channels.push(chan.clone());
                                        }
                                        None => {}
                                    }
                                }
                            }
                            None => {}
                        }
                    }
                    dataset_channels.insert(dataset_name.clone(), channels);
                }
            }
            Err(_) => {
                //TODO
            }
        }
    }
fn regenerate_dataset_channels ( & mut self , thread_map : & BTreeMap < u64 , ( JoinHandle < ( ) > , Sender < SiemMessage > ) > , component_map : & BTreeMap < String , Vec < u64 > > , ) { match self . dataset_channels . lock ( ) { Ok ( mut dataset_channels ) => { for ( dataset_name , comp_names ) in self . dataset_map . iter ( ) { let mut channels = vec ! [ ] ; for comp_name in comp_names { match component_map . get ( comp_name ) { Some ( comp_ids ) => { for id in comp_ids { match thread_map . get ( id ) { Some ( ( _ , chan ) ) => { channels . push ( chan . clone ( ) ) ; } None => { } } } } None => { } } } dataset_channels . insert ( dataset_name . clone ( ) , channels ) ; } } Err ( _ ) => { //TODO } } }
If a component dies, then we need to recreate the Map of channels for the datasetmanager using the information of the components that are still running
If a component dies then we need to recreate the Map of channels for the datasetmanager using the information of the components that are still running
&mut self
thread_map
&BTreeMap<u64, (JoinHandle<()>, Sender<SiemMessage>)>
component_map
&BTreeMap<String, Vec<u64>>
&mut self
thread_map
&BTreeMap<u64, (JoinHandle<()>, Sender<SiemMessage>)>
component_map
&BTreeMap<String, Vec<u64>>