| 496 | } |
| 497 | |
| 498 | int PNode :: AddMember(const int iGroupIdx, const NodeInfo & oNode) |
| 499 | { |
| 500 | if (!CheckGroupID(iGroupIdx)) |
| 501 | { |
| 502 | return Paxos_GroupIdxWrong; |
| 503 | } |
| 504 | |
| 505 | SystemVSM * poSystemVSM = m_vecGroupList[iGroupIdx]->GetConfig()->GetSystemVSM(); |
| 506 | |
| 507 | if (poSystemVSM->GetGid() == 0) |
| 508 | { |
| 509 | return Paxos_MembershipOp_NoGid; |
| 510 | } |
| 511 | |
| 512 | uint64_t llVersion = 0; |
| 513 | NodeInfoList vecNodeInfoList; |
| 514 | poSystemVSM->GetMembership(vecNodeInfoList, llVersion); |
| 515 | |
| 516 | for (auto & oNodeInfo : vecNodeInfoList) |
| 517 | { |
| 518 | if (oNodeInfo.GetNodeID() == oNode.GetNodeID()) |
| 519 | { |
| 520 | return Paxos_MembershipOp_Add_NodeExist; |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | vecNodeInfoList.push_back(oNode); |
| 525 | |
| 526 | return ProposalMembership(poSystemVSM, iGroupIdx, vecNodeInfoList, llVersion); |
| 527 | } |
| 528 | |
| 529 | int PNode :: RemoveMember(const int iGroupIdx, const NodeInfo & oNode) |
| 530 | { |
nothing calls this directly
no outgoing calls
no test coverage detected