提交 43c383dc 编写于 作者: M Minghao Li

enh(sync): add snapshotEnable2

上级 d6c57bd3
...@@ -399,7 +399,7 @@ int32_t syncNodeOnRequestVoteReplySnapshotCb(SSyncNode* ths, SyncRequestVoteRepl ...@@ -399,7 +399,7 @@ int32_t syncNodeOnRequestVoteReplySnapshotCb(SSyncNode* ths, SyncRequestVoteRepl
int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMsg); int32_t syncNodeOnAppendEntriesSnapshotCb(SSyncNode* ths, SyncAppendEntries* pMsg);
int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntriesReply* pMsg); int32_t syncNodeOnAppendEntriesReplySnapshotCb(SSyncNode* ths, SyncAppendEntriesReply* pMsg);
// option ---------------------------------- // -----------------------------------------
typedef int32_t (*FpOnPingCb)(SSyncNode* ths, SyncPing* pMsg); typedef int32_t (*FpOnPingCb)(SSyncNode* ths, SyncPing* pMsg);
typedef int32_t (*FpOnPingReplyCb)(SSyncNode* ths, SyncPingReply* pMsg); typedef int32_t (*FpOnPingReplyCb)(SSyncNode* ths, SyncPingReply* pMsg);
typedef int32_t (*FpOnClientRequestCb)(SSyncNode* ths, SyncClientRequest* pMsg); typedef int32_t (*FpOnClientRequestCb)(SSyncNode* ths, SyncClientRequest* pMsg);
...@@ -409,9 +409,9 @@ typedef int32_t (*FpOnAppendEntriesCb)(SSyncNode* ths, SyncAppendEntries* pMsg); ...@@ -409,9 +409,9 @@ typedef int32_t (*FpOnAppendEntriesCb)(SSyncNode* ths, SyncAppendEntries* pMsg);
typedef int32_t (*FpOnAppendEntriesReplyCb)(SSyncNode* ths, SyncAppendEntriesReply* pMsg); typedef int32_t (*FpOnAppendEntriesReplyCb)(SSyncNode* ths, SyncAppendEntriesReply* pMsg);
typedef int32_t (*FpOnTimeoutCb)(SSyncNode* pSyncNode, SyncTimeout* pMsg); typedef int32_t (*FpOnTimeoutCb)(SSyncNode* pSyncNode, SyncTimeout* pMsg);
// --------------------------------------------- // option ----------------------------------
bool syncNodeSnapshotEnable(SSyncNode* pSyncNode); bool syncNodeSnapshotEnable(SSyncNode* pSyncNode);
// --------------------------------------------- // ---------------------------------------------
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -164,8 +164,8 @@ typedef struct SSyncNode { ...@@ -164,8 +164,8 @@ typedef struct SSyncNode {
// sem_t restoreSem; // sem_t restoreSem;
bool restoreFinish; bool restoreFinish;
SSnapshot* pSnapshot; SSnapshot* pSnapshot;
SSyncSnapshotSender* pSender; SSyncSnapshotSender* senders[TSDB_MAX_REPLICA];
SSyncSnapshotReceiver* pReceiver; SSyncSnapshotReceiver* receivers[TSDB_MAX_REPLICA];
} SSyncNode; } SSyncNode;
......
...@@ -40,6 +40,8 @@ typedef struct SSyncSnapshotSender { ...@@ -40,6 +40,8 @@ typedef struct SSyncSnapshotSender {
SSyncSnapshotSender *snapshotSenderCreate(SSyncNode *pSyncNode); SSyncSnapshotSender *snapshotSenderCreate(SSyncNode *pSyncNode);
void snapshotSenderDestroy(SSyncSnapshotSender *pSender); void snapshotSenderDestroy(SSyncSnapshotSender *pSender);
void snapshotSenderStart(SSyncSnapshotSender *pSender);
void snapshotSenderStop(SSyncSnapshotSender *pSender);
int32_t snapshotSend(SSyncSnapshotSender *pSender); int32_t snapshotSend(SSyncSnapshotSender *pSender);
cJSON * snapshotSender2Json(SSyncSnapshotSender *pSender); cJSON * snapshotSender2Json(SSyncSnapshotSender *pSender);
char * snapshotSender2Str(SSyncSnapshotSender *pSender); char * snapshotSender2Str(SSyncSnapshotSender *pSender);
......
...@@ -19,6 +19,10 @@ SSyncSnapshotSender *snapshotSenderCreate(SSyncNode *pSyncNode) { return NULL; } ...@@ -19,6 +19,10 @@ SSyncSnapshotSender *snapshotSenderCreate(SSyncNode *pSyncNode) { return NULL; }
void snapshotSenderDestroy(SSyncSnapshotSender *pSender) {} void snapshotSenderDestroy(SSyncSnapshotSender *pSender) {}
void snapshotSenderStart(SSyncSnapshotSender *pSender) {}
void snapshotSenderStop(SSyncSnapshotSender *pSender) {}
int32_t snapshotSend(SSyncSnapshotSender *pSender) { return 0; } int32_t snapshotSend(SSyncSnapshotSender *pSender) { return 0; }
cJSON *snapshotSender2Json(SSyncSnapshotSender *pSender) { return NULL; } cJSON *snapshotSender2Json(SSyncSnapshotSender *pSender) { return NULL; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册