| 438 | } |
| 439 | |
| 440 | int Learner :: SendLearnValue( |
| 441 | const nodeid_t iSendNodeID, |
| 442 | const uint64_t llLearnInstanceID, |
| 443 | const BallotNumber & oLearnedBallot, |
| 444 | const std::string & sLearnedValue, |
| 445 | const uint32_t iChecksum, |
| 446 | const bool bNeedAck) |
| 447 | { |
| 448 | BP->GetLearnerBP()->SendLearnValue(); |
| 449 | |
| 450 | PaxosMsg oPaxosMsg; |
| 451 | |
| 452 | oPaxosMsg.set_msgtype(MsgType_PaxosLearner_SendLearnValue); |
| 453 | oPaxosMsg.set_instanceid(llLearnInstanceID); |
| 454 | oPaxosMsg.set_nodeid(m_poConfig->GetMyNodeID()); |
| 455 | oPaxosMsg.set_proposalnodeid(oLearnedBallot.m_llNodeID); |
| 456 | oPaxosMsg.set_proposalid(oLearnedBallot.m_llProposalID); |
| 457 | oPaxosMsg.set_value(sLearnedValue); |
| 458 | oPaxosMsg.set_lastchecksum(iChecksum); |
| 459 | if (bNeedAck) |
| 460 | { |
| 461 | oPaxosMsg.set_flag(PaxosMsgFlagType_SendLearnValue_NeedAck); |
| 462 | } |
| 463 | |
| 464 | return SendMessage(iSendNodeID, oPaxosMsg, Message_SendType_TCP); |
| 465 | } |
| 466 | |
| 467 | void Learner :: OnSendLearnValue(const PaxosMsg & oPaxosMsg) |
| 468 | { |
nothing calls this directly
no test coverage detected