| 90 | } |
| 91 | |
| 92 | int 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 | |
| 127 | const bool ProposeBatch :: NeedBatch() |
| 128 | { |
nothing calls this directly
no test coverage detected