pub fn generate_replica_map(
        &self,
        spus: &SpuLocalStore,
        param: &TopicReplicaParam
    ) -> TopicNextState {
        
        let spu_count = spus.count();
        if spu_count < param.replication_factor {

            trace!(
                "topic '{}' - R-MAP needs {:?} online spus, found {:?}",
                self.key,
                param.replication_factor,
                spu_count
            );

            let reason = format!("need {} more SPU",param.replication_factor - spu_count);
            TopicStatus::set_resolution_no_resource(reason).into()

            
        } else {
            let replica_map = generate_replica_map_for_topic(spus,param,None);
            if replica_map.len() > 0 {
                (TopicStatus::next_resolution_provisoned(),replica_map).into()
            } else {
                let reason = "empty replica map";
                TopicStatus::set_resolution_no_resource(reason.to_owned()).into()
            }

        }
    }
///
/// Genereate Replica Map if there are enough online spus
///  * returns a replica map or a reason for the failure
///  * fatal error sare configuration errors and are not recovarable
///
Genereate Replica Map if there are enough online spus
returns a replica map or a reason for the failure
fatal error sare configuration errors and are not recovarable
Genereate Replica Map if there are enough online spus returns a replica map or a reason for the failure fatal error sare configuration errors and are not recovarable
pub fn generate_replica_map(
        &self,
        spus: &SpuLocalStore,
        param: &TopicReplicaParam
    ) -> TopicNextState {
        let spu_count = spus.count();
        if spu_count < param.replication_factor {
            trace!(
                "topic '{}' - R-MAP needs {:?} online spus, found {:?}",
                self.key,
                param.replication_factor,
                spu_count
            );
            let reason = format!("need {} more SPU",param.replication_factor - spu_count);
            TopicStatus::set_resolution_no_resource(reason).into()
        } else {
            let replica_map = generate_replica_map_for_topic(spus,param,None);
            if replica_map.len() > 0 {
                (TopicStatus::next_resolution_provisoned(),replica_map).into()
            } else {
                let reason = "empty replica map";
                TopicStatus::set_resolution_no_resource(reason.to_owned()).into()
            }
        }
    }
pub fn generate_replica_map ( & self , spus : & SpuLocalStore , param : & TopicReplicaParam ) -> TopicNextState { let spu_count = spus . count ( ) ; if spu_count < param . replication_factor { trace ! ( " " self key param replication_factor spu_count ) ; let reason = format ! ( " " param replication_factor spu_count ) ; TopicStatus :: set_resolution_no_resource ( reason ) . into ( ) } else { let replica_map = generate_replica_map_for_topic ( spus , param , None ) ; if replica_map . len ( ) > 0 { ( TopicStatus :: next_resolution_provisoned ( ) , replica_map ) . into ( ) } else { let reason = " " ; TopicStatus :: set_resolution_no_resource ( reason . to_owned ( ) ) . into ( ) } } }
Genereate Replica Map if there are enough online spus
 returns a replica map or a reason for the failure
 fatal error sare configuration errors and are not recovarable
Genereate Replica Map if there are enough online spus returns a replica map or a reason for the failure fatal error sare configuration errors and are not recovarable
&self
spus
&SpuLocalStore
param
&TopicReplicaParam
&self
spus
&SpuLocalStore
param
&TopicReplicaParam