Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0cf6de86
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
0cf6de86
编写于
6月 14, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
6月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13804 from taosdata/fix/mnode
enh: show db status such as creating and dropping
上级
2861534a
ad11eef9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
12 deletion
+15
-12
source/dnode/mnode/impl/src/mndDb.c
source/dnode/mnode/impl/src/mndDb.c
+14
-11
source/dnode/mnode/impl/src/mndMnode.c
source/dnode/mnode/impl/src/mndMnode.c
+1
-1
未找到文件。
source/dnode/mnode/impl/src/mndDb.c
浏览文件 @
0cf6de86
...
@@ -1366,7 +1366,7 @@ char *buildRetension(SArray *pRetension) {
...
@@ -1366,7 +1366,7 @@ char *buildRetension(SArray *pRetension) {
}
}
static
void
dumpDbInfoData
(
SSDataBlock
*
pBlock
,
SDbObj
*
pDb
,
SShowObj
*
pShow
,
int32_t
rows
,
int64_t
numOfTables
,
static
void
dumpDbInfoData
(
SSDataBlock
*
pBlock
,
SDbObj
*
pDb
,
SShowObj
*
pShow
,
int32_t
rows
,
int64_t
numOfTables
,
bool
sysDb
)
{
bool
sysDb
,
ESdbStatus
objStatus
)
{
int32_t
cols
=
0
;
int32_t
cols
=
0
;
int32_t
bytes
=
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
;
int32_t
bytes
=
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
;
...
@@ -1379,6 +1379,8 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1379,6 +1379,8 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
}
}
char
*
status
=
"ready"
;
char
*
status
=
"ready"
;
if
(
objStatus
==
SDB_STATUS_CREATING
)
status
=
"creating"
;
if
(
objStatus
==
SDB_STATUS_DROPPING
)
status
=
"dropping"
;
char
statusB
[
24
]
=
{
0
};
char
statusB
[
24
]
=
{
0
};
STR_WITH_SIZE_TO_VARSTR
(
statusB
,
status
,
strlen
(
status
));
STR_WITH_SIZE_TO_VARSTR
(
statusB
,
status
,
strlen
(
status
));
...
@@ -1503,8 +1505,8 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
...
@@ -1503,8 +1505,8 @@ static void dumpDbInfoData(SSDataBlock *pBlock, SDbObj *pDb, SShowObj *pShow, in
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
statusB
,
false
);
colDataAppend
(
pColInfo
,
rows
,
(
const
char
*
)
statusB
,
false
);
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// pColInfo = taosArrayGet(pBlock->pDataBlock, cols++);
// colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.schemaless, false);
// colDataAppend(pColInfo, rows, (const char *)&pDb->cfg.schemaless, false);
char
*
p
=
buildRetension
(
pDb
->
cfg
.
pRetensions
);
char
*
p
=
buildRetension
(
pDb
->
cfg
.
pRetensions
);
...
@@ -1548,29 +1550,30 @@ static bool mndGetTablesOfDbFp(SMnode *pMnode, void *pObj, void *p1, void *p2, v
...
@@ -1548,29 +1550,30 @@ static bool mndGetTablesOfDbFp(SMnode *pMnode, void *pObj, void *p1, void *p2, v
}
}
static
int32_t
mndRetrieveDbs
(
SRpcMsg
*
pReq
,
SShowObj
*
pShow
,
SSDataBlock
*
pBlock
,
int32_t
rowsCapacity
)
{
static
int32_t
mndRetrieveDbs
(
SRpcMsg
*
pReq
,
SShowObj
*
pShow
,
SSDataBlock
*
pBlock
,
int32_t
rowsCapacity
)
{
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SMnode
*
pMnode
=
pReq
->
info
.
node
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
SSdb
*
pSdb
=
pMnode
->
pSdb
;
int32_t
numOfRows
=
0
;
int32_t
numOfRows
=
0
;
SDbObj
*
pDb
=
NULL
;
SDbObj
*
pDb
=
NULL
;
ESdbStatus
objStatus
=
0
;
// Append the information_schema database into the result.
// Append the information_schema database into the result.
if
(
!
pShow
->
sysDbRsp
)
{
if
(
!
pShow
->
sysDbRsp
)
{
SDbObj
infoschemaDb
=
{
0
};
SDbObj
infoschemaDb
=
{
0
};
setInformationSchemaDbCfg
(
&
infoschemaDb
);
setInformationSchemaDbCfg
(
&
infoschemaDb
);
dumpDbInfoData
(
pBlock
,
&
infoschemaDb
,
pShow
,
numOfRows
,
14
,
true
);
dumpDbInfoData
(
pBlock
,
&
infoschemaDb
,
pShow
,
numOfRows
,
14
,
true
,
0
);
numOfRows
+=
1
;
numOfRows
+=
1
;
SDbObj
perfschemaDb
=
{
0
};
SDbObj
perfschemaDb
=
{
0
};
setPerfSchemaDbCfg
(
&
perfschemaDb
);
setPerfSchemaDbCfg
(
&
perfschemaDb
);
dumpDbInfoData
(
pBlock
,
&
perfschemaDb
,
pShow
,
numOfRows
,
3
,
true
);
dumpDbInfoData
(
pBlock
,
&
perfschemaDb
,
pShow
,
numOfRows
,
3
,
true
,
0
);
numOfRows
+=
1
;
numOfRows
+=
1
;
pShow
->
sysDbRsp
=
true
;
pShow
->
sysDbRsp
=
true
;
}
}
while
(
numOfRows
<
rowsCapacity
)
{
while
(
numOfRows
<
rowsCapacity
)
{
pShow
->
pIter
=
sdbFetch
(
pSdb
,
SDB_DB
,
pShow
->
pIter
,
(
void
**
)
&
pDb
);
pShow
->
pIter
=
sdbFetch
All
(
pSdb
,
SDB_DB
,
pShow
->
pIter
,
(
void
**
)
&
pDb
,
&
objStatus
);
if
(
pShow
->
pIter
==
NULL
)
{
if
(
pShow
->
pIter
==
NULL
)
{
break
;
break
;
}
}
...
@@ -1578,7 +1581,7 @@ static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
...
@@ -1578,7 +1581,7 @@ static int32_t mndRetrieveDbs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBloc
int32_t
numOfTables
=
0
;
int32_t
numOfTables
=
0
;
sdbTraverse
(
pSdb
,
SDB_VGROUP
,
mndGetTablesOfDbFp
,
&
numOfTables
,
NULL
,
NULL
);
sdbTraverse
(
pSdb
,
SDB_VGROUP
,
mndGetTablesOfDbFp
,
&
numOfTables
,
NULL
,
NULL
);
dumpDbInfoData
(
pBlock
,
pDb
,
pShow
,
numOfRows
,
numOfTables
,
false
);
dumpDbInfoData
(
pBlock
,
pDb
,
pShow
,
numOfRows
,
numOfTables
,
false
,
objStatus
);
numOfRows
++
;
numOfRows
++
;
sdbRelease
(
pSdb
,
pDb
);
sdbRelease
(
pSdb
,
pDb
);
}
}
...
...
source/dnode/mnode/impl/src/mndMnode.c
浏览文件 @
0cf6de86
...
@@ -659,7 +659,7 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
...
@@ -659,7 +659,7 @@ static int32_t mndRetrieveMnodes(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
int32_t
numOfRows
=
0
;
int32_t
numOfRows
=
0
;
int32_t
cols
=
0
;
int32_t
cols
=
0
;
SMnodeObj
*
pObj
=
NULL
;
SMnodeObj
*
pObj
=
NULL
;
ESdbStatus
objStatus
;
ESdbStatus
objStatus
=
0
;
char
*
pWrite
;
char
*
pWrite
;
int64_t
curMs
=
taosGetTimestampMs
();
int64_t
curMs
=
taosGetTimestampMs
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录