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

Method Propose

src/node/propose_batch.cpp:92–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92int ProposeBatch :: Propose(const std::string & sValue, uint64_t & llInstanceID, uint32_t & iBatchIndex, SMCtx * poSMCtx)
93{
94 if (m_bIsEnd)
95 {
96 return Paxos_SystemError;
97 }
98
99 BP->GetCommiterBP()->BatchPropose();
100
101 uint64_t llThreadID = GetThreadID();
102
103 Notifier * poNotifier = nullptr;
104 int ret = m_poNotifierPool->GetNotifier(llThreadID, poNotifier);
105 if (ret != 0)
106 {
107 PLG1Err("GetNotifier fail, ret %d", ret);
108 BP->GetCommiterBP()->BatchProposeFail();
109 return Paxos_SystemError;
110 }
111
112 AddProposal(sValue, llInstanceID, iBatchIndex, poSMCtx, poNotifier);
113
114 poNotifier->WaitNotify(ret);
115 if (ret == PaxosTryCommitRet_OK)
116 {
117 BP->GetCommiterBP()->BatchProposeOK();
118 }
119 else
120 {
121 BP->GetCommiterBP()->BatchProposeFail();
122 }
123
124 return ret;
125}
126
127const bool ProposeBatch :: NeedBatch()
128{

Callers

nothing calls this directly

Calls 4

GetThreadIDFunction · 0.85
BatchProposeMethod · 0.80
BatchProposeFailMethod · 0.80
BatchProposeOKMethod · 0.80

Tested by

no test coverage detected