///
/// Process Partition Actions - dispatch to ADD/MOD/DEL handlers
///
Process Partition Actions - dispatch to ADD/MOD/DEL handlers
Process Partition Actions - dispatch to ADD / MOD / DEL handlers
pub fn process_requests(
        &self,
        requests: PartitionChangeRequest,
    ) -> Result<PartitionActions, ScServerError> {
        trace!("Processing requests: {}", requests);
        let mut actions = PartitionActions::default();
        match requests {
            PartitionChangeRequest::Partition(partition_requests) => {
                for partiton_request in partition_requests.into_iter() {
                    match partiton_request {
                        LSChange::Add(partition) => {
                            log_on_err!(self.add_partition_action_handler(partition, &mut actions));
                        }
                        LSChange::Mod(new_partition, old_partition) => {
                            log_on_err!(self.mod_partition_action_handler(
                                new_partition,
                                old_partition,
                                &mut actions,
                            ));
                        }
                        LSChange::Delete(partition) => {
                            log_on_err!(self.del_partition_action_handler(partition, &mut actions));
                        }
                    }
                }
            }
            PartitionChangeRequest::Spu(spu_requests) => {
                for spu_request in spu_requests.into_iter() {
                    debug!("SPU LS: {}", spu_request);
                    trace!("SPU LS: {:#?}", spu_request);
                    match spu_request {
                        LSChange::Mod(new_spu, old_spu) => {
                            if old_spu.status.is_online() && new_spu.status.is_offline() {
                                self.force_election_spu_off(new_spu, &mut actions);
                            } else {
                                if old_spu.status.is_offline() && new_spu.status.is_online() {
                                    self.force_election_spu_on(new_spu, &mut actions);
                                }
                            }
                        }
                        _ => {}
                    }
                }
            }
            PartitionChangeRequest::LrsUpdate(lrs_status) => {
                self.process_lrs_update_from_spu(lrs_status, &mut actions);
            }
        }
        Ok(actions)
    }
pub fn process_requests ( & self , requests : PartitionChangeRequest , ) -> Result < PartitionActions , ScServerError > { trace ! ( " " requests ) ; let mut actions = PartitionActions :: default ( ) ; match requests { PartitionChangeRequest :: Partition ( partition_requests ) => { for partiton_request in partition_requests . into_iter ( ) { match partiton_request { LSChange :: Add ( partition ) => { log_on_err ! ( self add_partition_action_handler ( partition mut actions ) ) ; } LSChange :: Mod ( new_partition , old_partition ) => { log_on_err ! ( self mod_partition_action_handler ( new_partition old_partition mut actions ) ) ; } LSChange :: Delete ( partition ) => { log_on_err ! ( self del_partition_action_handler ( partition mut actions ) ) ; } } } } PartitionChangeRequest :: Spu ( spu_requests ) => { for spu_request in spu_requests . into_iter ( ) { debug ! ( " " spu_request ) ; trace ! ( " " spu_request ) ; match spu_request { LSChange :: Mod ( new_spu , old_spu ) => { if old_spu . status . is_online ( ) && new_spu . status . is_offline ( ) { self . force_election_spu_off ( new_spu , & mut actions ) ; } else { if old_spu . status . is_offline ( ) && new_spu . status . is_online ( ) { self . force_election_spu_on ( new_spu , & mut actions ) ; } } } _ => { } } } } PartitionChangeRequest :: LrsUpdate ( lrs_status ) => { self . process_lrs_update_from_spu ( lrs_status , & mut actions ) ; } } Ok ( actions ) }
Process Partition Actions - dispatch to ADD/MOD/DEL handlers
Process Partition Actions - dispatch to ADD / MOD / DEL handlers
&self
requests
PartitionChangeRequest