minor changes

This commit is contained in:
Shengliang Guan 2022-01-05 02:35:34 -08:00
parent 9e3a6804a9
commit 11d6b02aa4
4 changed files with 11 additions and 14 deletions

View File

@ -14,7 +14,6 @@
*/ */
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h"
#include "mndAuth.h" #include "mndAuth.h"
int32_t mndInitAuth(SMnode *pMnode) { return 0; } int32_t mndInitAuth(SMnode *pMnode) { return 0; }

View File

@ -16,7 +16,6 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "mndCluster.h" #include "mndCluster.h"
#include "mndShow.h" #include "mndShow.h"
#include "mndTrans.h"
#define TSDB_CLUSTER_VER_NUMBE 1 #define TSDB_CLUSTER_VER_NUMBE 1
#define TSDB_CLUSTER_RESERVE_SIZE 64 #define TSDB_CLUSTER_RESERVE_SIZE 64

View File

@ -22,8 +22,8 @@ static SShowObj *mndCreateShowObj(SMnode *pMnode, SShowMsg *pMsg);
static void mndFreeShowObj(SShowObj *pShow); static void mndFreeShowObj(SShowObj *pShow);
static SShowObj *mndAcquireShowObj(SMnode *pMnode, int64_t showId); static SShowObj *mndAcquireShowObj(SMnode *pMnode, int64_t showId);
static void mndReleaseShowObj(SShowObj *pShow, bool forceRemove); static void mndReleaseShowObj(SShowObj *pShow, bool forceRemove);
static int32_t mndProcessShowMsg(SMnodeMsg *pMnodeMsg); static int32_t mndProcessShowReq(SMnodeMsg *pMsg);
static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMsg); static int32_t mndProcessRetrieveReq(SMnodeMsg *pMsg);
static bool mndCheckRetrieveFinished(SShowObj *pShow); static bool mndCheckRetrieveFinished(SShowObj *pShow);
int32_t mndInitShow(SMnode *pMnode) { int32_t mndInitShow(SMnode *pMnode) {
@ -36,8 +36,8 @@ int32_t mndInitShow(SMnode *pMnode) {
return -1; return -1;
} }
mndSetMsgHandle(pMnode, TDMT_MND_SHOW, mndProcessShowMsg); mndSetMsgHandle(pMnode, TDMT_MND_SHOW, mndProcessShowReq);
mndSetMsgHandle(pMnode, TDMT_MND_SHOW_RETRIEVE, mndProcessRetrieveMsg); mndSetMsgHandle(pMnode, TDMT_MND_SHOW_RETRIEVE, mndProcessRetrieveReq);
return 0; return 0;
} }
@ -115,7 +115,7 @@ static void mndReleaseShowObj(SShowObj *pShow, bool forceRemove) {
taosCacheRelease(pMgmt->cache, (void **)(&pShow), forceRemove); taosCacheRelease(pMgmt->cache, (void **)(&pShow), forceRemove);
} }
static int32_t mndProcessShowMsg(SMnodeMsg *pMnodeMsg) { static int32_t mndProcessShowReq(SMnodeMsg *pMnodeMsg) {
SMnode *pMnode = pMnodeMsg->pMnode; SMnode *pMnode = pMnodeMsg->pMnode;
SShowMgmt *pMgmt = &pMnode->showMgmt; SShowMgmt *pMgmt = &pMnode->showMgmt;
SShowMsg *pMsg = pMnodeMsg->rpcMsg.pCont; SShowMsg *pMsg = pMnodeMsg->rpcMsg.pCont;
@ -168,14 +168,14 @@ static int32_t mndProcessShowMsg(SMnodeMsg *pMnodeMsg) {
} }
} }
static int32_t mndProcessRetrieveMsg(SMnodeMsg *pMnodeMsg) { static int32_t mndProcessRetrieveReq(SMnodeMsg *pMsg) {
SMnode *pMnode = pMnodeMsg->pMnode; SMnode *pMnode = pMsg->pMnode;
SShowMgmt *pMgmt = &pMnode->showMgmt; SShowMgmt *pMgmt = &pMnode->showMgmt;
int32_t rowsToRead = 0; int32_t rowsToRead = 0;
int32_t size = 0; int32_t size = 0;
int32_t rowsRead = 0; int32_t rowsRead = 0;
SRetrieveTableMsg *pRetrieve = pMnodeMsg->rpcMsg.pCont; SRetrieveTableMsg *pRetrieve = pMsg->rpcMsg.pCont;
int64_t showId = htobe64(pRetrieve->showId); int64_t showId = htobe64(pRetrieve->showId);
SShowObj *pShow = mndAcquireShowObj(pMnode, 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 free flag is set, client wants to clean the resources
if ((pRetrieve->free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) { 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); 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->numOfRows = htonl(rowsRead);
pRsp->precision = TSDB_TIME_PRECISION_MILLI; // millisecond time precision pRsp->precision = TSDB_TIME_PRECISION_MILLI; // millisecond time precision
pMnodeMsg->pCont = pRsp; pMsg->pCont = pRsp;
pMnodeMsg->contLen = size; pMsg->contLen = size;
if (rowsRead == 0 || rowsToRead == 0 || (rowsRead == rowsToRead && pShow->numOfRows == pShow->numOfReads)) { if (rowsRead == 0 || rowsToRead == 0 || (rowsRead == rowsToRead && pShow->numOfRows == pShow->numOfReads)) {
pRsp->completed = 1; pRsp->completed = 1;

View File

@ -16,7 +16,6 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "mndUser.h" #include "mndUser.h"
#include "mndShow.h" #include "mndShow.h"
#include "mndSync.h"
#include "mndTrans.h" #include "mndTrans.h"
#include "tkey.h" #include "tkey.h"