This commit is contained in:
Shengliang Guan 2022-03-10 14:46:53 +08:00
parent 3e30f72068
commit cebcfc9115
10 changed files with 15 additions and 10 deletions

View File

@ -1,4 +1,6 @@
aux_source_directory(src DNODE_SRC) aux_source_directory(src DNODE_SRC)
aux_source_directory(mnodeMgmt/src DNODE_SRC)
add_library(dnode STATIC ${DNODE_SRC}) add_library(dnode STATIC ${DNODE_SRC})
target_link_libraries( target_link_libraries(
dnode cjson mnode vnode qnode snode bnode wal sync taos tfs monitor dnode cjson mnode vnode qnode snode bnode wal sync taos tfs monitor
@ -7,6 +9,7 @@ target_include_directories(
dnode dnode
PUBLIC "${CMAKE_SOURCE_DIR}/include/dnode/mgmt" PUBLIC "${CMAKE_SOURCE_DIR}/include/dnode/mgmt"
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/mnodeMgmt/inc"
) )
if(${BUILD_TEST}) if(${BUILD_TEST})

View File

@ -21,8 +21,10 @@ extern "C" {
#endif #endif
#include "dndEnv.h" #include "dndEnv.h"
int32_t dndInitMnode(SDnode *pDnode); int32_t mmInit(SDnode *pDnode);
void dndCleanupMnode(SDnode *pDnode); void mmCleanup(SDnode *pDnode);
////////////
int32_t dndGetUserAuthFromMnode(SDnode *pDnode, char *user, char *spi, char *encrypt, char *secret, char *ckey); int32_t dndGetUserAuthFromMnode(SDnode *pDnode, char *user, char *spi, char *encrypt, char *secret, char *ckey);
void dndProcessMnodeReadMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet); void dndProcessMnodeReadMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet);

View File

@ -14,7 +14,7 @@
*/ */
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "dndMnode.h" #include "mm.h"
#include "dndMgmt.h" #include "dndMgmt.h"
#include "dndTransport.h" #include "dndTransport.h"
#include "dndWorker.h" #include "dndWorker.h"
@ -611,7 +611,7 @@ void dndProcessMnodeReadMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) {
// dndWriteMnodeMsgToWorker(pDnode, &pDnode->mmgmt.readWorker, pMsg); // dndWriteMnodeMsgToWorker(pDnode, &pDnode->mmgmt.readWorker, pMsg);
} }
int32_t dndInitMnode(SDnode *pDnode) { int32_t mmInit(SDnode *pDnode) {
dInfo("dnode-mnode start to init"); dInfo("dnode-mnode start to init");
SMnodeMgmt *pMgmt = &pDnode->mmgmt; SMnodeMgmt *pMgmt = &pDnode->mmgmt;
taosInitRWLatch(&pMgmt->latch); taosInitRWLatch(&pMgmt->latch);
@ -645,7 +645,7 @@ int32_t dndInitMnode(SDnode *pDnode) {
} }
} }
void dndCleanupMnode(SDnode *pDnode) { void mmCleanup(SDnode *pDnode) {
dInfo("dnode-mnode start to clean up"); dInfo("dnode-mnode start to clean up");
SMnodeMgmt *pMgmt = &pDnode->mmgmt; SMnodeMgmt *pMgmt = &pDnode->mmgmt;
if (pMgmt->pMnode) { if (pMgmt->pMnode) {

View File

@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "dndBnode.h" #include "dndBnode.h"
#include "dndMgmt.h" #include "dndMgmt.h"
#include "dndMnode.h" #include "mm.h"
#include "dndQnode.h" #include "dndQnode.h"
#include "dndSnode.h" #include "dndSnode.h"
#include "dndTransport.h" #include "dndTransport.h"
@ -221,7 +221,7 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg) {
return NULL; return NULL;
} }
if (dndInitMnode(pDnode) != 0) { if (mmInit(pDnode) != 0) {
dError("failed to init mnode since %s", terrstr()); dError("failed to init mnode since %s", terrstr());
dndClose(pDnode); dndClose(pDnode);
return NULL; return NULL;
@ -253,7 +253,7 @@ void dndClose(SDnode *pDnode) {
dndSetStat(pDnode, DND_STAT_STOPPED); dndSetStat(pDnode, DND_STAT_STOPPED);
dndCleanupTrans(pDnode); dndCleanupTrans(pDnode);
dndStopMgmt(pDnode); dndStopMgmt(pDnode);
dndCleanupMnode(pDnode); mmCleanup(pDnode);
dndCleanupBnode(pDnode); dndCleanupBnode(pDnode);
dndCleanupSnode(pDnode); dndCleanupSnode(pDnode);
dndCleanupQnode(pDnode); dndCleanupQnode(pDnode);

View File

@ -16,7 +16,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "dndMgmt.h" #include "dndMgmt.h"
#include "dndBnode.h" #include "dndBnode.h"
#include "dndMnode.h" #include "mm.h"
#include "dndQnode.h" #include "dndQnode.h"
#include "dndSnode.h" #include "dndSnode.h"
#include "dndTransport.h" #include "dndTransport.h"

View File

@ -22,7 +22,7 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "dndTransport.h" #include "dndTransport.h"
#include "dndMgmt.h" #include "dndMgmt.h"
#include "dndMnode.h" #include "mm.h"
#include "dndVnodes.h" #include "dndVnodes.h"
#define INTERNAL_USER "_dnd" #define INTERNAL_USER "_dnd"