diff --git a/include/phxpaxos/node.h b/include/phxpaxos/node.h index fa7026ddf..14aae0d2f 100644 --- a/include/phxpaxos/node.h +++ b/include/phxpaxos/node.h @@ -33,7 +33,7 @@ namespace phxpaxos class NetWork; -//All the funciton in class Node is thread safe! +//All the function in class Node is thread safe! class Node { @@ -42,7 +42,7 @@ class Node virtual ~Node() { } //If you want to end paxos, just delete poNode. - //But if you use your own network, poNode can be deleted after your own network stop recieving messages. + //But if you use your own network, poNode can be deleted after your own network stop receiving messages. static int RunNode(const Options & oOptions, Node *& poNode); //Base function. @@ -142,18 +142,18 @@ class Node //Qos //If many threads propose same group, that some threads will be on waiting status. - //Set max hold threads, and we will reject some propose request to avoid to many threads be holded. + //Set max hold threads, and we will reject some propose request to avoid to many threads be held. //Reject propose request will get retcode(PaxosTryCommitRet_TooManyThreadWaiting_Reject), check on def.h. virtual void SetMaxHoldThreads(const int iGroupIdx, const int iMaxHoldThreads) = 0; - //To avoid threads be holded too long time, we use this threshold to reject some propose to control thread's wait time. + //To avoid threads be held too long time, we use this threshold to reject some propose to control thread's wait time. virtual void SetProposeWaitTimeThresholdMS(const int iGroupIdx, const int iWaitTimeThresholdMS) = 0; //write disk virtual void SetLogSync(const int iGroupIdx, const bool bLogSync) = 0; //Not suggest to use this function - //pair: value,smid. + //pair: value, smid. //Because of BatchPropose, a InstanceID maybe include multi-value. virtual int GetInstanceValue(const int iGroupIdx, const uint64_t llInstanceID, std::vector > & vecValues) = 0; diff --git a/include/phxpaxos/sm.h b/include/phxpaxos/sm.h index 601c96c66..1a28da2b7 100644 --- a/include/phxpaxos/sm.h +++ b/include/phxpaxos/sm.h @@ -94,7 +94,7 @@ class StateMachine //Checkpoint file was on dir(sCheckpointTmpFileDirPath). //vecFileList is all the file in dir(sCheckpointTmpFileDirPath). //vecFileList filepath is absolute path. - //After called this fuction, paxoslib will kill the processor. + //After called this function, paxoslib will kill the processor. //State machine need to understand this when restart. virtual int LoadCheckpointState(const int iGroupIdx, const std::string & sCheckpointTmpFileDirPath, const std::vector & vecFileList, const uint64_t llCheckpointInstanceID); diff --git a/include/phxpaxos/storage.h b/include/phxpaxos/storage.h index 5f0bf58d0..299a6ac2b 100644 --- a/include/phxpaxos/storage.h +++ b/include/phxpaxos/storage.h @@ -29,7 +29,7 @@ namespace phxpaxos { //Paxoslib need to storage many datas, if you want to storage datas yourself, -//you must implememt all function in class LogStorage, and make sure that observe the writeoptions. +//you must implement all function in class LogStorage, and make sure that observe the writeoptions. class WriteOptions { diff --git a/sample/phxecho/echo_sm.cpp b/sample/phxecho/echo_sm.cpp index 51c6eb497..c6c5b2494 100644 --- a/sample/phxecho/echo_sm.cpp +++ b/sample/phxecho/echo_sm.cpp @@ -36,7 +36,7 @@ bool PhxEchoSM :: Execute(const int iGroupIdx, const uint64_t llInstanceID, printf("[SM Execute] ok, smid %d instanceid %lu value %s\n", SMID(), llInstanceID, sPaxosValue.c_str()); - //only commiter node have SMCtx. + //only committer node have SMCtx. if (poSMCtx != nullptr && poSMCtx->m_pCtx != nullptr) { PhxEchoSMCtx * poPhxEchoSMCtx = (PhxEchoSMCtx *)poSMCtx->m_pCtx; diff --git a/sample/phxkv/kv_paxos.cpp b/sample/phxkv/kv_paxos.cpp index c37e44d5e..184f8ec55 100644 --- a/sample/phxkv/kv_paxos.cpp +++ b/sample/phxkv/kv_paxos.cpp @@ -81,7 +81,7 @@ int PhxKV :: RunPaxos() oOptions.vecNodeInfoList = m_vecNodeList; //because all group share state machine(kv), so every group have same state machine. - //just for split key to different paxos group, to upgrate performance. + //just for split key to different paxos group, to upgrade performance. for (int iGroupIdx = 0; iGroupIdx < m_iGroupCount; iGroupIdx++) { GroupSMInfo oSMInfo; diff --git a/src/algorithm/acceptor.cpp b/src/algorithm/acceptor.cpp index 707493401..2269a1e0b 100644 --- a/src/algorithm/acceptor.cpp +++ b/src/algorithm/acceptor.cpp @@ -123,7 +123,7 @@ int AcceptorState :: Persist(const uint64_t llInstanceID, const uint32_t iLastCh } PLGImp("GroupIdx %d InstanceID %lu PromiseID %lu PromiseNodeID %lu " - "AccectpedID %lu AcceptedNodeID %lu ValueLen %zu Checksum %u", + "AcceptedID %lu AcceptedNodeID %lu ValueLen %zu Checksum %u", m_poConfig->GetMyGroupIdx(), llInstanceID, m_oPromiseBallot.m_llProposalID, m_oPromiseBallot.m_llNodeID, m_oAcceptedBallot.m_llProposalID, m_oAcceptedBallot.m_llNodeID, m_sAcceptedValue.size(), m_iChecksum); @@ -162,7 +162,7 @@ int AcceptorState :: Load(uint64_t & llInstanceID) m_iChecksum = oState.checksum(); PLGImp("GroupIdx %d InstanceID %lu PromiseID %lu PromiseNodeID %lu" - " AccectpedID %lu AcceptedNodeID %lu ValueLen %zu Checksum %u", + " AcceptedID %lu AcceptedNodeID %lu ValueLen %zu Checksum %u", m_poConfig->GetMyGroupIdx(), llInstanceID, m_oPromiseBallot.m_llProposalID, m_oPromiseBallot.m_llNodeID, m_oAcceptedBallot.m_llProposalID, m_oAcceptedBallot.m_llNodeID, m_sAcceptedValue.size(), m_iChecksum); diff --git a/src/algorithm/instance.h b/src/algorithm/instance.h index be7c858ed..09c3ed7d1 100644 --- a/src/algorithm/instance.h +++ b/src/algorithm/instance.h @@ -77,7 +77,7 @@ class Instance void OnNewValueCommitTimeout(); public: - //this funciton only enqueue, do nothing. + //this function only enqueue, do nothing. int OnReceiveMessage(const char * pcMessage, const int iMessageLen); public: diff --git a/src/algorithm/ioloop.cpp b/src/algorithm/ioloop.cpp index 29a9d23d9..d61a95ff4 100644 --- a/src/algorithm/ioloop.cpp +++ b/src/algorithm/ioloop.cpp @@ -205,7 +205,7 @@ void IOLoop :: OneLoop(const int iTimeoutMs) DealWithRetry(); //must put on here - //because addtimer on this funciton + //because addtimer on this function m_poInstance->CheckNewValue(); } @@ -240,7 +240,7 @@ void IOLoop :: DealwithTimeoutOne(const uint32_t iTimerID, const int iType) auto it = m_mapTimerIDExist.find(iTimerID); if (it == end(m_mapTimerIDExist)) { - //PLGErr("Timeout aready remove!, timerid %u iType %d", iTimerID, iType); + //PLGErr("Timeout already removed!, timerid %u iType %d", iTimerID, iType); return; } diff --git a/src/algorithm/learner.cpp b/src/algorithm/learner.cpp index f037bfc4a..21f0e5f18 100644 --- a/src/algorithm/learner.cpp +++ b/src/algorithm/learner.cpp @@ -358,7 +358,7 @@ void Learner :: OnSendNowInstanceID(const PaxosMsg & oPaxosMsg) 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"); + PLGHead("SystemVariables changed!, all thing need to refresh, so skip this msg"); return; } diff --git a/src/logstorage/log_store.cpp b/src/logstorage/log_store.cpp index 77725e9ea..3f9cb44e6 100644 --- a/src/logstorage/log_store.cpp +++ b/src/logstorage/log_store.cpp @@ -286,7 +286,7 @@ int LogStore :: GetFileFD(const int iNeedWriteSize, int & iFd, int & iFileID, in { if (m_iFd == -1) { - PLG1Err("File aready broken, fileid %d", m_iFileID); + PLG1Err("File already broken, fileid %d", m_iFileID); return -1; } @@ -317,7 +317,7 @@ int LogStore :: GetFileFD(const int iNeedWriteSize, int & iFd, int & iFileID, in { assert(iOffset != -1); - m_oFileLogger.Log("new file but file aready exist, now fileid %d exist filesize %d", + m_oFileLogger.Log("new file but file already exist, now fileid %d exist filesize %d", m_iFileID, iOffset); PLG1Err("IncreaseFileID success, but file exist, data wrong, file size %d", iOffset); @@ -430,7 +430,7 @@ int LogStore :: Read(const std::string & sFileID, uint64_t & llInstanceID, std:: if (iReadLen != (ssize_t)sizeof(int)) { close(iFd); - PLG1Err("readlen %zd not qual to %zu", iReadLen, sizeof(int)); + PLG1Err("readlen %zd not equal to %zu", iReadLen, sizeof(int)); return -1; } @@ -441,7 +441,7 @@ int LogStore :: Read(const std::string & sFileID, uint64_t & llInstanceID, std:: if (iReadLen != iLen) { close(iFd); - PLG1Err("readlen %zd not qual to %zu", iReadLen, iLen); + PLG1Err("readlen %zd not equal to %zu", iReadLen, iLen); return -1; } @@ -474,7 +474,7 @@ int LogStore :: Del(const std::string & sFileID, const uint64_t llInstanceID) if (iFileID > m_iFileID) { - PLG1Err("del fileid %d large than useing fileid %d", iFileID, m_iFileID); + PLG1Err("del fileid %d large than using fileid %d", iFileID, m_iFileID); return -2; } @@ -650,7 +650,7 @@ int LogStore :: RebuildIndexForOneFile(const int iFileID, const int iOffset, if (iReadLen != (ssize_t)sizeof(int)) { bNeedTruncate = true; - PLG1Err("readlen %zd not qual to %zu, need truncate", iReadLen, sizeof(int)); + PLG1Err("readlen %zd not equal to %zu, need truncate", iReadLen, sizeof(int)); break; } @@ -674,7 +674,7 @@ int LogStore :: RebuildIndexForOneFile(const int iFileID, const int iOffset, if (iReadLen != iLen) { bNeedTruncate = true; - PLG1Err("readlen %zd not qual to %zu, need truncate", iReadLen, iLen); + PLG1Err("readlen %zd not equal to %zu, need truncate", iReadLen, iLen); break; } diff --git a/src/master/master_mgr.cpp b/src/master/master_mgr.cpp index d1d985dce..eb4bf1b54 100644 --- a/src/master/master_mgr.cpp +++ b/src/master/master_mgr.cpp @@ -129,7 +129,7 @@ void MasterMgr :: TryBeMaster(const int iLeaseTime) if (iMasterNodeID != nullnode && (iMasterNodeID != m_poPaxosNode->GetMyNodeID())) { - PLG1Imp("Ohter as master, can't try be master, masterid %lu myid %lu", + PLG1Imp("Other as master, can't try be master, masterid %lu myid %lu", iMasterNodeID, m_poPaxosNode->GetMyNodeID()); return; } diff --git a/src/master/master_sm.cpp b/src/master/master_sm.cpp index 7e77f2064..fc6e3e56b 100644 --- a/src/master/master_sm.cpp +++ b/src/master/master_sm.cpp @@ -125,7 +125,7 @@ int MasterStateMachine :: LearnMaster( if (oMasterOper.version() != m_llMasterVersion) { - PLG1Debug("version conflit, op version %lu now master version %lu", + PLG1Debug("version conflict, op version %lu now master version %lu", oMasterOper.version(), m_llMasterVersion); return 0; } diff --git a/src/node/node.cpp b/src/node/node.cpp index 039f11542..692f9636d 100644 --- a/src/node/node.cpp +++ b/src/node/node.cpp @@ -49,11 +49,11 @@ int Node :: RunNode(const Options & oOptions, Node *& poNode) } //step1 set node to network - //very important, let network on recieve callback can work. + //very important, let network on receive callback can work. poNetWork->m_poNode = poRealNode; //step2 run network. - //start recieve message from network, so all must init before this step. + //start receive message from network, so all must init before this step. //must be the last step. poNetWork->RunNetWork();