本文整理汇总了C++中PaxosMsg::mastervariables方法的典型用法代码示例。如果您正苦于以下问题:C++ PaxosMsg::mastervariables方法的具体用法?C++ PaxosMsg::mastervariables怎么用?C++ PaxosMsg::mastervariables使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaxosMsg
的用法示例。
在下文中一共展示了PaxosMsg::mastervariables方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void Learner :: OnSendNowInstanceID(const PaxosMsg & oPaxosMsg)
{
BP->GetLearnerBP()->OnSendNowInstanceID();
PLGHead("START Msg.InstanceID %lu Now.InstanceID %lu Msg.from_nodeid %lu Msg.MaxInstanceID %lu systemvariables_size %zu mastervariables_size %zu",
oPaxosMsg.instanceid(), GetInstanceID(), oPaxosMsg.nodeid(), oPaxosMsg.nowinstanceid(),
oPaxosMsg.systemvariables().size(), oPaxosMsg.mastervariables().size());
SetSeenInstanceID(oPaxosMsg.nowinstanceid(), oPaxosMsg.nodeid());
bool bSystemVariablesChange = false;
int ret = m_poConfig->GetSystemVSM()->UpdateByCheckpoint(oPaxosMsg.systemvariables(), bSystemVariablesChange);
if (ret == 0 && bSystemVariablesChange)
{
PLGHead("SystemVariables changed!, all thing need to reflesh, so skip this msg");
return;
}
bool bMasterVariablesChange = false;
if (m_poConfig->GetMasterSM() != nullptr)
{
ret = m_poConfig->GetMasterSM()->UpdateByCheckpoint(oPaxosMsg.mastervariables(), bMasterVariablesChange);
if (ret == 0 && bMasterVariablesChange)
{
PLGHead("MasterVariables changed!");
}
}
if (oPaxosMsg.instanceid() != GetInstanceID())
{
PLGErr("Lag msg, skip");
return;
}
if (oPaxosMsg.nowinstanceid() <= GetInstanceID())
{
PLGErr("Lag msg, skip");
return;
}
if (oPaxosMsg.minchoseninstanceid() > GetInstanceID())
{
BP->GetCheckpointBP()->NeedAskforCheckpoint();
PLGHead("my instanceid %lu small than other's minchoseninstanceid %lu, other nodeid %lu",
GetInstanceID(), oPaxosMsg.minchoseninstanceid(), oPaxosMsg.nodeid());
AskforCheckpoint(oPaxosMsg.nodeid());
}
else if (!m_bIsIMLearning)
{
ComfirmAskForLearn(oPaxosMsg.nodeid());
}
}