From 1b3b9ca349ce4b9af0929b569391ee783dab4eb8 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 29 Nov 2022 15:54:02 +0800 Subject: [PATCH] feat(mnode) : auto tab add show status command --- src/kit/shell/src/shellAuto.c | 6 ++++++ src/mnode/src/mnodeVgroup.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/kit/shell/src/shellAuto.c b/src/kit/shell/src/shellAuto.c index 448bb5217e..3b4094bbb8 100644 --- a/src/kit/shell/src/shellAuto.c +++ b/src/kit/shell/src/shellAuto.c @@ -105,11 +105,13 @@ SWords shellCommands[] = { {"select current_user();", 0, 0, NULL}, {"select database;", 0, 0, NULL}, {"select server_version();", 0, 0, NULL}, + {"select server_status();", 0, 0, NULL}, {"set max_binary_display_width ", 0, 0, NULL}, {"show create database \\G;", 0, 0, NULL}, {"show create stable \\G;", 0, 0, NULL}, {"show create table \\G;", 0, 0, NULL}, {"show connections;", 0, 0, NULL}, + {"show cluster status;", 0, 0, NULL}, {"show databases;", 0, 0, NULL}, {"show dnodes;", 0, 0, NULL}, {"show functions;", 0, 0, NULL}, @@ -125,6 +127,7 @@ SWords shellCommands[] = { {"show users;", 0, 0, NULL}, {"show variables;", 0, 0, NULL}, {"show vgroups;", 0, 0, NULL}, + {"show .status;", 0, 0, NULL}, {"insert into values(", 0, 0, NULL}, {"insert into using tags( ) values(", 0, 0, NULL}, {"insert into using values(", 0, 0, NULL}, @@ -401,7 +404,9 @@ void showHelp() { select current_user();\n\ select database;\n\ select server_version();\n\ + select server_status();\n\ set max_binary_display_width ; \n\ + show cluster status;\n\ show create database ;\n\ show create stable ;\n\ show create table ;\n\ @@ -421,6 +426,7 @@ void showHelp() { show users;\n\ show variables;\n\ show vgroups;\n\ + show .status;\n\ ----- I ----- \n\ insert into values(...) ;\n\ ----- U ----- \n\ diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index d574ffd4fd..efc5ef9524 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -58,6 +58,10 @@ static int32_t tsVgUpdateSize = 0; static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup); static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn); static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, void *pConn); +// status +static int32_t mnodeGetStatusMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn); +static int32_t mnodeRetrieveStatus(SShowObj *pShow, char *data, int32_t rows, void *pConn); + static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg); static void mnodeProcessAlterVnodeRsp(SRpcMsg *rpcMsg); static void mnodeProcessCompactVnodeRsp(SRpcMsg *rpcMsg); -- GitLab