From 57f1b593e4c0184c77778c7df9e9e7cec4ee2abe Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Fri, 11 Nov 2022 14:40:21 +0800 Subject: [PATCH] refact: adjust head file and sync log --- include/libs/sync/sync.h | 1 - source/libs/sync/inc/syncMessage.h | 34 ------------------------------ 2 files changed, 35 deletions(-) diff --git a/include/libs/sync/sync.h b/include/libs/sync/sync.h index a27be95049..0b997690a1 100644 --- a/include/libs/sync/sync.h +++ b/include/libs/sync/sync.h @@ -58,7 +58,6 @@ typedef int64_t SyncIndex; typedef uint64_t SyncTerm; typedef struct SSyncNode SSyncNode; -typedef struct SSyncBuffer SSyncBuffer; typedef struct SWal SWal; typedef struct SSyncRaftEntry SSyncRaftEntry; diff --git a/source/libs/sync/inc/syncMessage.h b/source/libs/sync/inc/syncMessage.h index 93a674e170..77dfdf282d 100644 --- a/source/libs/sync/inc/syncMessage.h +++ b/source/libs/sync/inc/syncMessage.h @@ -22,40 +22,6 @@ extern "C" { #include "syncInt.h" -// ------------------ for debug ------------------- -void syncRpcMsgPrint(SRpcMsg* pMsg); -void syncRpcMsgPrint2(char* s, SRpcMsg* pMsg); -void syncRpcMsgLog(SRpcMsg* pMsg); -void syncRpcMsgLog2(char* s, SRpcMsg* pMsg); - -// ------------------ for compile ------------------- -typedef struct SSyncBuffer { - void* data; - size_t len; -} SSyncBuffer; - -typedef struct SNodesRole { - int32_t replicaNum; - SNodeInfo nodeInfo[TSDB_MAX_REPLICA]; - ESyncState role[TSDB_MAX_REPLICA]; -} SNodesRole; - -typedef struct SStateMgr { - void* data; - - int32_t (*getCurrentTerm)(struct SStateMgr* pMgr, SyncTerm* pCurrentTerm); - int32_t (*persistCurrentTerm)(struct SStateMgr* pMgr, SyncTerm pCurrentTerm); - - int32_t (*getVoteFor)(struct SStateMgr* pMgr, SyncNodeId* pVoteFor); - int32_t (*persistVoteFor)(struct SStateMgr* pMgr, SyncNodeId voteFor); - - int32_t (*getSyncCfg)(struct SStateMgr* pMgr, SSyncCfg* pSyncCfg); - int32_t (*persistSyncCfg)(struct SStateMgr* pMgr, SSyncCfg* pSyncCfg); - -} SStateMgr; - -// ------------------ for message process ------------------- - // --------------------------------------------- typedef struct SyncPing { uint32_t bytes;