From 11d6b02aa4fb0c2097c7b17b7986c5d3305d03ac Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 5 Jan 2022 02:35:34 -0800 Subject: [PATCH] minor changes --- source/dnode/mnode/impl/src/mndAuth.c | 1 - source/dnode/mnode/impl/src/mndCluster.c | 1 - source/dnode/mnode/impl/src/mndShow.c | 22 +++++++++++----------- source/dnode/mnode/impl/src/mndUser.c | 1 - 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/source/dnode/mnode/impl/src/mndAuth.c b/source/dnode/mnode/impl/src/mndAuth.c index bcefbfde21..a2fc7a57b3 100644 --- a/source/dnode/mnode/impl/src/mndAuth.c +++ b/source/dnode/mnode/impl/src/mndAuth.c @@ -14,7 +14,6 @@ */ #define _DEFAULT_SOURCE -#include "os.h" #include "mndAuth.h" int32_t mndInitAuth(SMnode *pMnode) { return 0; } diff --git a/source/dnode/mnode/impl/src/mndCluster.c b/source/dnode/mnode/impl/src/mndCluster.c index b29f8276fe..8cb98a148f 100644 --- a/source/dnode/mnode/impl/src/mndCluster.c +++ b/source/dnode/mnode/impl/src/mndCluster.c @@ -16,7 +16,6 @@ #define _DEFAULT_SOURCE #include "mndCluster.h" #include "mndShow.h" -#include "mndTrans.h" #define TSDB_CLUSTER_VER_NUMBE 1 #define TSDB_CLUSTER_RESERVE_SIZE 64 diff --git a/source/dnode/mnode/impl/src/mndShow.c b/source/dnode/mnode/impl/src/mndShow.c index 125c250614..81e15497bf 100644 --- a/source/dnode/mnode/impl/src/mndShow.c +++ b/source/dnode/mnode/impl/src/mndShow.c @@ -22,8 +22,8 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SShowMsg *pMsg); static void mndFreeShowObj(SShowObj *pShow); static SShowObj *mndAcquireShowObj(SMnode *pMnode, int64_t showId); static void mndReleaseShowObj(SShowObj *pShow, bool forceRemove); -static int32_t mndProcessShowMsg(SMnodeMsg *pMnodeMsg); -static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMsg); +static int32_t mndProcessShowReq(SMnodeMsg *pMsg); +static int32_t mndProcessRetrieveReq(SMnodeMsg *pMsg); static bool mndCheckRetrieveFinished(SShowObj *pShow); int32_t mndInitShow(SMnode *pMnode) { @@ -36,8 +36,8 @@ int32_t mndInitShow(SMnode *pMnode) { return -1; } - mndSetMsgHandle(pMnode, TDMT_MND_SHOW, mndProcessShowMsg); - mndSetMsgHandle(pMnode, TDMT_MND_SHOW_RETRIEVE, mndProcessRetrieveMsg); + mndSetMsgHandle(pMnode, TDMT_MND_SHOW, mndProcessShowReq); + mndSetMsgHandle(pMnode, TDMT_MND_SHOW_RETRIEVE, mndProcessRetrieveReq); return 0; } @@ -115,7 +115,7 @@ static void mndReleaseShowObj(SShowObj *pShow, bool forceRemove) { taosCacheRelease(pMgmt->cache, (void **)(&pShow), forceRemove); } -static int32_t mndProcessShowMsg(SMnodeMsg *pMnodeMsg) { +static int32_t mndProcessShowReq(SMnodeMsg *pMnodeMsg) { SMnode *pMnode = pMnodeMsg->pMnode; SShowMgmt *pMgmt = &pMnode->showMgmt; SShowMsg *pMsg = pMnodeMsg->rpcMsg.pCont; @@ -168,14 +168,14 @@ static int32_t mndProcessShowMsg(SMnodeMsg *pMnodeMsg) { } } -static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMnodeMsg) { - SMnode *pMnode = pMnodeMsg->pMnode; +static int32_t mndProcessRetrieveReq(SMnodeMsg *pMsg) { + SMnode *pMnode = pMsg->pMnode; SShowMgmt *pMgmt = &pMnode->showMgmt; int32_t rowsToRead = 0; int32_t size = 0; int32_t rowsRead = 0; - SRetrieveTableMsg *pRetrieve = pMnodeMsg->rpcMsg.pCont; + SRetrieveTableMsg *pRetrieve = pMsg->rpcMsg.pCont; int64_t showId = htobe64(pRetrieve->showId); SShowObj *pShow = mndAcquireShowObj(pMnode, showId); @@ -227,7 +227,7 @@ static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMnodeMsg) { // if free flag is set, client wants to clean the resources if ((pRetrieve->free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) { - rowsRead = (*retrieveFp)(pMnodeMsg, pShow, pRsp->data, rowsToRead); + rowsRead = (*retrieveFp)(pMsg, pShow, pRsp->data, rowsToRead); } mDebug("show:0x%" PRIx64 ", stop retrieve data, rowsRead:%d rowsToRead:%d", pShow->id, rowsRead, rowsToRead); @@ -235,8 +235,8 @@ static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMnodeMsg) { pRsp->numOfRows = htonl(rowsRead); pRsp->precision = TSDB_TIME_PRECISION_MILLI; // millisecond time precision - pMnodeMsg->pCont = pRsp; - pMnodeMsg->contLen = size; + pMsg->pCont = pRsp; + pMsg->contLen = size; if (rowsRead == 0 || rowsToRead == 0 || (rowsRead == rowsToRead && pShow->numOfRows == pShow->numOfReads)) { pRsp->completed = 1; diff --git a/source/dnode/mnode/impl/src/mndUser.c b/source/dnode/mnode/impl/src/mndUser.c index 3ffb979ed1..0891cf43b3 100644 --- a/source/dnode/mnode/impl/src/mndUser.c +++ b/source/dnode/mnode/impl/src/mndUser.c @@ -16,7 +16,6 @@ #define _DEFAULT_SOURCE #include "mndUser.h" #include "mndShow.h" -#include "mndSync.h" #include "mndTrans.h" #include "tkey.h"