diff --git a/source/dnode/mgmt/CMakeLists.txt b/source/dnode/mgmt/CMakeLists.txt index 281fea48de..52761ab646 100644 --- a/source/dnode/mgmt/CMakeLists.txt +++ b/source/dnode/mgmt/CMakeLists.txt @@ -1,36 +1,9 @@ +add_subdirectory(exe) add_subdirectory(interface) - -aux_source_directory(implement/src DNODE_SRC) -aux_source_directory(mgmt_bnode/src DNODE_SRC) -aux_source_directory(mgmt_mnode/src DNODE_SRC) -aux_source_directory(mgmt_qnode/src DNODE_SRC) -aux_source_directory(mgmt_snode/src DNODE_SRC) -aux_source_directory(mgmt_vnode/src DNODE_SRC) -add_library(dnode STATIC ${DNODE_SRC}) -target_link_libraries( - dnode dnode_interface -) -target_include_directories( - dnode - PUBLIC "${TD_SOURCE_DIR}/include/dnode/mgmt" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/implement/inc" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/mgmt_bnode/inc" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/mgmt_mnode/inc" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/mgmt_qnode/inc" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/mgmt_snode/inc" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/mgmt_vnode/inc" -) - -aux_source_directory(exe EXEC_SRC) -add_executable(taosd ${EXEC_SRC}) -target_include_directories( - taosd - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/implement/inc" -) -target_link_libraries(taosd dnode) - -if(${BUILD_TEST}) - add_subdirectory(test) -endif(${BUILD_TEST}) +add_subdirectory(implement) +add_subdirectory(mgmt_bnode) +add_subdirectory(mgmt_mnode) +add_subdirectory(mgmt_qnode) +add_subdirectory(mgmt_snode) +add_subdirectory(mgmt_vnode) +add_subdirectory(test) diff --git a/source/dnode/mgmt/exe/CMakeLists.txt b/source/dnode/mgmt/exe/CMakeLists.txt new file mode 100644 index 0000000000..931a07d261 --- /dev/null +++ b/source/dnode/mgmt/exe/CMakeLists.txt @@ -0,0 +1,7 @@ +aux_source_directory(. EXEC_SRC) +add_executable(taosd ${EXEC_SRC}) +target_include_directories( + taosd + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../implement/inc" +) +target_link_libraries(taosd dnode) diff --git a/source/dnode/mgmt/implement/CMakeLists.txt b/source/dnode/mgmt/implement/CMakeLists.txt new file mode 100644 index 0000000000..fbe7530395 --- /dev/null +++ b/source/dnode/mgmt/implement/CMakeLists.txt @@ -0,0 +1,9 @@ +aux_source_directory(src IMPLEMENT_SRC) +add_library(dnode STATIC ${IMPLEMENT_SRC}) +target_link_libraries( + dnode mgmt_bnode mgmt_mnode mgmt_qnode mgmt_snode mgmt_vnode +) +target_include_directories( + dnode + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) \ No newline at end of file diff --git a/source/dnode/mgmt/implement/inc/dndNode.h b/source/dnode/mgmt/implement/inc/dndNode.h index 237b65a962..283df57707 100644 --- a/source/dnode/mgmt/implement/inc/dndNode.h +++ b/source/dnode/mgmt/implement/inc/dndNode.h @@ -28,7 +28,6 @@ void dndCloseNode(SMgmtWrapper *pWrapper); // dndTransport.c int32_t dndInitTrans(SDnode *pDnode); void dndCleanupTrans(SDnode *pDnode); -SMsgCb dndCreateMsgcb(SMgmtWrapper *pWrapper); SProcCfg dndGenProcCfg(SMgmtWrapper *pWrapper); int32_t dndInitMsgHandle(SDnode *pDnode); void dndSendRecv(SDnode *pDnode, SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp); @@ -45,8 +44,7 @@ void dmGetMnodeEpSet(SDnodeData *pMgmt, SEpSet *pEpSet); void dmUpdateMnodeEpSet(SDnodeData *pMgmt, SEpSet *pEpSet); void dmSendRedirectRsp(SDnodeData *pMgmt, const SRpcMsg *pMsg); -void dmGetMonitorSysInfo(SMonSysInfo *pInfo); -void vmGetVnodeLoads(SMgmtWrapper *pWrapper, SMonVloadInfo *pInfo); +void vmGetVnodeLoads(SMgmtWrapper *pWrapper, SMonVloadInfo *pInfo); void mmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonMmInfo *mmInfo); void vmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonVmInfo *vmInfo); void qmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonQmInfo *qmInfo); diff --git a/source/dnode/mgmt/implement/src/dmMonitor.c b/source/dnode/mgmt/implement/src/dmMonitor.c index 136158e10f..dc086ffc96 100644 --- a/source/dnode/mgmt/implement/src/dmMonitor.c +++ b/source/dnode/mgmt/implement/src/dmMonitor.c @@ -37,7 +37,7 @@ static void dmGetMonitorDnodeInfo(SDnode *pDnode, SMonDnodeInfo *pInfo) { static void dmGetMonitorInfo(SDnode *pDnode, SMonDmInfo *pInfo) { dmGetMonitorBasicInfo(pDnode, &pInfo->basic); - dmGetMonitorSysInfo(&pInfo->sys); + dndGetMonitorSysInfo(&pInfo->sys); dmGetMonitorDnodeInfo(pDnode, &pInfo->dnode); } @@ -179,16 +179,3 @@ void dmGetVnodeLoads(SMgmtWrapper *pWrapper, SMonVloadInfo *pInfo) { rpcFreeCont(rsp.pCont); } } - -void dmGetMonitorSysInfo(SMonSysInfo *pInfo) { - taosGetCpuUsage(&pInfo->cpu_engine, &pInfo->cpu_system); - taosGetCpuCores(&pInfo->cpu_cores); - taosGetProcMemory(&pInfo->mem_engine); - taosGetSysMemory(&pInfo->mem_system); - pInfo->mem_total = tsTotalMemoryKB; - pInfo->disk_engine = 0; - pInfo->disk_used = tsDataSpace.size.used; - pInfo->disk_total = tsDataSpace.size.total; - taosGetCardInfoDelta(&pInfo->net_in, &pInfo->net_out); - taosGetProcIODelta(&pInfo->io_read, &pInfo->io_write, &pInfo->io_read_disk, &pInfo->io_write_disk); -} diff --git a/source/dnode/mgmt/implement/src/dndTransport.c b/source/dnode/mgmt/implement/src/dndTransport.c index 2d38d6311f..197cfffd7e 100644 --- a/source/dnode/mgmt/implement/src/dndTransport.c +++ b/source/dnode/mgmt/implement/src/dndTransport.c @@ -19,6 +19,10 @@ #define INTERNAL_USER "_dnd" #define INTERNAL_CKEY "_key" #define INTERNAL_SECRET "_pwd" +static int32_t dndSendReq(SMgmtWrapper *pWrapper, const SEpSet *pEpSet, SRpcMsg *pReq); +static void dndSendRsp(SMgmtWrapper *pWrapper, const SRpcMsg *pRsp); +static void dndRegisterBrokenLinkArg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg); +static void dndReleaseHandle(SMgmtWrapper *pWrapper, void *handle, int8_t type); static void dndUpdateMnodeEpSet(SDnode *pDnode, SEpSet *pEpSet) { SMgmtWrapper *pWrapper = &pDnode->wrappers[NODE_BEGIN]; @@ -299,6 +303,15 @@ static void dndCleanupServer(SDnode *pDnode) { int32_t dndInitTrans(SDnode *pDnode) { if (dndInitServer(pDnode) != 0) return -1; if (dndInitClient(pDnode) != 0) return -1; + + SMsgCb msgCb = { + .sendReqFp = dndSendReq, + .sendRspFp = dndSendRsp, + .registerBrokenLinkArgFp = dndRegisterBrokenLinkArg, + .releaseHandleFp = dndReleaseHandle, + }; + pDnode->data.msgCb = msgCb; + return 0; } @@ -412,17 +425,6 @@ static void dndReleaseHandle(SMgmtWrapper *pWrapper, void *handle, int8_t type) } } -SMsgCb dndCreateMsgcb(SMgmtWrapper *pWrapper) { - SMsgCb msgCb = { - .pWrapper = pWrapper, - .sendReqFp = dndSendReq, - .sendRspFp = dndSendRsp, - .registerBrokenLinkArgFp = dndRegisterBrokenLinkArg, - .releaseHandleFp = dndReleaseHandle, - }; - return msgCb; -} - static void dndConsumeChildQueue(SMgmtWrapper *pWrapper, SNodeMsg *pMsg, int16_t msgLen, void *pCont, int32_t contLen, ProcFuncType ftype) { SRpcMsg *pRpc = &pMsg->rpcMsg; diff --git a/source/dnode/mgmt/interface/CMakeLists.txt b/source/dnode/mgmt/interface/CMakeLists.txt index 78f6ef03e5..69cb6e040f 100644 --- a/source/dnode/mgmt/interface/CMakeLists.txt +++ b/source/dnode/mgmt/interface/CMakeLists.txt @@ -6,5 +6,5 @@ target_include_directories( PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/inc" ) target_link_libraries( - dnode_interface cjson mnode vnode qnode snode bnode wal sync taos tfs monitor util + dnode_interface cjson mnode vnode qnode snode bnode wal sync taos tfs monitor ) \ No newline at end of file diff --git a/source/dnode/mgmt/interface/inc/dndInt.h b/source/dnode/mgmt/interface/inc/dndInt.h index 542df7c784..f158336037 100644 --- a/source/dnode/mgmt/interface/inc/dndInt.h +++ b/source/dnode/mgmt/interface/inc/dndInt.h @@ -36,6 +36,8 @@ void dndSetEvent(SDnode *pDnode, EDndEvent event); void dndSetMsgHandle(SMgmtWrapper *pWrapper, tmsg_t msgType, NodeMsgFp nodeMsgFp, int8_t vgId); void dndReportStartup(SDnode *pDnode, const char *pName, const char *pDesc); void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pMsg); +void dndGetMonitorSysInfo(SMonSysInfo *pInfo); +SMsgCb dndCreateMsgcb(SMgmtWrapper *pWrapper); // dndFile.c int32_t dndReadFile(SMgmtWrapper *pWrapper, bool *pDeployed); diff --git a/source/dnode/mgmt/interface/src/dndInt.c b/source/dnode/mgmt/interface/src/dndInt.c index fb2338e698..52091ceb17 100644 --- a/source/dnode/mgmt/interface/src/dndInt.c +++ b/source/dnode/mgmt/interface/src/dndInt.c @@ -160,3 +160,22 @@ void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pReq) { .handle = pReq->handle, .pCont = pStartup, .contLen = sizeof(SStartupReq), .ahandle = pReq->ahandle}; rpcSendResponse(&rpcRsp); } + +void dndGetMonitorSysInfo(SMonSysInfo *pInfo) { + taosGetCpuUsage(&pInfo->cpu_engine, &pInfo->cpu_system); + taosGetCpuCores(&pInfo->cpu_cores); + taosGetProcMemory(&pInfo->mem_engine); + taosGetSysMemory(&pInfo->mem_system); + pInfo->mem_total = tsTotalMemoryKB; + pInfo->disk_engine = 0; + pInfo->disk_used = tsDataSpace.size.used; + pInfo->disk_total = tsDataSpace.size.total; + taosGetCardInfoDelta(&pInfo->net_in, &pInfo->net_out); + taosGetProcIODelta(&pInfo->io_read, &pInfo->io_write, &pInfo->io_read_disk, &pInfo->io_write_disk); +} + +SMsgCb dndCreateMsgcb(SMgmtWrapper *pWrapper) { + SMsgCb msgCb = pWrapper->pDnode->data.msgCb; + msgCb.pWrapper = pWrapper; + return msgCb; +} \ No newline at end of file diff --git a/source/dnode/mgmt/mgmt_bnode/CMakeLists.txt b/source/dnode/mgmt/mgmt_bnode/CMakeLists.txt new file mode 100644 index 0000000000..6a447dccf8 --- /dev/null +++ b/source/dnode/mgmt/mgmt_bnode/CMakeLists.txt @@ -0,0 +1,9 @@ +aux_source_directory(src MGMT_BNODE) +add_library(mgmt_bnode STATIC ${MGMT_BNODE}) +target_include_directories( + mgmt_bnode + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) +target_link_libraries( + mgmt_bnode dnode_interface +) \ No newline at end of file diff --git a/source/dnode/mgmt/mgmt_bnode/inc/bmInt.h b/source/dnode/mgmt/mgmt_bnode/inc/bmInt.h index 627df93b01..3158fe7d34 100644 --- a/source/dnode/mgmt/mgmt_bnode/inc/bmInt.h +++ b/source/dnode/mgmt/mgmt_bnode/inc/bmInt.h @@ -16,7 +16,7 @@ #ifndef _TD_DND_BNODE_INT_H_ #define _TD_DND_BNODE_INT_H_ -#include "dndNode.h" +#include "dndInt.h" #include "bnode.h" diff --git a/source/dnode/mgmt/mgmt_bnode/src/bmHandle.c b/source/dnode/mgmt/mgmt_bnode/src/bmHandle.c index 9b33533a8a..fef5670aa8 100644 --- a/source/dnode/mgmt/mgmt_bnode/src/bmHandle.c +++ b/source/dnode/mgmt/mgmt_bnode/src/bmHandle.c @@ -21,7 +21,7 @@ void bmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonBmInfo *bmInfo) {} int32_t bmProcessGetMonBmInfoReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq) { SMonBmInfo bmInfo = {0}; bmGetMonitorInfo(pWrapper, &bmInfo); - dmGetMonitorSysInfo(&bmInfo.sys); + dndGetMonitorSysInfo(&bmInfo.sys); monGetLogs(&bmInfo.log); int32_t rspLen = tSerializeSMonBmInfo(NULL, 0, &bmInfo); @@ -58,7 +58,8 @@ int32_t bmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) { dError("failed to create bnode since %s, input:%d cur:%d", terrstr(), createReq.dnodeId, pDnode->data.dnodeId); return -1; } else { - return dndOpenNode(pWrapper); + // return dndOpenNode(pWrapper); + return 0; } } diff --git a/source/dnode/mgmt/mgmt_mnode/CMakeLists.txt b/source/dnode/mgmt/mgmt_mnode/CMakeLists.txt new file mode 100644 index 0000000000..5ca9af5628 --- /dev/null +++ b/source/dnode/mgmt/mgmt_mnode/CMakeLists.txt @@ -0,0 +1,9 @@ +aux_source_directory(src MGMT_MNODE) +add_library(mgmt_mnode STATIC ${MGMT_MNODE}) +target_include_directories( + mgmt_mnode + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) +target_link_libraries( + mgmt_mnode dnode_interface +) \ No newline at end of file diff --git a/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h b/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h index 4f7c1d9d8c..d744d981bf 100644 --- a/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h +++ b/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h @@ -16,7 +16,8 @@ #ifndef _TD_DND_MNODE_INT_H_ #define _TD_DND_MNODE_INT_H_ -#include "dndNode.h" +#include "dndInt.h" + #include "mnode.h" #ifdef __cplusplus diff --git a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c index 08f1ff1cfa..d98cadb295 100644 --- a/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c +++ b/source/dnode/mgmt/mgmt_mnode/src/mmHandle.c @@ -24,7 +24,7 @@ void mmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonMmInfo *mmInfo) { int32_t mmProcessGetMonMmInfoReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq) { SMonMmInfo mmInfo = {0}; mmGetMonitorInfo(pWrapper, &mmInfo); - dmGetMonitorSysInfo(&mmInfo.sys); + dndGetMonitorSysInfo(&mmInfo.sys); monGetLogs(&mmInfo.log); int32_t rspLen = tSerializeSMonMmInfo(NULL, 0, &mmInfo); diff --git a/source/dnode/mgmt/mgmt_qnode/CMakeLists.txt b/source/dnode/mgmt/mgmt_qnode/CMakeLists.txt new file mode 100644 index 0000000000..bf31b2afc3 --- /dev/null +++ b/source/dnode/mgmt/mgmt_qnode/CMakeLists.txt @@ -0,0 +1,9 @@ +aux_source_directory(src MGMT_QNODE) +add_library(mgmt_qnode STATIC ${MGMT_QNODE}) +target_include_directories( + mgmt_qnode + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) +target_link_libraries( + mgmt_qnode dnode_interface +) \ No newline at end of file diff --git a/source/dnode/mgmt/mgmt_qnode/inc/qmInt.h b/source/dnode/mgmt/mgmt_qnode/inc/qmInt.h index 67a00396ea..2bf2509b07 100644 --- a/source/dnode/mgmt/mgmt_qnode/inc/qmInt.h +++ b/source/dnode/mgmt/mgmt_qnode/inc/qmInt.h @@ -16,7 +16,8 @@ #ifndef _TD_DND_QNODE_INT_H_ #define _TD_DND_QNODE_INT_H_ -#include "dndNode.h" +#include "dndInt.h" + #include "qnode.h" #ifdef __cplusplus diff --git a/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c b/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c index af1f903f7e..935c6b2093 100644 --- a/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c +++ b/source/dnode/mgmt/mgmt_qnode/src/qmHandle.c @@ -21,7 +21,7 @@ void qmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonQmInfo *qmInfo) {} int32_t qmProcessGetMonQmInfoReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq) { SMonQmInfo qmInfo = {0}; qmGetMonitorInfo(pWrapper, &qmInfo); - dmGetMonitorSysInfo(&qmInfo.sys); + dndGetMonitorSysInfo(&qmInfo.sys); monGetLogs(&qmInfo.log); int32_t rspLen = tSerializeSMonQmInfo(NULL, 0, &qmInfo); @@ -58,7 +58,8 @@ int32_t qmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) { dError("failed to create qnode since %s", terrstr()); return -1; } else { - return dndOpenNode(pWrapper); + // return dndOpenNode(pWrapper); + return 0; } } diff --git a/source/dnode/mgmt/mgmt_snode/CMakeLists.txt b/source/dnode/mgmt/mgmt_snode/CMakeLists.txt new file mode 100644 index 0000000000..b8a99c9d4d --- /dev/null +++ b/source/dnode/mgmt/mgmt_snode/CMakeLists.txt @@ -0,0 +1,9 @@ +aux_source_directory(src MGMT_SNODE) +add_library(mgmt_snode STATIC ${MGMT_SNODE}) +target_include_directories( + mgmt_snode + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) +target_link_libraries( + mgmt_snode dnode_interface +) \ No newline at end of file diff --git a/source/dnode/mgmt/mgmt_snode/inc/smInt.h b/source/dnode/mgmt/mgmt_snode/inc/smInt.h index 56cb954c22..697477ef42 100644 --- a/source/dnode/mgmt/mgmt_snode/inc/smInt.h +++ b/source/dnode/mgmt/mgmt_snode/inc/smInt.h @@ -16,7 +16,8 @@ #ifndef _TD_DND_SNODE_INT_H_ #define _TD_DND_SNODE_INT_H_ -#include "dndNode.h" +#include "dndInt.h" + #include "snode.h" #ifdef __cplusplus diff --git a/source/dnode/mgmt/mgmt_snode/src/smHandle.c b/source/dnode/mgmt/mgmt_snode/src/smHandle.c index 0f9bb5369d..cd8153fd60 100644 --- a/source/dnode/mgmt/mgmt_snode/src/smHandle.c +++ b/source/dnode/mgmt/mgmt_snode/src/smHandle.c @@ -21,7 +21,7 @@ void smGetMonitorInfo(SMgmtWrapper *pWrapper, SMonSmInfo *smInfo) {} int32_t smProcessGetMonSmInfoReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq) { SMonSmInfo smInfo = {0}; smGetMonitorInfo(pWrapper, &smInfo); - dmGetMonitorSysInfo(&smInfo.sys); + dndGetMonitorSysInfo(&smInfo.sys); monGetLogs(&smInfo.log); int32_t rspLen = tSerializeSMonSmInfo(NULL, 0, &smInfo); @@ -58,7 +58,8 @@ int32_t smProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) { dError("failed to create snode since %s", terrstr()); return -1; } else { - return dndOpenNode(pWrapper); + // return dndOpenNode(pWrapper); + return 0; } } diff --git a/source/dnode/mgmt/mgmt_vnode/CMakeLists.txt b/source/dnode/mgmt/mgmt_vnode/CMakeLists.txt new file mode 100644 index 0000000000..55a76cf772 --- /dev/null +++ b/source/dnode/mgmt/mgmt_vnode/CMakeLists.txt @@ -0,0 +1,9 @@ +aux_source_directory(src MGMT_VNODE) +add_library(mgmt_vnode STATIC ${MGMT_VNODE}) +target_include_directories( + mgmt_vnode + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" +) +target_link_libraries( + mgmt_vnode dnode_interface +) \ No newline at end of file diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index da5ab8387e..00cd0e2b86 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -16,8 +16,9 @@ #ifndef _TD_DND_VNODES_INT_H_ #define _TD_DND_VNODES_INT_H_ +#include "dndInt.h" + #include "sync.h" -#include "dndNode.h" #include "vnode.h" #ifdef __cplusplus @@ -95,6 +96,7 @@ int32_t vmProcessSyncVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pReq); int32_t vmProcessCompactVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pReq); int32_t vmProcessGetMonVmInfoReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq); int32_t vmProcessGetVnodeLoadsReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq); +void vmGetVnodeLoads(SMgmtWrapper *pWrapper, SMonVloadInfo *pInfo); // vmFile.c int32_t vmGetVnodesFromFile(SVnodesMgmt *pMgmt, SWrapperCfg **ppCfgs, int32_t *numOfVnodes); diff --git a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c index 0e74ca656c..f9e2b45d74 100644 --- a/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c +++ b/source/dnode/mgmt/mgmt_vnode/src/vmHandle.c @@ -36,7 +36,7 @@ void vmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonVmInfo *vmInfo) { int32_t vmProcessGetMonVmInfoReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq) { SMonVmInfo vmInfo = {0}; vmGetMonitorInfo(pWrapper, &vmInfo); - dmGetMonitorSysInfo(&vmInfo.sys); + dndGetMonitorSysInfo(&vmInfo.sys); monGetLogs(&vmInfo.log); int32_t rspLen = tSerializeSMonVmInfo(NULL, 0, &vmInfo); diff --git a/source/dnode/mgmt/test/CMakeLists.txt b/source/dnode/mgmt/test/CMakeLists.txt index ce93a14d3f..e1656ceb34 100644 --- a/source/dnode/mgmt/test/CMakeLists.txt +++ b/source/dnode/mgmt/test/CMakeLists.txt @@ -1,8 +1,9 @@ -enable_testing() - -add_subdirectory(qnode) -add_subdirectory(bnode) -add_subdirectory(snode) -add_subdirectory(mnode) -add_subdirectory(vnode) -add_subdirectory(sut) +if(${BUILD_TEST}) + enable_testing() + add_subdirectory(qnode) + add_subdirectory(bnode) + add_subdirectory(snode) + add_subdirectory(mnode) + add_subdirectory(vnode) + add_subdirectory(sut) +endif(${BUILD_TEST}) diff --git a/source/dnode/mgmt/test/bnode/CMakeLists.txt b/source/dnode/mgmt/test/bnode/CMakeLists.txt index 0c0006488d..7108d3adb9 100644 --- a/source/dnode/mgmt/test/bnode/CMakeLists.txt +++ b/source/dnode/mgmt/test/bnode/CMakeLists.txt @@ -1,8 +1,7 @@ -aux_source_directory(. BQTEST_SRC) -add_executable(dbnodeTest ${BQTEST_SRC}) +aux_source_directory(. DND_BNODE_TEST_SRC) +add_executable(dbnodeTest ${DND_BNODE_TEST_SRC}) target_link_libraries( - dbnodeTest - PUBLIC sut + dbnodeTest sut ) add_test( diff --git a/source/dnode/mgmt/test/mnode/CMakeLists.txt b/source/dnode/mgmt/test/mnode/CMakeLists.txt index 3237487242..e83f5dbbec 100644 --- a/source/dnode/mgmt/test/mnode/CMakeLists.txt +++ b/source/dnode/mgmt/test/mnode/CMakeLists.txt @@ -1,8 +1,7 @@ -aux_source_directory(. DMTEST_SRC) -add_executable(dmnodeTest ${DMTEST_SRC}) +aux_source_directory(. DND_MNODE_TEST_SRC) +add_executable(dmnodeTest ${DND_MNODE_TEST_SRC}) target_link_libraries( - dmnodeTest - PUBLIC sut + dmnodeTest sut ) add_test( diff --git a/source/dnode/mgmt/test/qnode/CMakeLists.txt b/source/dnode/mgmt/test/qnode/CMakeLists.txt index d118a8723a..20cb53fc45 100644 --- a/source/dnode/mgmt/test/qnode/CMakeLists.txt +++ b/source/dnode/mgmt/test/qnode/CMakeLists.txt @@ -1,5 +1,5 @@ -aux_source_directory(. DQTEST_SRC) -add_executable(dqnodeTest ${DQTEST_SRC}) +aux_source_directory(. DND_QNODE_TEST_SRC) +add_executable(dqnodeTest ${DND_QNODE_TEST_SRC}) target_link_libraries( dqnodeTest PUBLIC sut diff --git a/source/dnode/mgmt/test/snode/CMakeLists.txt b/source/dnode/mgmt/test/snode/CMakeLists.txt index eaabc5647b..70f3054381 100644 --- a/source/dnode/mgmt/test/snode/CMakeLists.txt +++ b/source/dnode/mgmt/test/snode/CMakeLists.txt @@ -1,5 +1,5 @@ -aux_source_directory(. SQTEST_SRC) -add_executable(dsnodeTest ${SQTEST_SRC}) +aux_source_directory(. DND_SNODE_TEST_SRC) +add_executable(dsnodeTest ${DND_SNODE_TEST_SRC}) target_link_libraries( dsnodeTest PUBLIC sut diff --git a/source/dnode/mgmt/test/sut/CMakeLists.txt b/source/dnode/mgmt/test/sut/CMakeLists.txt index 3a993986fe..c2e1d7e7cd 100644 --- a/source/dnode/mgmt/test/sut/CMakeLists.txt +++ b/source/dnode/mgmt/test/sut/CMakeLists.txt @@ -1,14 +1,10 @@ -aux_source_directory(src SUT_SRC) -add_library(sut STATIC STATIC ${SUT_SRC}) -target_link_libraries( - sut - PUBLIC dnode - PUBLIC util - PUBLIC os - PUBLIC gtest_main -) - +aux_source_directory(src DND_SUT_SRC) +add_library(sut STATIC STATIC ${DND_SUT_SRC}) target_include_directories( sut PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/inc" ) + +target_link_libraries( + sut dnode gtest_main +) diff --git a/source/dnode/mgmt/test/vnode/CMakeLists.txt b/source/dnode/mgmt/test/vnode/CMakeLists.txt index e2cd868513..34402286aa 100644 --- a/source/dnode/mgmt/test/vnode/CMakeLists.txt +++ b/source/dnode/mgmt/test/vnode/CMakeLists.txt @@ -1,5 +1,5 @@ -aux_source_directory(. VNODE_SRC) -add_executable(dvnodeTest ${VNODE_SRC}) +aux_source_directory(. DND_VNODE_TEST_SRC) +add_executable(dvnodeTest ${DND_VNODE_TEST_SRC}) target_link_libraries( dvnodeTest PUBLIC sut