提交 7ac821f2 编写于 作者: S Shengliang Guan

[TD-335] rename some defs

上级 3b54b745
......@@ -2175,7 +2175,7 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
*/
SShowInfo* pShowInfo = &pInfo->pDCLInfo->showOpt;
int16_t showType = pShowInfo->showType;
if (showType == TSDB_MGMT_TABLE_TABLE || showType == TSDB_MGMT_TABLE_METRIC || showType == TSDB_MGMT_TABLE_VGROUP) {
if (showType == TSDB_MNODE_TABLE_TABLE || showType == TSDB_MNODE_TABLE_METRIC || showType == TSDB_MNODE_TABLE_VGROUP) {
// db prefix in tagCond, show table conds in payload
SSQLToken* pDbPrefixToken = &pShowInfo->prefix;
if (pDbPrefixToken->type != 0) {
......@@ -2212,7 +2212,7 @@ int32_t setShowInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
}
}
} else if (showType == TSDB_MGMT_TABLE_VNODES) {
} else if (showType == TSDB_MNODE_TABLE_VNODES) {
if (pShowInfo->prefix.type == 0) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), "No specified ip of dnode");
}
......
......@@ -1116,7 +1116,7 @@ int32_t tscBuildShowMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SShowInfo *pShowInfo = &pInfo->pDCLInfo->showOpt;
pShowMsg->type = pShowInfo->showType;
if (pShowInfo->showType != TSDB_MGMT_TABLE_VNODES) {
if (pShowInfo->showType != TSDB_MNODE_TABLE_VNODES) {
SSQLToken *pPattern = &pShowInfo->pattern;
if (pPattern->type > 0) { // only show tables support wildcard query
strncpy(pShowMsg->payload, pPattern->z, pPattern->n);
......
......@@ -121,23 +121,23 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY14, "dummy14" )
#define TSDB_IE_TYPE_DNODE_STATE 7
enum _mgmt_table {
TSDB_MGMT_TABLE_ACCT,
TSDB_MGMT_TABLE_USER,
TSDB_MGMT_TABLE_DB,
TSDB_MGMT_TABLE_TABLE,
TSDB_MGMT_TABLE_DNODE,
TSDB_MGMT_TABLE_MNODE,
TSDB_MGMT_TABLE_VGROUP,
TSDB_MGMT_TABLE_METRIC,
TSDB_MGMT_TABLE_MODULE,
TSDB_MGMT_TABLE_QUERIES,
TSDB_MGMT_TABLE_STREAMS,
TSDB_MGMT_TABLE_CONFIGS,
TSDB_MGMT_TABLE_CONNS,
TSDB_MGMT_TABLE_SCORES,
TSDB_MGMT_TABLE_GRANTS,
TSDB_MGMT_TABLE_VNODES,
TSDB_MGMT_TABLE_MAX,
TSDB_MNODE_TABLE_ACCT,
TSDB_MNODE_TABLE_USER,
TSDB_MNODE_TABLE_DB,
TSDB_MNODE_TABLE_TABLE,
TSDB_MNODE_TABLE_DNODE,
TSDB_MNODE_TABLE_MNODE,
TSDB_MNODE_TABLE_VGROUP,
TSDB_MNODE_TABLE_METRIC,
TSDB_MNODE_TABLE_MODULE,
TSDB_MNODE_TABLE_QUERIES,
TSDB_MNODE_TABLE_STREAMS,
TSDB_MNODE_TABLE_CONFIGS,
TSDB_MNODE_TABLE_CONNS,
TSDB_MNODE_TABLE_SCORES,
TSDB_MNODE_TABLE_GRANTS,
TSDB_MNODE_TABLE_VNODES,
TSDB_MNODE_TABLE_MAX,
};
#define TSDB_ALTER_TABLE_ADD_TAG_COLUMN 1
......
......@@ -20,7 +20,7 @@
extern "C" {
#endif
#include "mgmtDef.h"
#include "mnodeDef.h"
enum _TSDB_DB_STATUS {
TSDB_DB_STATUS_READY,
......
......@@ -19,7 +19,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "mgmtDef.h"
#include "mnodeDef.h"
int32_t mgmtInitProfile();
void mgmtCleanUpProfile();
......
......@@ -19,7 +19,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "mgmtDef.h"
#include "mnodeDef.h"
int32_t mgmtInitShell();
void mgmtCleanUpShell();
......
......@@ -20,7 +20,7 @@
extern "C" {
#endif
#include "mgmtDef.h"
#include "mnodeDef.h"
int32_t mgmtInitTables();
void mgmtCleanUpTables();
......
......@@ -19,7 +19,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "mgmtDef.h"
#include "mnodeDef.h"
int32_t mgmtInitUsers();
void mgmtCleanUpUsers();
......
......@@ -20,7 +20,7 @@
extern "C" {
#endif
#include "mgmtDef.h"
#include "mnodeDef.h"
int32_t mgmtInitVgroups();
void mgmtCleanUpVgroups();
......
......@@ -19,12 +19,12 @@
#include "ttime.h"
#include "tutil.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtAcct.h"
#include "mgmtDb.h"
#include "mgmtSdb.h"
#include "mgmtUser.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeAcct.h"
#include "mnodeDb.h"
#include "mnodeSdb.h"
#include "mnodeUser.h"
void * tsAcctSdb = NULL;
static int32_t tsAcctUpdateSize;
......
......@@ -18,12 +18,12 @@
#include "trpc.h"
#include "tbalance.h"
#include "tglobal.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtMnode.h"
#include "mgmtDnode.h"
#include "mgmtSdb.h"
#include "mgmtVgroup.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeMnode.h"
#include "mnodeDnode.h"
#include "mnodeSdb.h"
#include "mnodeVgroup.h"
#ifndef _SYNC
......
......@@ -24,18 +24,18 @@
#include "tname.h"
#include "tbalance.h"
#include "tdataformat.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtAcct.h"
#include "mgmtDb.h"
#include "mgmtDnode.h"
#include "mgmtMnode.h"
#include "mgmtShell.h"
#include "mgmtProfile.h"
#include "mgmtSdb.h"
#include "mgmtTable.h"
#include "mgmtUser.h"
#include "mgmtVgroup.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeAcct.h"
#include "mnodeDb.h"
#include "mnodeDnode.h"
#include "mnodeMnode.h"
#include "mnodeShell.h"
#include "mnodeProfile.h"
#include "mnodeSdb.h"
#include "mnodeTable.h"
#include "mnodeUser.h"
#include "mnodeVgroup.h"
static void * tsDbSdb = NULL;
static int32_t tsDbUpdateSize;
......@@ -150,8 +150,8 @@ int32_t mgmtInitDbs() {
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CREATE_DB, mgmtProcessCreateDbMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_ALTER_DB, mgmtProcessAlterDbMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_DROP_DB, mgmtProcessDropDbMsg);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DB, mgmtGetDbMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DB, mgmtRetrieveDbs);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_DB, mgmtGetDbMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_DB, mgmtRetrieveDbs);
mTrace("table:dbs table is created");
return 0;
......
......@@ -26,14 +26,14 @@
#include "tsync.h"
#include "tdataformat.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtDnode.h"
#include "mgmtMnode.h"
#include "mgmtSdb.h"
#include "mgmtShell.h"
#include "mgmtUser.h"
#include "mgmtVgroup.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeDnode.h"
#include "mnodeMnode.h"
#include "mnodeSdb.h"
#include "mnodeShell.h"
#include "mnodeUser.h"
#include "mnodeVgroup.h"
int32_t tsAccessSquence = 0;
static void *tsDnodeSdb = NULL;
......@@ -153,14 +153,14 @@ int32_t mgmtInitDnodes() {
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CONFIG_DNODE, mgmtProcessCfgDnodeMsg);
dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CONFIG_DNODE_RSP, mgmtProcessCfgDnodeMsgRsp);
dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_STATUS, mgmtProcessDnodeStatusMsg);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_MODULE, mgmtGetModuleMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_MODULE, mgmtRetrieveModules);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_CONFIGS, mgmtGetConfigMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_CONFIGS, mgmtRetrieveConfigs);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_VNODES, mgmtGetVnodeMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_VNODES, mgmtRetrieveVnodes);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DNODE, mgmtGetDnodeMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DNODE, mgmtRetrieveDnodes);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_MODULE, mgmtGetModuleMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_MODULE, mgmtRetrieveModules);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_CONFIGS, mgmtGetConfigMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_CONFIGS, mgmtRetrieveConfigs);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_VNODES, mgmtGetVnodeMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_VNODES, mgmtRetrieveVnodes);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_DNODE, mgmtGetDnodeMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_DNODE, mgmtRetrieveDnodes);
mTrace("table:dnodes table is created");
return 0;
......
......@@ -18,7 +18,7 @@
#include "os.h"
#include "taoserror.h"
#include "tgrant.h"
#include "mgmtInt.h"
#include "mnodeInt.h"
int32_t grantInit() { return TSDB_CODE_SUCCESS; }
void grantCleanUp() {}
......
......@@ -22,18 +22,18 @@
#include "ttimer.h"
#include "tglobal.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtServer.h"
#include "mgmtAcct.h"
#include "mgmtDnode.h"
#include "mgmtMnode.h"
#include "mgmtDb.h"
#include "mgmtSdb.h"
#include "mgmtVgroup.h"
#include "mgmtUser.h"
#include "mgmtTable.h"
#include "mgmtShell.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeServer.h"
#include "mnodeAcct.h"
#include "mnodeDnode.h"
#include "mnodeMnode.h"
#include "mnodeDb.h"
#include "mnodeSdb.h"
#include "mnodeVgroup.h"
#include "mnodeUser.h"
#include "mnodeTable.h"
#include "mnodeShell.h"
static void *tsMgmtTmr;
static bool tsMgmtIsRunning = false;
......
......@@ -24,15 +24,15 @@
#include "tbalance.h"
#include "tglobal.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtDb.h"
#include "mgmtMnode.h"
#include "mgmtProfile.h"
#include "mgmtShell.h"
#include "mgmtSdb.h"
#include "mgmtTable.h"
#include "mgmtVgroup.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeDb.h"
#include "mnodeMnode.h"
#include "mnodeProfile.h"
#include "mnodeShell.h"
#include "mnodeSdb.h"
#include "mnodeTable.h"
#include "mnodeVgroup.h"
static void (*tsMnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MAX])(SMnodeMsg *);
......
......@@ -23,13 +23,13 @@
#include "ttime.h"
#include "tsocket.h"
#include "tdataformat.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtMnode.h"
#include "mgmtDnode.h"
#include "mgmtSdb.h"
#include "mgmtShell.h"
#include "mgmtUser.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeMnode.h"
#include "mnodeDnode.h"
#include "mnodeSdb.h"
#include "mnodeShell.h"
#include "mnodeUser.h"
static void * tsMnodeSdb = NULL;
static int32_t tsMnodeUpdateSize = 0;
......@@ -154,8 +154,8 @@ int32_t mgmtInitMnodes() {
return -1;
}
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_MNODE, mgmtGetMnodeMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_MNODE, mgmtRetrieveMnodes);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_MNODE, mgmtGetMnodeMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_MNODE, mgmtRetrieveMnodes);
mTrace("table:mnodes table is created");
return TSDB_CODE_SUCCESS;
......
......@@ -18,17 +18,17 @@
#include "taosmsg.h"
#include "taoserror.h"
#include "tutil.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtAcct.h"
#include "mgmtDnode.h"
#include "mgmtDb.h"
#include "mgmtMnode.h"
#include "mgmtProfile.h"
#include "mgmtShell.h"
#include "mgmtTable.h"
#include "mgmtUser.h"
#include "mgmtVgroup.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeAcct.h"
#include "mnodeDnode.h"
#include "mnodeDb.h"
#include "mnodeMnode.h"
#include "mnodeProfile.h"
#include "mnodeShell.h"
#include "mnodeTable.h"
#include "mnodeUser.h"
#include "mnodeVgroup.h"
int32_t mgmtSaveQueryStreamList(SCMHeartBeatMsg *pHBMsg);
......@@ -745,12 +745,12 @@ void mgmtProcessKillConnectionMsg(SMnodeMsg *pMsg) {
}
int32_t mgmtInitProfile() {
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_QUERIES, mgmtGetQueryMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_QUERIES, mgmtRetrieveQueries);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_CONNS, mgmtGetConnsMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_CONNS, mgmtRetrieveConns);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_STREAMS, mgmtGetStreamMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_STREAMS, mgmtRetrieveStreams);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_QUERIES, mgmtGetQueryMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_QUERIES, mgmtRetrieveQueries);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_CONNS, mgmtGetConnsMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_CONNS, mgmtRetrieveConns);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_STREAMS, mgmtGetStreamMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_STREAMS, mgmtRetrieveStreams);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_KILL_QUERY, mgmtProcessKillQueryMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_KILL_STREAM, mgmtProcessKillStreamMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_KILL_CONN, mgmtProcessKillConnectionMsg);
......
......@@ -23,13 +23,13 @@
#include "tglobal.h"
#include "mnode.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mnodeDef.h"
#include "mgmtInt.h"
#include "mgmtServer.h"
#include "mgmtAcct.h"
#include "mnodeAcct.h"
#include "mgmtDnode.h"
#include "mgmtMnode.h"
#include "mgmtDb.h"
#include "mnodeDb.h"
#include "mgmtSdb.h"
#include "mgmtVgroup.h"
#include "mgmtUser.h"
......
......@@ -25,11 +25,11 @@
#include "tsync.h"
#include "tglobal.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtMnode.h"
#include "mgmtDnode.h"
#include "mgmtSdb.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeMnode.h"
#include "mnodeDnode.h"
#include "mnodeSdb.h"
typedef enum {
SDB_ACTION_INSERT,
......
......@@ -25,41 +25,41 @@
#include "tglobal.h"
#include "tcache.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtAcct.h"
#include "mgmtDb.h"
#include "mgmtDnode.h"
#include "mgmtMnode.h"
#include "mgmtProfile.h"
#include "mgmtSdb.h"
#include "mgmtShell.h"
#include "mgmtTable.h"
#include "mgmtUser.h"
#include "mgmtVgroup.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeAcct.h"
#include "mnodeDb.h"
#include "mnodeDnode.h"
#include "mnodeMnode.h"
#include "mnodeProfile.h"
#include "mnodeSdb.h"
#include "mnodeShell.h"
#include "mnodeTable.h"
#include "mnodeUser.h"
#include "mnodeVgroup.h"
typedef int32_t (*SShowMetaFp)(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn);
typedef int32_t (*SShowRetrieveFp)(SShowObj *pShow, char *data, int32_t rows, void *pConn);
static void mgmtProcessShowMsg(SMnodeMsg *queuedMsg);
static void mgmtProcessRetrieveMsg(SMnodeMsg *queuedMsg);
static void mgmtProcessHeartBeatMsg(SMnodeMsg *queuedMsg);
static void mgmtProcessConnectMsg(SMnodeMsg *queuedMsg);
static void mgmtProcessUseMsg(SMnodeMsg *queuedMsg);
static void mgmtFreeShowObj(void *data);
static void mnodeProcessShowMsg(SMnodeMsg *queuedMsg);
static void mnodeProcessRetrieveMsg(SMnodeMsg *queuedMsg);
static void mnodeProcessHeartBeatMsg(SMnodeMsg *queuedMsg);
static void mnodeProcessConnectMsg(SMnodeMsg *queuedMsg);
static void mnodeProcessUseMsg(SMnodeMsg *queuedMsg);
static void mnodeFreeShowObj(void *data);
static void *tsQhandleCache = NULL;
static SShowMetaFp tsMnodeShowMetaFp[TSDB_MGMT_TABLE_MAX] = {0};
static SShowRetrieveFp tsMnodeShowRetrieveFp[TSDB_MGMT_TABLE_MAX] = {0};
static SShowMetaFp tsMnodeShowMetaFp[TSDB_MNODE_TABLE_MAX] = {0};
static SShowRetrieveFp tsMnodeShowRetrieveFp[TSDB_MNODE_TABLE_MAX] = {0};
void mnodeInitShow() {
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_SHOW, mgmtProcessShowMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_RETRIEVE, mgmtProcessRetrieveMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_HEARTBEAT, mgmtProcessHeartBeatMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_CONNECT, mgmtProcessConnectMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_USE_DB, mgmtProcessUseMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_SHOW, mnodeProcessShowMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_RETRIEVE, mnodeProcessRetrieveMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_HEARTBEAT, mnodeProcessHeartBeatMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_CONNECT, mnodeProcessConnectMsg);
mnodeAddReadMsgHandle(TSDB_MSG_TYPE_CM_USE_DB, mnodeProcessUseMsg);
tsQhandleCache = taosCacheInitWithCb(tsMgmtTmr, 10, mgmtFreeShowObj);
tsQhandleCache = taosCacheInitWithCb(tsMgmtTmr, 10, mnodeFreeShowObj);
}
void mnodeCleanUpShow() {
......@@ -77,48 +77,37 @@ void mnodeAddShowRetrieveHandle(uint8_t msgType, SShowRetrieveFp fp) {
tsMnodeShowRetrieveFp[msgType] = fp;
}
int32_t mnodeProcessRead(int msgType, void *pCont, int32_t contLen, SRspRet *ret) {
if (vnodeProcessReadMsgFp[msgType] == NULL)
return TSDB_CODE_MSG_NOT_PROCESSED;
if (pVnode->status == TAOS_VN_STATUS_DELETING || pVnode->status == TAOS_VN_STATUS_CLOSING)
return TSDB_CODE_NOT_ACTIVE_VNODE;
return (*vnodeProcessReadMsgFp[msgType])(pVnode, pCont, contLen, ret);
}
char *mgmtGetShowTypeStr(int32_t showType) {
char *mnodeGetShowType(int32_t showType) {
switch (showType) {
case TSDB_MGMT_TABLE_ACCT: return "show accounts";
case TSDB_MGMT_TABLE_USER: return "show users";
case TSDB_MGMT_TABLE_DB: return "show databases";
case TSDB_MGMT_TABLE_TABLE: return "show tables";
case TSDB_MGMT_TABLE_DNODE: return "show dnodes";
case TSDB_MGMT_TABLE_MNODE: return "show mnodes";
case TSDB_MGMT_TABLE_VGROUP: return "show vgroups";
case TSDB_MGMT_TABLE_METRIC: return "show stables";
case TSDB_MGMT_TABLE_MODULE: return "show modules";
case TSDB_MGMT_TABLE_QUERIES: return "show queries";
case TSDB_MGMT_TABLE_STREAMS: return "show streams";
case TSDB_MGMT_TABLE_CONFIGS: return "show configs";
case TSDB_MGMT_TABLE_CONNS: return "show connections";
case TSDB_MGMT_TABLE_SCORES: return "show scores";
case TSDB_MGMT_TABLE_GRANTS: return "show grants";
case TSDB_MGMT_TABLE_VNODES: return "show vnodes";
case TSDB_MNODE_TABLE_ACCT: return "show accounts";
case TSDB_MNODE_TABLE_USER: return "show users";
case TSDB_MNODE_TABLE_DB: return "show databases";
case TSDB_MNODE_TABLE_TABLE: return "show tables";
case TSDB_MNODE_TABLE_DNODE: return "show dnodes";
case TSDB_MNODE_TABLE_MNODE: return "show mnodes";
case TSDB_MNODE_TABLE_VGROUP: return "show vgroups";
case TSDB_MNODE_TABLE_METRIC: return "show stables";
case TSDB_MNODE_TABLE_MODULE: return "show modules";
case TSDB_MNODE_TABLE_QUERIES: return "show queries";
case TSDB_MNODE_TABLE_STREAMS: return "show streams";
case TSDB_MNODE_TABLE_CONFIGS: return "show configs";
case TSDB_MNODE_TABLE_CONNS: return "show connections";
case TSDB_MNODE_TABLE_SCORES: return "show scores";
case TSDB_MNODE_TABLE_GRANTS: return "show grants";
case TSDB_MNODE_TABLE_VNODES: return "show vnodes";
default: return "undefined";
}
}
static void mgmtProcessShowMsg(SMnodeMsg *pMsg) {
static void mnodeProcessShowMsg(SMnodeMsg *pMsg) {
SCMShowMsg *pShowMsg = pMsg->pCont;
if (pShowMsg->type >= TSDB_MGMT_TABLE_MAX) {
if (pShowMsg->type >= TSDB_MNODE_TABLE_MAX) {
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_INVALID_MSG_TYPE);
return;
}
if (!tsMnodeShowMetaFp[pShowMsg->type] || !tsMnodeShowRetrieveFp[pShowMsg->type]) {
mError("show type:%s is not support", mgmtGetShowTypeStr(pShowMsg->type));
mError("show type:%s is not support", mnodeGetShowType(pShowMsg->type));
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_OPS_NOT_SUPPORT);
return;
}
......@@ -141,7 +130,7 @@ static void mgmtProcessShowMsg(SMnodeMsg *pMsg) {
pShow = mgmtSaveQhandle(pShow, showObjSize);
pShowRsp->qhandle = htobe64((uint64_t) pShow);
mTrace("show:%p, type:%s, start to get meta", pShow, mgmtGetShowTypeStr(pShowMsg->type));
mTrace("show:%p, type:%s, start to get meta", pShow, mnodeGetShowType(pShowMsg->type));
int32_t code = (*tsMnodeShowMetaFp[pShowMsg->type])(&pShowRsp->tableMeta, pShow, pMsg->thandle);
if (code == 0) {
SRpcMsg rpcRsp = {
......@@ -152,7 +141,7 @@ static void mgmtProcessShowMsg(SMnodeMsg *pMsg) {
};
rpcSendResponse(&rpcRsp);
} else {
mError("show:%p, type:%s, failed to get meta, reason:%s", pShow, mgmtGetShowTypeStr(pShowMsg->type), tstrerror(code));
mError("show:%p, type:%s, failed to get meta, reason:%s", pShow, mnodeGetShowType(pShowMsg->type), tstrerror(code));
mgmtFreeQhandle(pShow, false);
SRpcMsg rpcRsp = {
.handle = pMsg->thandle,
......@@ -162,7 +151,7 @@ static void mgmtProcessShowMsg(SMnodeMsg *pMsg) {
}
}
static void mgmtProcessRetrieveMsg(SMnodeMsg *pMsg) {
static void mnodeProcessRetrieveMsg(SMnodeMsg *pMsg) {
int32_t rowsToRead = 0;
int32_t size = 0;
int32_t rowsRead = 0;
......@@ -180,7 +169,7 @@ static void mgmtProcessRetrieveMsg(SMnodeMsg *pMsg) {
}
SShowObj *pShow = (SShowObj *)pRetrieve->qhandle;
mTrace("show:%p, type:%s, retrieve data", pShow, mgmtGetShowTypeStr(pShow->type));
mTrace("show:%p, type:%s, retrieve data", pShow, mnodeGetShowType(pShow->type));
if ((pRetrieve->free & TSDB_QUERY_TYPE_FREE_RESOURCE) != TSDB_QUERY_TYPE_FREE_RESOURCE) {
rowsToRead = pShow->numOfRows - pShow->numOfReads;
......@@ -228,7 +217,7 @@ static void mgmtProcessRetrieveMsg(SMnodeMsg *pMsg) {
}
}
static void mgmtProcessHeartBeatMsg(SMnodeMsg *pMsg) {
static void mnodeProcessHeartBeatMsg(SMnodeMsg *pMsg) {
SCMHeartBeatRsp *pHBRsp = (SCMHeartBeatRsp *) rpcMallocCont(sizeof(SCMHeartBeatRsp));
if (pHBRsp == NULL) {
mgmtSendSimpleResp(pMsg->thandle, TSDB_CODE_SERV_OUT_OF_MEMORY);
......@@ -257,7 +246,7 @@ static void mgmtProcessHeartBeatMsg(SMnodeMsg *pMsg) {
rpcSendResponse(&rpcRsp);
}
static void mgmtProcessConnectMsg(SMnodeMsg *pMsg) {
static void mnodeProcessConnectMsg(SMnodeMsg *pMsg) {
SRpcMsg rpcRsp = {.handle = pMsg->thandle, .pCont = NULL, .contLen = 0, .code = 0, .msgType = 0};
SCMConnectMsg *pConnectMsg = pMsg->pCont;
......@@ -317,7 +306,7 @@ connect_over:
rpcSendResponse(&rpcRsp);
}
static void mgmtProcessUseMsg(SMnodeMsg *pMsg) {
static void mnodeProcessUseMsg(SMnodeMsg *pMsg) {
SRpcMsg rpcRsp = {.handle = pMsg->thandle, .pCont = NULL, .contLen = 0, .code = 0, .msgType = 0};
SCMUseDbMsg *pUseDbMsg = pMsg->pCont;
......@@ -413,7 +402,7 @@ void* mgmtSaveQhandle(void *qhandle, int32_t size) {
return NULL;
}
static void mgmtFreeShowObj(void *data) {
static void mnodeFreeShowObj(void *data) {
SShowObj *pShow = data;
sdbFreeIter(pShow->pIter);
mTrace("show:%p, is destroyed", pShow);
......
......@@ -26,19 +26,19 @@
#include "tglobal.h"
#include "hash.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtAcct.h"
#include "mgmtDb.h"
#include "mgmtDnode.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeAcct.h"
#include "mnodeDb.h"
#include "mnodeDnode.h"
#include "tgrant.h"
#include "mgmtMnode.h"
#include "mgmtProfile.h"
#include "mgmtSdb.h"
#include "mgmtShell.h"
#include "mgmtTable.h"
#include "mgmtUser.h"
#include "mgmtVgroup.h"
#include "mnodeMnode.h"
#include "mnodeProfile.h"
#include "mnodeSdb.h"
#include "mnodeShell.h"
#include "mnodeTable.h"
#include "mnodeUser.h"
#include "mnodeVgroup.h"
#include "tcompare.h"
#include "tdataformat.h"
......@@ -559,10 +559,10 @@ int32_t mgmtInitTables() {
dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_TABLE, mgmtProcessTableCfgMsg);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_TABLE, mgmtGetShowTableMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_TABLE, mgmtRetrieveShowTables);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_METRIC, mgmtGetShowSuperTableMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_METRIC, mgmtRetrieveShowSuperTables);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_TABLE, mgmtGetShowTableMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_TABLE, mgmtRetrieveShowTables);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_METRIC, mgmtGetShowSuperTableMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_METRIC, mgmtRetrieveShowSuperTables);
return TSDB_CODE_SUCCESS;
}
......
......@@ -22,13 +22,13 @@
#include "tgrant.h"
#include "tdataformat.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtAcct.h"
#include "mgmtMnode.h"
#include "mgmtSdb.h"
#include "mgmtShell.h"
#include "mgmtUser.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeAcct.h"
#include "mnodeMnode.h"
#include "mnodeSdb.h"
#include "mnodeShell.h"
#include "mnodeUser.h"
static void * tsUserSdb = NULL;
static int32_t tsUserUpdateSize = 0;
......@@ -139,8 +139,8 @@ int32_t mgmtInitUsers() {
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_CREATE_USER, mgmtProcessCreateUserMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_ALTER_USER, mgmtProcessAlterUserMsg);
mgmtAddShellMsgHandle(TSDB_MSG_TYPE_CM_DROP_USER, mgmtProcessDropUserMsg);
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_USER, mgmtGetUserMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_USER, mgmtRetrieveUsers);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_USER, mgmtGetUserMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_USER, mgmtRetrieveUsers);
dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_AUTH, mgmtProcessAuthMsg);
mTrace("table:%s, hash is created", tableDesc.tableName);
......
......@@ -25,16 +25,16 @@
#include "tglobal.h"
#include "dnode.h"
#include "tdataformat.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtDb.h"
#include "mgmtDnode.h"
#include "mgmtMnode.h"
#include "mgmtProfile.h"
#include "mgmtSdb.h"
#include "mgmtShell.h"
#include "mgmtTable.h"
#include "mgmtVgroup.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeDb.h"
#include "mnodeDnode.h"
#include "mnodeMnode.h"
#include "mnodeProfile.h"
#include "mnodeSdb.h"
#include "mnodeShell.h"
#include "mnodeTable.h"
#include "mnodeVgroup.h"
static void *tsVgroupSdb = NULL;
static int32_t tsVgUpdateSize = 0;
......@@ -220,8 +220,8 @@ int32_t mgmtInitVgroups() {
return -1;
}
mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_VGROUP, mgmtGetVgroupMeta);
mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_VGROUP, mgmtRetrieveVgroups);
mnodeAddShowMetaHandle(TSDB_MNODE_TABLE_VGROUP, mgmtGetVgroupMeta);
mnodeAddShowRetrieveHandle(TSDB_MNODE_TABLE_VGROUP, mgmtRetrieveVgroups);
dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mgmtProcessCreateVnodeRsp);
dnodeAddClientRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mgmtProcessDropVnodeRsp);
dnodeAddServerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mgmtProcessVnodeCfgMsg);
......
......@@ -22,18 +22,18 @@
#include "ttimer.h"
#include "tglobal.h"
#include "dnode.h"
#include "mgmtDef.h"
#include "mgmtInt.h"
#include "mgmtServer.h"
#include "mgmtAcct.h"
#include "mgmtDnode.h"
#include "mgmtMnode.h"
#include "mgmtDb.h"
#include "mgmtSdb.h"
#include "mgmtVgroup.h"
#include "mgmtUser.h"
#include "mgmtTable.h"
#include "mgmtShell.h"
#include "mnodeDef.h"
#include "mnodeInt.h"
#include "mnodeServer.h"
#include "mnodeAcct.h"
#include "mnodeDnode.h"
#include "mnodeMnode.h"
#include "mnodeDb.h"
#include "mnodeSdb.h"
#include "mnodeVgroup.h"
#include "mnodeUser.h"
#include "mnodeTable.h"
#include "mnodeShell.h"
static void (*tsMnodeProcessWriteMsgFp[TSDB_MSG_TYPE_MAX])(SMnodeMsg *);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册