本文整理汇总了C++中PaxosMsg::set_proposalnodeid方法的典型用法代码示例。如果您正苦于以下问题:C++ PaxosMsg::set_proposalnodeid方法的具体用法?C++ PaxosMsg::set_proposalnodeid怎么用?C++ PaxosMsg::set_proposalnodeid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaxosMsg
的用法示例。
在下文中一共展示了PaxosMsg::set_proposalnodeid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendMessage
int Learner :: SendLearnValue(
const nodeid_t iSendNodeID,
const uint64_t llLearnInstanceID,
const BallotNumber & oLearnedBallot,
const std::string & sLearnedValue,
const uint32_t iChecksum,
const bool bNeedAck)
{
BP->GetLearnerBP()->SendLearnValue();
PaxosMsg oPaxosMsg;
oPaxosMsg.set_msgtype(MsgType_PaxosLearner_SendLearnValue);
oPaxosMsg.set_instanceid(llLearnInstanceID);
oPaxosMsg.set_nodeid(m_poConfig->GetMyNodeID());
oPaxosMsg.set_proposalnodeid(oLearnedBallot.m_llNodeID);
oPaxosMsg.set_proposalid(oLearnedBallot.m_llProposalID);
oPaxosMsg.set_value(sLearnedValue);
oPaxosMsg.set_lastchecksum(iChecksum);
if (bNeedAck)
{
oPaxosMsg.set_flag(PaxosMsgFlagType_SendLearnValue_NeedAck);
}
return SendMessage(iSendNodeID, oPaxosMsg, Message_SendType_TCP);
}
示例2: TransmitToFollower
void Learner :: TransmitToFollower()
{
if (m_poConfig->GetMyFollowerCount() == 0)
{
return;
}
PaxosMsg oPaxosMsg;
oPaxosMsg.set_msgtype(MsgType_PaxosLearner_SendLearnValue);
oPaxosMsg.set_instanceid(GetInstanceID());
oPaxosMsg.set_nodeid(m_poConfig->GetMyNodeID());
oPaxosMsg.set_proposalnodeid(m_poAcceptor->GetAcceptorState()->GetAcceptedBallot().m_llNodeID);
oPaxosMsg.set_proposalid(m_poAcceptor->GetAcceptorState()->GetAcceptedBallot().m_llProposalID);
oPaxosMsg.set_value(m_poAcceptor->GetAcceptorState()->GetAcceptedValue());
oPaxosMsg.set_lastchecksum(GetLastChecksum());
BroadcastMessageToFollower(oPaxosMsg, Message_SendType_TCP);
PLGHead("ok");
}
示例3: AskforLearn
void Learner :: AskforLearn()
{
BP->GetLearnerBP()->AskforLearn();
PLGHead("START");
PaxosMsg oPaxosMsg;
oPaxosMsg.set_instanceid(GetInstanceID());
oPaxosMsg.set_nodeid(m_poConfig->GetMyNodeID());
oPaxosMsg.set_msgtype(MsgType_PaxosLearner_AskforLearn);
if (m_poConfig->IsIMFollower())
{
//this is not proposal nodeid, just use this val to bring followto nodeid info.
oPaxosMsg.set_proposalnodeid(m_poConfig->GetFollowToNodeID());
}
PLGHead("END InstanceID %lu MyNodeID %lu", oPaxosMsg.instanceid(), oPaxosMsg.nodeid());
BroadcastMessage(oPaxosMsg, BroadcastMessage_Type_RunSelf_None, Message_SendType_TCP);
BroadcastMessageToTempNode(oPaxosMsg, Message_SendType_UDP);
}