async fn refresh_partition(&self, key: ReplicaKey, spec: PartitionSpec) {
        // generate replica
        let mut replica_msgs = ReplicaMsgs::default();
        replica_msgs.push(ReplicaMsg::update(Replica::new(
            key,
            spec.leader,
            spec.replicas.clone(),
        )));

        let request = UpdateReplicaRequest::encode_request(replica_msgs);
        let mut message = RequestMessage::new_request(request);
        message.get_mut_header().set_client_id("controller");

        for spu in spec.replicas {
            debug!(
                "sending replica: {} to spu: {}",
                message.request.decode_request(),
                spu
            );
            match self.send_msg(&spu, &message).await {
                Ok(status) => {
                    if !status {
                        trace!(
                            "unable to send partition: {} to offline spu: {}",
                            spec.leader,
                            spu
                        );
                    }
                }
                Err(err) => warn!(
                    "error {} sending partition: {} to spu: {}",
                    err, spec.leader, spu
                ),
            }
        }
    }
/// Update Partition information to all SPUs in the spec
Update Partition information to all SPUs in the spec
Update Partition information to all SPUs in the spec
async fn refresh_partition(&self, key: ReplicaKey, spec: PartitionSpec) {
        // generate replica
        let mut replica_msgs = ReplicaMsgs::default();
        replica_msgs.push(ReplicaMsg::update(Replica::new(
            key,
            spec.leader,
            spec.replicas.clone(),
        )));
        let request = UpdateReplicaRequest::encode_request(replica_msgs);
        let mut message = RequestMessage::new_request(request);
        message.get_mut_header().set_client_id("controller");
        for spu in spec.replicas {
            debug!(
                "sending replica: {} to spu: {}",
                message.request.decode_request(),
                spu
            );
            match self.send_msg(&spu, &message).await {
                Ok(status) => {
                    if !status {
                        trace!(
                            "unable to send partition: {} to offline spu: {}",
                            spec.leader,
                            spu
                        );
                    }
                }
                Err(err) => warn!(
                    "error {} sending partition: {} to spu: {}",
                    err, spec.leader, spu
                ),
            }
        }
    }
async fn refresh_partition ( & self , key : ReplicaKey , spec : PartitionSpec ) { // generate replica let mut replica_msgs = ReplicaMsgs :: default ( ) ; replica_msgs . push ( ReplicaMsg :: update ( Replica :: new ( key , spec . leader , spec . replicas . clone ( ) , ) ) ) ; let request = UpdateReplicaRequest :: encode_request ( replica_msgs ) ; let mut message = RequestMessage :: new_request ( request ) ; message . get_mut_header ( ) . set_client_id ( " " ) ; for spu in spec . replicas { debug ! ( " " message request decode_request ( ) spu ) ; match self . send_msg ( & spu , & message ) . await { Ok ( status ) => { if ! status { trace ! ( " " spec leader spu ) ; } } Err ( err ) => warn ! ( " " err spec leader spu ) , } } }
Update Partition information to all SPUs in the spec
Update Partition information to all SPUs in the spec
&self
key
ReplicaKey
spec
PartitionSpec
&self
key
ReplicaKey
spec
PartitionSpec