diff --git a/source/dnode/mgmt/container/src/dndMonitor.c b/source/dnode/mgmt/container/src/dndMonitor.c index 7c47275c45a4fff9f31447fc74b4cfec127e5f55..668426cfce6c0feeb6e3c18f762e96512405bc03 100644 --- a/source/dnode/mgmt/container/src/dndMonitor.c +++ b/source/dnode/mgmt/container/src/dndMonitor.c @@ -22,7 +22,7 @@ static int32_t dndGetMonitorDiskInfo(SDnode *pDnode, SMonDiskInfo *pInfo) { tstrncpy(pInfo->tempdir.name, tsTempDir, sizeof(pInfo->tempdir.name)); pInfo->tempdir.size = tsTempSpace.size; - return vmGetTfsMonitorInfo(dndAcquireWrapper(pDnode, VNODES), pInfo); + return vmMonitorTfsInfo(dndAcquireWrapper(pDnode, VNODES), pInfo); } static void dndGetMonitorBasicInfo(SDnode *pDnode, SMonBasicInfo *pInfo) { @@ -45,7 +45,7 @@ static void dndGetMonitorDnodeInfo(SDnode *pDnode, SMonDnodeInfo *pInfo) { taosGetCardInfo(&pInfo->net_in, &pInfo->net_out); taosGetProcIO(&pInfo->io_read, &pInfo->io_write, &pInfo->io_read_disk, &pInfo->io_write_disk); - vmGetVnodeReqs(dndAcquireWrapper(pDnode, VNODES), pInfo); + vmMonitorVnodeReqs(dndAcquireWrapper(pDnode, VNODES), pInfo); pInfo->has_mnode = (dndAcquireWrapper(pDnode, MNODE)->required); } @@ -63,7 +63,7 @@ void dndSendMonitorReport(SDnode *pDnode) { SMonClusterInfo clusterInfo = {0}; SMonVgroupInfo vgroupInfo = {0}; SMonGrantInfo grantInfo = {0}; - if (mmGetMonitorInfo(dndAcquireWrapper(pDnode, MNODE), &clusterInfo, &vgroupInfo, &grantInfo) == 0) { + if (mmMonitorMnodeInfo(dndAcquireWrapper(pDnode, MNODE), &clusterInfo, &vgroupInfo, &grantInfo) == 0) { monSetClusterInfo(pMonitor, &clusterInfo); monSetVgroupInfo(pMonitor, &vgroupInfo); monSetGrantInfo(pMonitor, &grantInfo); diff --git a/source/dnode/mgmt/dnode/src/dmMsg.c b/source/dnode/mgmt/dnode/src/dmMsg.c index 66b3d5c07d57029445e9417cf61f1a94f4ed4d32..f451c2ab05669b3903e95571e53aea6e97af35aa 100644 --- a/source/dnode/mgmt/dnode/src/dmMsg.c +++ b/source/dnode/mgmt/dnode/src/dmMsg.c @@ -42,7 +42,7 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) { taosRUnLockLatch(&pMgmt->latch); req.pVloads = taosArrayInit(TSDB_MAX_VNODES, sizeof(SVnodeLoad)); - vmGetVnodeLoads(dndAcquireWrapper(pDnode, VNODES), req.pVloads); + vmMonitorVnodeLoads(dndAcquireWrapper(pDnode, VNODES), req.pVloads); int32_t contLen = tSerializeSStatusReq(NULL, 0, &req); void *pHead = rpcMallocCont(contLen); diff --git a/source/dnode/mgmt/mnode/inc/mm.h b/source/dnode/mgmt/mnode/inc/mm.h index 371d732e77dc66b74f84af0d881021c393fdcd0b..6ed6c42d93c7bceacba6c386158abaef38b74baa 100644 --- a/source/dnode/mgmt/mnode/inc/mm.h +++ b/source/dnode/mgmt/mnode/inc/mm.h @@ -25,7 +25,7 @@ extern "C" { void mmGetMgmtFp(SMgmtWrapper *pMgmt); int32_t mmGetUserAuth(SMgmtWrapper *pWrapper, char *user, char *spi, char *encrypt, char *secret, char *ckey); -int32_t mmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonClusterInfo *pClusterInfo, SMonVgroupInfo *pVgroupInfo, +int32_t mmMonitorMnodeInfo(SMgmtWrapper *pWrapper, SMonClusterInfo *pClusterInfo, SMonVgroupInfo *pVgroupInfo, SMonGrantInfo *pGrantInfo); #ifdef __cplusplus diff --git a/source/dnode/mgmt/mnode/src/mmInt.c b/source/dnode/mgmt/mnode/src/mmInt.c index 10e5c5d1dfc9a874f9422978f76f2c52b5ba9763..82ddb7e953a8a2ec1e4baf13d6331182242ea57e 100644 --- a/source/dnode/mgmt/mnode/src/mmInt.c +++ b/source/dnode/mgmt/mnode/src/mmInt.c @@ -132,7 +132,7 @@ static int32_t mmOpenImp(SMnodeMgmt *pMgmt, SDCreateMnodeReq *pReq) { } bool deployed = true; - if (dndWriteFile(pMgmt->pWrapper, deployed) != 0) { + if (mmWriteFile(pMgmt, deployed) != 0) { dError("failed to write mnode file since %s", terrstr()); return -1; } @@ -243,7 +243,7 @@ int32_t mmGetUserAuth(SMgmtWrapper *pWrapper, char *user, char *spi, char *encry return code; } -int32_t mmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonClusterInfo *pClusterInfo, SMonVgroupInfo *pVgroupInfo, +int32_t mmMonitorMnodeInfo(SMgmtWrapper *pWrapper, SMonClusterInfo *pClusterInfo, SMonVgroupInfo *pVgroupInfo, SMonGrantInfo *pGrantInfo) { SMnodeMgmt *pMgmt = pWrapper->pMgmt; return mndGetMonitorInfo(pMgmt->pMnode, pClusterInfo, pVgroupInfo, pGrantInfo); diff --git a/source/dnode/mgmt/vnode/inc/vm.h b/source/dnode/mgmt/vnode/inc/vm.h index ddb3a3bab305f543da61576c880c2f4b66852106..60d9cfc3a175344014870a103078555c22cc569c 100644 --- a/source/dnode/mgmt/vnode/inc/vm.h +++ b/source/dnode/mgmt/vnode/inc/vm.h @@ -34,11 +34,10 @@ typedef struct { } SVnodesStat; void vmGetMgmtFp(SMgmtWrapper *pWrapper); -void vmInitMsgHandles(SMgmtWrapper *pWrapper); -void vmGetVnodeLoads(SMgmtWrapper *pWrapper, SArray *pLoads); -int32_t vmGetTfsMonitorInfo(SMgmtWrapper *pWrapper, SMonDiskInfo *pInfo); -void vmGetVnodeReqs(SMgmtWrapper *pWrapper, SMonDnodeInfo *pInfo); +void vmMonitorVnodeLoads(SMgmtWrapper *pWrapper, SArray *pLoads); +int32_t vmMonitorTfsInfo(SMgmtWrapper *pWrapper, SMonDiskInfo *pInfo); +void vmMonitorVnodeReqs(SMgmtWrapper *pWrapper, SMonDnodeInfo *pInfo); #ifdef __cplusplus } diff --git a/source/dnode/mgmt/vnode/inc/vmInt.h b/source/dnode/mgmt/vnode/inc/vmInt.h index 2e2f619ae7e4273fcf00a7ddac234e75e201994b..a5e29f89d054c51be4ee078548e089ca3a04e8cd 100644 --- a/source/dnode/mgmt/vnode/inc/vmInt.h +++ b/source/dnode/mgmt/vnode/inc/vmInt.h @@ -82,6 +82,7 @@ int32_t vmOpenVnode(SVnodesMgmt *pMgmt, SWrapperCfg *pCfg, SVnode *pImpl); void vmCloseVnode(SVnodesMgmt *pMgmt, SVnodeObj *pVnode); // vmMsg.c +void vmInitMsgHandles(SMgmtWrapper *pWrapper); int32_t vmProcessCreateVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pReq); int32_t vmProcessAlterVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pReq); int32_t vmProcessDropVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pReq); diff --git a/source/dnode/mgmt/vnode/src/vmInt.c b/source/dnode/mgmt/vnode/src/vmInt.c index 1c28b02aa38e3a3d1b9bb4f7129956ac5789e5c2..6751ef3f3cc110e50bae1b2c3df4e2c68fe70e6f 100644 --- a/source/dnode/mgmt/vnode/src/vmInt.c +++ b/source/dnode/mgmt/vnode/src/vmInt.c @@ -341,14 +341,14 @@ void vmGetMgmtFp(SMgmtWrapper *pWrapper) { pWrapper->fp = mgmtFp; } -int32_t vmGetTfsMonitorInfo(SMgmtWrapper *pWrapper, SMonDiskInfo *pInfo) { +int32_t vmMonitorTfsInfo(SMgmtWrapper *pWrapper, SMonDiskInfo *pInfo) { SVnodesMgmt *pMgmt = pWrapper->pMgmt; if (pMgmt == NULL) return -1; return tfsGetMonitorInfo(pMgmt->pTfs, pInfo); } -void vmGetVnodeReqs(SMgmtWrapper *pWrapper, SMonDnodeInfo *pInfo) { +void vmMonitorVnodeReqs(SMgmtWrapper *pWrapper, SMonDnodeInfo *pInfo) { SVnodesMgmt *pMgmt = pWrapper->pMgmt; if (pMgmt == NULL) return; @@ -363,7 +363,7 @@ void vmGetVnodeReqs(SMgmtWrapper *pWrapper, SMonDnodeInfo *pInfo) { pInfo->masters = pStat->masterNum; } -void vmGetVnodeLoads(SMgmtWrapper *pWrapper, SArray *pLoads) { +void vmMonitorVnodeLoads(SMgmtWrapper *pWrapper, SArray *pLoads) { SVnodesMgmt *pMgmt = pWrapper->pMgmt; SVnodesStat *pStat = &pMgmt->state; int32_t totalVnodes = 0;