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

Class CommitCtx

src/algorithm/commitctx.h:33–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31class StateMachine;
32
33class CommitCtx
34{
35public:
36 CommitCtx(Config * poConfig);
37 ~CommitCtx();
38
39 void NewCommit(std::string * psValue, SMCtx * poSMCtx, const int iTimeoutMs);
40
41 const bool IsNewCommit() const;
42
43 std::string & GetCommitValue();
44
45 void StartCommit(const uint64_t llInstanceID);
46
47 bool IsMyCommit(const uint64_t llInstanceID, const std::string & sLearnValue, SMCtx *& poSMCtx);
48
49public:
50 void SetResult(const int iCommitRet, const uint64_t llInstanceID, const std::string & sLearnValue);
51
52 void SetResultOnlyRet(const int iCommitRet);
53
54 int GetResult(uint64_t & llSuccInstanceID);
55
56public:
57 const int GetTimeoutMs() const;
58
59private:
60 Config * m_poConfig;
61
62 uint64_t m_llInstanceID;
63 int m_iCommitRet;
64 bool m_bIsCommitEnd;
65 int m_iTimeoutMs;
66
67 std::string * m_psValue;
68 SMCtx * m_poSMCtx;
69 SerialLock m_oSerialLock;
70};
71}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected