TD-10431 rename some funcs

This commit is contained in:
Shengliang Guan 2021-11-29 13:29:13 +08:00
parent e63637fcce
commit 35b0c69333
34 changed files with 71 additions and 71 deletions

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitAcct(); int32_t mndInitAcct(SMnode *pMnode);
void mndCleanupAcct(); void mndCleanupAcct(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitAuth(); int32_t mndInitAuth(SMnode *pMnode);
void mndCleanupAuth(); void mndCleanupAuth(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitBalance(); int32_t mndInitBalance(SMnode *pMnode);
void mndCleanupBalance(); void mndCleanupBalance(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitCluster(); int32_t mndInitCluster(SMnode *pMnode);
void mndCleanupCluster(); void mndCleanupCluster(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitDb(); int32_t mndInitDb(SMnode *pMnode);
void mndCleanupDb(); void mndCleanupDb(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitDnode(); int32_t mndInitDnode(SMnode *pMnode);
void mndCleanupDnode(); void mndCleanupDnode(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitFunc(); int32_t mndInitFunc(SMnode *pMnode);
void mndCleanupFunc(); void mndCleanupFunc(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitMnode(); int32_t mndInitMnode(SMnode *pMnode);
void mndCleanupMnode(); void mndCleanupMnode(SMnode *pMnode);
void mndGetMnodeEpSetForPeer(SEpSet *epSet, bool redirect); void mndGetMnodeEpSetForPeer(SEpSet *epSet, bool redirect);
void mndGetMnodeEpSetForShell(SEpSet *epSet, bool redirect); void mndGetMnodeEpSetForShell(SEpSet *epSet, bool redirect);

View File

@ -20,8 +20,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitOper(); int32_t mndInitOper(SMnode *pMnode);
void mndCleanupOper(); void mndCleanupOper(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitProfile(); int32_t mndInitProfile(SMnode *pMnode);
void mndCleanupProfile(); void mndCleanupProfile(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitShow(); int32_t mndInitShow(SMnode *pMnode);
void mndCleanupShow(); void mndCleanupShow(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitStable(); int32_t mndInitStable(SMnode *pMnode);
void mndCleanupStable(); void mndCleanupStable(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,9 +22,9 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitSync(); int32_t mndInitSync(SMnode *pMnode);
void mndCleanupSync(); void mndCleanupSync(SMnode *pMnode);
bool mndIsMaster(); bool mndIsMaster(SMnode *pMnode);
int32_t mndSyncPropose(SSdbRaw *pRaw, void *pData); int32_t mndSyncPropose(SSdbRaw *pRaw, void *pData);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -21,8 +21,8 @@ extern "C" {
#endif #endif
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitTelem(); int32_t mndInitTelem(SMnode *pMnode);
void mndCleanupTelem(); void mndCleanupTelem(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitTrans(); int32_t mndInitTrans(SMnode *pMnode);
void mndCleanupTrans(); void mndCleanupTrans(SMnode *pMnode);
STrans *trnCreate(ETrnPolicy policy, void *rpcHandle); STrans *trnCreate(ETrnPolicy policy, void *rpcHandle);
void trnDrop(STrans *pTrans); void trnDrop(STrans *pTrans);

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitUser(); int32_t mndInitUser(SMnode *pMnode);
void mndCleanupUser(); void mndCleanupUser(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -22,8 +22,8 @@
extern "C" { extern "C" {
#endif #endif
int32_t mndInitVgroup(); int32_t mndInitVgroup(SMnode *pMnode);
void mndCleanupVgroup(); void mndCleanupVgroup(SMnode *pMnode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -101,7 +101,7 @@ static int32_t mnodeCreateDefaultAcct() {
return sdbWrite(pRaw); return sdbWrite(pRaw);
} }
int32_t mndInitAcct() { int32_t mndInitAcct(SMnode *pMnode) {
SSdbTable table = {.sdbType = SDB_ACCT, SSdbTable table = {.sdbType = SDB_ACCT,
.keyType = SDB_KEY_BINARY, .keyType = SDB_KEY_BINARY,
.deployFp = (SdbDeployFp)mnodeCreateDefaultAcct, .deployFp = (SdbDeployFp)mnodeCreateDefaultAcct,
@ -115,4 +115,4 @@ int32_t mndInitAcct() {
return 0; return 0;
} }
void mndCleanupAcct() {} void mndCleanupAcct(SMnode *pMnode) {}

View File

@ -17,8 +17,8 @@
#include "os.h" #include "os.h"
#include "mndAuth.h" #include "mndAuth.h"
int32_t mndInitAuth() { return 0; } int32_t mndInitAuth(SMnode *pMnode) { return 0; }
void mndCleanupAuth() {} void mndCleanupAuth(SMnode *pMnode) {}
int32_t mndRetriveAuth(SMnode *pMnode, char *user, char *spi, char *encrypt, char *secret, char *ckey) { int32_t mndRetriveAuth(SMnode *pMnode, char *user, char *spi, char *encrypt, char *secret, char *ckey) {
return 0; return 0;

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitBalance() { return 0; } int32_t mndInitBalance(SMnode *pMnode) { return 0; }
void mndCleanupBalance() {} void mndCleanupBalance(SMnode *pMnode) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitCluster() { return 0; } int32_t mndInitCluster(SMnode *pMnode) { return 0; }
void mndCleanupCluster() {} void mndCleanupCluster(SMnode *pMnode) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitDb() { return 0; } int32_t mndInitDb(SMnode *pMnode) { return 0; }
void mndCleanupDb() {} void mndCleanupDb(SMnode *pMnode) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitDnode() { return 0; } int32_t mndInitDnode(SMnode *pMnode) { return 0; }
void mndCleanupDnode() {} void mndCleanupDnode(SMnode *pMnode) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitFunc() { return 0; } int32_t mndInitFunc(SMnode *pMnode) { return 0; }
void mndCleanupFunc() {} void mndCleanupFunc(SMnode *pMnode) {}

View File

@ -17,8 +17,8 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitMnode() { return 0; } int32_t mndInitMnode(SMnode *pMnode) { return 0; }
void mndCleanupMnode() {} void mndCleanupMnode(SMnode *pMnode) {}
void mndGetMnodeEpSetForPeer(SEpSet *epSet, bool redirect) {} void mndGetMnodeEpSetForPeer(SEpSet *epSet, bool redirect) {}
void mndGetMnodeEpSetForShell(SEpSet *epSet, bool redirect) {} void mndGetMnodeEpSetForShell(SEpSet *epSet, bool redirect) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitOper() { return 0; } int32_t mndInitOper(SMnode *pMnode) { return 0; }
void mndCleanupOper() {} void mndCleanupOper(SMnode *pMnode) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitProfile() { return 0; } int32_t mndInitProfile(SMnode *pMnode) { return 0; }
void mndCleanupProfile() {} void mndCleanupProfile(SMnode *pMnode) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitShow() { return 0; } int32_t mndInitShow(SMnode *pMnode) { return 0; }
void mndCleanupShow() {} void mndCleanupShow(SMnode *pMnode) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitStable() { return 0; } int32_t mndInitStable(SMnode *pMnode) { return 0; }
void mndCleanupStable() {} void mndCleanupStable(SMnode *pMnode) {}

View File

@ -18,8 +18,8 @@
#include "mndInt.h" #include "mndInt.h"
#include "mndTrans.h" #include "mndTrans.h"
int32_t mndInitSync() { return 0; } int32_t mndInitSync(SMnode *pMnode) { return 0; }
void mndCleanupSync() {} void mndCleanupSync(SMnode *pMnode) {}
int32_t mndSyncPropose(SSdbRaw *pRaw, void *pData) { int32_t mndSyncPropose(SSdbRaw *pRaw, void *pData) {
trnApply(pData, pData, 0); trnApply(pData, pData, 0);

View File

@ -256,7 +256,7 @@ static void* mndTelemThreadFp(void* param) {
if (r == 0) break; if (r == 0) break;
if (r != ETIMEDOUT) continue; if (r != ETIMEDOUT) continue;
if (mndIsMaster()) { if (mndIsMaster(NULL)) {
mndSendTelemetryReport(); mndSendTelemetryReport();
} }
end.tv_sec += REPORT_INTERVAL; end.tv_sec += REPORT_INTERVAL;
@ -278,7 +278,7 @@ static void mndGetEmail(char* filepath) {
taosCloseFile(fd); taosCloseFile(fd);
} }
int32_t mndInitTelem() { int32_t mndInitTelem(SMnode *pMnode) {
tsTelem.enable = tsEnableTelemetryReporting; tsTelem.enable = tsEnableTelemetryReporting;
if (!tsTelem.enable) return 0; if (!tsTelem.enable) return 0;
@ -303,7 +303,7 @@ int32_t mndInitTelem() {
return 0; return 0;
} }
void mndCleanupTelem() { void mndCleanupTelem(SMnode *pMnode) {
if (!tsTelem.enable) return; if (!tsTelem.enable) return;
if (taosCheckPthreadValid(tsTelem.thread)) { if (taosCheckPthreadValid(tsTelem.thread)) {

View File

@ -312,7 +312,7 @@ int32_t trnAppendUndoAction(STrans *pTrans, SEpSet *pEpSet, void *pMsg) {
return code; return code;
} }
int32_t mndInitTrans() { int32_t mndInitTrans(SMnode *pMnode) {
SSdbTable table = {.sdbType = SDB_TRANS, SSdbTable table = {.sdbType = SDB_TRANS,
.keyType = SDB_KEY_INT32, .keyType = SDB_KEY_INT32,
.encodeFp = (SdbEncodeFp)trnActionEncode, .encodeFp = (SdbEncodeFp)trnActionEncode,
@ -326,7 +326,7 @@ int32_t mndInitTrans() {
return 0; return 0;
} }
void mndCleanupTrans() { mInfo("trn module is cleaned up"); } void mndCleanupTrans(SMnode *pMnode) { mInfo("trn module is cleaned up"); }
int32_t trnPrepare(STrans *pTrans, int32_t (*syncfp)(SSdbRaw *pRaw, void *pData)) { int32_t trnPrepare(STrans *pTrans, int32_t (*syncfp)(SSdbRaw *pRaw, void *pData)) {

View File

@ -214,7 +214,7 @@ static int32_t mndProcessCreateUserMsg(SMnode *pMnode, SMnodeMsg *pMsg) {
return TSDB_CODE_MND_ACTION_IN_PROGRESS; return TSDB_CODE_MND_ACTION_IN_PROGRESS;
} }
int32_t mndInitUser() { int32_t mndInitUser(SMnode *pMnode) {
SSdbTable table = {.sdbType = SDB_USER, SSdbTable table = {.sdbType = SDB_USER,
.keyType = SDB_KEY_BINARY, .keyType = SDB_KEY_BINARY,
.deployFp = (SdbDeployFp)mndCreateDefaultUsers, .deployFp = (SdbDeployFp)mndCreateDefaultUsers,
@ -225,9 +225,9 @@ int32_t mndInitUser() {
.deleteFp = (SdbDeleteFp)mndUserActionDelete}; .deleteFp = (SdbDeleteFp)mndUserActionDelete};
sdbSetTable(table); sdbSetTable(table);
mndSetMsgHandle(NULL, TSDB_MSG_TYPE_CREATE_USER, mndProcessCreateUserMsg); mndSetMsgHandle(pMnode, TSDB_MSG_TYPE_CREATE_USER, mndProcessCreateUserMsg);
return 0; return 0;
} }
void mndCleanupUser() {} void mndCleanupUser(SMnode *pMnode) {}

View File

@ -17,5 +17,5 @@
#include "os.h" #include "os.h"
#include "mndInt.h" #include "mndInt.h"
int32_t mndInitVgroup() { return 0; } int32_t mndInitVgroup(SMnode *pMnode) { return 0; }
void mndCleanupVgroup() {} void mndCleanupVgroup(SMnode *pMnode) {}