MCPcopy Create free account
hub / github.com/Tencent/phxpaxos / SendLearnValue

Method SendLearnValue

src/algorithm/learner.cpp:440–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440int 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
467void Learner :: OnSendLearnValue(const PaxosMsg & oPaxosMsg)
468{

Callers

nothing calls this directly

Calls 1

SendLearnValueMethod · 0.80

Tested by

no test coverage detected