diff --git a/source/dnode/mgmt/impl/CMakeLists.txt b/source/dnode/mgmt/impl/CMakeLists.txt index c99a405527..9b81c5ecdc 100644 --- a/source/dnode/mgmt/impl/CMakeLists.txt +++ b/source/dnode/mgmt/impl/CMakeLists.txt @@ -1,4 +1,6 @@ aux_source_directory(src DNODE_SRC) +aux_source_directory(mnodeMgmt/src DNODE_SRC) + add_library(dnode STATIC ${DNODE_SRC}) target_link_libraries( dnode cjson mnode vnode qnode snode bnode wal sync taos tfs monitor @@ -7,6 +9,7 @@ target_include_directories( dnode PUBLIC "${CMAKE_SOURCE_DIR}/include/dnode/mgmt" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/mnodeMgmt/inc" ) if(${BUILD_TEST}) diff --git a/source/dnode/mgmt/impl/inc/dndMnode.h b/source/dnode/mgmt/impl/mnodeMgmt/inc/mm.h similarity index 94% rename from source/dnode/mgmt/impl/inc/dndMnode.h rename to source/dnode/mgmt/impl/mnodeMgmt/inc/mm.h index 0f03bb3832..3d6b97f288 100644 --- a/source/dnode/mgmt/impl/inc/dndMnode.h +++ b/source/dnode/mgmt/impl/mnodeMgmt/inc/mm.h @@ -21,8 +21,10 @@ extern "C" { #endif #include "dndEnv.h" -int32_t dndInitMnode(SDnode *pDnode); -void dndCleanupMnode(SDnode *pDnode); +int32_t mmInit(SDnode *pDnode); +void mmCleanup(SDnode *pDnode); + +//////////// int32_t dndGetUserAuthFromMnode(SDnode *pDnode, char *user, char *spi, char *encrypt, char *secret, char *ckey); void dndProcessMnodeReadMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet); diff --git a/source/dnode/mgmt/impl/mnodeMgmt/src/mmFile.c b/source/dnode/mgmt/impl/mnodeMgmt/src/mmFile.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/source/dnode/mgmt/impl/src/dndMnode.c b/source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c similarity index 99% rename from source/dnode/mgmt/impl/src/dndMnode.c rename to source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c index 531f0b84cd..7044afebea 100644 --- a/source/dnode/mgmt/impl/src/dndMnode.c +++ b/source/dnode/mgmt/impl/mnodeMgmt/src/mmMgmt.c @@ -14,7 +14,7 @@ */ #define _DEFAULT_SOURCE -#include "dndMnode.h" +#include "mm.h" #include "dndMgmt.h" #include "dndTransport.h" #include "dndWorker.h" @@ -611,7 +611,7 @@ void dndProcessMnodeReadMsg(SDnode *pDnode, SRpcMsg *pMsg, SEpSet *pEpSet) { // dndWriteMnodeMsgToWorker(pDnode, &pDnode->mmgmt.readWorker, pMsg); } -int32_t dndInitMnode(SDnode *pDnode) { +int32_t mmInit(SDnode *pDnode) { dInfo("dnode-mnode start to init"); SMnodeMgmt *pMgmt = &pDnode->mmgmt; 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"); SMnodeMgmt *pMgmt = &pDnode->mmgmt; if (pMgmt->pMnode) { diff --git a/source/dnode/mgmt/impl/mnodeMgmt/src/mmMsg.c b/source/dnode/mgmt/impl/mnodeMgmt/src/mmMsg.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/source/dnode/mgmt/impl/mnodeMgmt/src/mmProc.c b/source/dnode/mgmt/impl/mnodeMgmt/src/mmProc.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/source/dnode/mgmt/impl/mnodeMgmt/src/mmQueue.c b/source/dnode/mgmt/impl/mnodeMgmt/src/mmQueue.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/source/dnode/mgmt/impl/src/dndEnv.c b/source/dnode/mgmt/impl/src/dndEnv.c index 84b2dca326..bb33321e97 100644 --- a/source/dnode/mgmt/impl/src/dndEnv.c +++ b/source/dnode/mgmt/impl/src/dndEnv.c @@ -16,7 +16,7 @@ #define _DEFAULT_SOURCE #include "dndBnode.h" #include "dndMgmt.h" -#include "dndMnode.h" +#include "mm.h" #include "dndQnode.h" #include "dndSnode.h" #include "dndTransport.h" @@ -221,7 +221,7 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg) { return NULL; } - if (dndInitMnode(pDnode) != 0) { + if (mmInit(pDnode) != 0) { dError("failed to init mnode since %s", terrstr()); dndClose(pDnode); return NULL; @@ -253,7 +253,7 @@ void dndClose(SDnode *pDnode) { dndSetStat(pDnode, DND_STAT_STOPPED); dndCleanupTrans(pDnode); dndStopMgmt(pDnode); - dndCleanupMnode(pDnode); + mmCleanup(pDnode); dndCleanupBnode(pDnode); dndCleanupSnode(pDnode); dndCleanupQnode(pDnode); diff --git a/source/dnode/mgmt/impl/src/dndMgmt.c b/source/dnode/mgmt/impl/src/dndMgmt.c index 866076a3d0..e8dd92d273 100644 --- a/source/dnode/mgmt/impl/src/dndMgmt.c +++ b/source/dnode/mgmt/impl/src/dndMgmt.c @@ -16,7 +16,7 @@ #define _DEFAULT_SOURCE #include "dndMgmt.h" #include "dndBnode.h" -#include "dndMnode.h" +#include "mm.h" #include "dndQnode.h" #include "dndSnode.h" #include "dndTransport.h" diff --git a/source/dnode/mgmt/impl/src/dndTransport.c b/source/dnode/mgmt/impl/src/dndTransport.c index 157bad26a6..0c30010bd5 100644 --- a/source/dnode/mgmt/impl/src/dndTransport.c +++ b/source/dnode/mgmt/impl/src/dndTransport.c @@ -22,7 +22,7 @@ #define _DEFAULT_SOURCE #include "dndTransport.h" #include "dndMgmt.h" -#include "dndMnode.h" +#include "mm.h" #include "dndVnodes.h" #define INTERNAL_USER "_dnd"