Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
555a99bf
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
555a99bf
编写于
9月 26, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: dump sdb info from mnode
上级
1cbd1f4c
变更
9
展开全部
隐藏空白更改
内联
并排
Showing
9 changed file
with
692 addition
and
31 deletion
+692
-31
include/dnode/mnode/mnode.h
include/dnode/mnode/mnode.h
+2
-0
source/dnode/mgmt/exe/dmMain.c
source/dnode/mgmt/exe/dmMain.c
+12
-0
source/dnode/mnode/impl/inc/mndStb.h
source/dnode/mnode/impl/inc/mndStb.h
+2
-0
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+9
-7
source/dnode/mnode/impl/src/mndDump.c
source/dnode/mnode/impl/src/mndDump.c
+645
-0
source/dnode/mnode/impl/src/mndFunc.c
source/dnode/mnode/impl/src/mndFunc.c
+9
-7
source/dnode/mnode/impl/src/mndStb.c
source/dnode/mnode/impl/src/mndStb.c
+11
-0
source/dnode/mnode/sdb/src/sdbHash.c
source/dnode/mnode/sdb/src/sdbHash.c
+2
-0
utils/test/c/CMakeLists.txt
utils/test/c/CMakeLists.txt
+0
-17
未找到文件。
include/dnode/mnode/mnode.h
浏览文件 @
555a99bf
...
...
@@ -106,6 +106,8 @@ void mndPostProcessQueryMsg(SRpcMsg *pMsg);
*/
void
mndGenerateMachineCode
();
void
mndDumpSdb
();
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mgmt/exe/dmMain.c
浏览文件 @
555a99bf
...
...
@@ -16,6 +16,7 @@
#define _DEFAULT_SOURCE
#include "dmMgmt.h"
#include "tconfig.h"
#include "mnode.h"
#define DM_APOLLO_URL "The apollo string to use when configuring the server, such as: -a 'jsonFile:./tests/cfg.json', cfg.json text can be '{\"fqdn\":\"td1\"}'."
#define DM_CFG_DIR "Configuration directory."
...
...
@@ -31,6 +32,7 @@ static struct {
bool
winServiceMode
;
#endif
bool
dumpConfig
;
bool
dumpSdb
;
bool
generateGrant
;
bool
printAuth
;
bool
printVersion
;
...
...
@@ -82,6 +84,8 @@ static int32_t dmParseArgs(int32_t argc, char const *argv[]) {
}
}
else
if
(
strcmp
(
argv
[
i
],
"-a"
)
==
0
)
{
tstrncpy
(
global
.
apolloUrl
,
argv
[
++
i
],
PATH_MAX
);
}
else
if
(
strcmp
(
argv
[
i
],
"-s"
)
==
0
)
{
global
.
dumpSdb
=
true
;
}
else
if
(
strcmp
(
argv
[
i
],
"-E"
)
==
0
)
{
tstrncpy
(
global
.
envFile
,
argv
[
++
i
],
PATH_MAX
);
}
else
if
(
strcmp
(
argv
[
i
],
"-n"
)
==
0
)
{
...
...
@@ -229,6 +233,14 @@ int mainWindows(int argc,char** argv) {
return
0
;
}
if
(
global
.
dumpSdb
)
{
mndDumpSdb
();
taosCleanupCfg
();
taosCloseLog
();
taosCleanupArgs
();
return
0
;
}
dmSetProcInfo
(
argc
,
(
char
**
)
argv
);
taosCleanupArgs
();
...
...
source/dnode/mnode/impl/inc/mndStb.h
浏览文件 @
555a99bf
...
...
@@ -40,6 +40,8 @@ int32_t mndBuildSMCreateStbRsp(SMnode *pMnode, char* dbFName, char* stbFName, vo
void
mndExtractDbNameFromStbFullName
(
const
char
*
stbFullName
,
char
*
dst
);
void
mndExtractTbNameFromStbFullName
(
const
char
*
stbFullName
,
char
*
dst
,
int32_t
dstSize
);
const
char
*
mndGetStbStr
(
const
char
*
src
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
555a99bf
...
...
@@ -54,13 +54,15 @@ static int32_t mndProcessConsumerLostMsg(SRpcMsg *pMsg);
static
int32_t
mndProcessConsumerRecoverMsg
(
SRpcMsg
*
pMsg
);
int32_t
mndInitConsumer
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{.
sdbType
=
SDB_CONSUMER
,
.
keyType
=
SDB_KEY_INT64
,
.
encodeFp
=
(
SdbEncodeFp
)
mndConsumerActionEncode
,
.
decodeFp
=
(
SdbDecodeFp
)
mndConsumerActionDecode
,
.
insertFp
=
(
SdbInsertFp
)
mndConsumerActionInsert
,
.
updateFp
=
(
SdbUpdateFp
)
mndConsumerActionUpdate
,
.
deleteFp
=
(
SdbDeleteFp
)
mndConsumerActionDelete
};
SSdbTable
table
=
{
.
sdbType
=
SDB_CONSUMER
,
.
keyType
=
SDB_KEY_INT64
,
.
encodeFp
=
(
SdbEncodeFp
)
mndConsumerActionEncode
,
.
decodeFp
=
(
SdbDecodeFp
)
mndConsumerActionDecode
,
.
insertFp
=
(
SdbInsertFp
)
mndConsumerActionInsert
,
.
updateFp
=
(
SdbUpdateFp
)
mndConsumerActionUpdate
,
.
deleteFp
=
(
SdbDeleteFp
)
mndConsumerActionDelete
,
};
mndSetMsgHandle
(
pMnode
,
TDMT_MND_SUBSCRIBE
,
mndProcessSubscribeReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_MQ_HB
,
mndProcessMqHbReq
);
...
...
utils/test/c/sdb
Dump.c
→
source/dnode/mnode/impl/src/mnd
Dump.c
浏览文件 @
555a99bf
此差异已折叠。
点击以展开。
source/dnode/mnode/impl/src/mndFunc.c
浏览文件 @
555a99bf
...
...
@@ -38,13 +38,15 @@ static int32_t mndRetrieveFuncs(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pB
static
void
mndCancelGetNextFunc
(
SMnode
*
pMnode
,
void
*
pIter
);
int32_t
mndInitFunc
(
SMnode
*
pMnode
)
{
SSdbTable
table
=
{.
sdbType
=
SDB_FUNC
,
.
keyType
=
SDB_KEY_BINARY
,
.
encodeFp
=
(
SdbEncodeFp
)
mndFuncActionEncode
,
.
decodeFp
=
(
SdbDecodeFp
)
mndFuncActionDecode
,
.
insertFp
=
(
SdbInsertFp
)
mndFuncActionInsert
,
.
updateFp
=
(
SdbUpdateFp
)
mndFuncActionUpdate
,
.
deleteFp
=
(
SdbDeleteFp
)
mndFuncActionDelete
};
SSdbTable
table
=
{
.
sdbType
=
SDB_FUNC
,
.
keyType
=
SDB_KEY_BINARY
,
.
encodeFp
=
(
SdbEncodeFp
)
mndFuncActionEncode
,
.
decodeFp
=
(
SdbDecodeFp
)
mndFuncActionDecode
,
.
insertFp
=
(
SdbInsertFp
)
mndFuncActionInsert
,
.
updateFp
=
(
SdbUpdateFp
)
mndFuncActionUpdate
,
.
deleteFp
=
(
SdbDeleteFp
)
mndFuncActionDelete
,
};
mndSetMsgHandle
(
pMnode
,
TDMT_MND_CREATE_FUNC
,
mndProcessCreateFuncReq
);
mndSetMsgHandle
(
pMnode
,
TDMT_MND_DROP_FUNC
,
mndProcessDropFuncReq
);
...
...
source/dnode/mnode/impl/src/mndStb.c
浏览文件 @
555a99bf
...
...
@@ -2579,3 +2579,14 @@ static void mndCancelGetNextStb(SMnode *pMnode, void *pIter) {
SSdb
*
pSdb
=
pMnode
->
pSdb
;
sdbCancelFetch
(
pSdb
,
pIter
);
}
const
char
*
mndGetStbStr
(
const
char
*
src
)
{
char
*
posDb
=
strstr
(
src
,
TS_PATH_DELIMITER
);
if
(
posDb
!=
NULL
)
++
posDb
;
if
(
posDb
==
NULL
)
return
src
;
char
*
posStb
=
strstr
(
posDb
,
TS_PATH_DELIMITER
);
if
(
posStb
!=
NULL
)
++
posStb
;
if
(
posStb
==
NULL
)
return
posDb
;
return
posStb
;
}
\ No newline at end of file
source/dnode/mnode/sdb/src/sdbHash.c
浏览文件 @
555a99bf
...
...
@@ -40,6 +40,8 @@ const char *sdbTableName(ESdbType type) {
return
"auth"
;
case
SDB_ACCT
:
return
"acct"
;
case
SDB_STREAM_CK
:
return
"stream_ck"
;
case
SDB_STREAM
:
return
"stream"
;
case
SDB_OFFSET
:
...
...
utils/test/c/CMakeLists.txt
浏览文件 @
555a99bf
...
...
@@ -40,20 +40,3 @@ target_link_libraries(
PUBLIC common
PUBLIC os
)
add_executable
(
sdbDump sdbDump.c
)
target_link_libraries
(
sdbDump
PUBLIC dnode
PUBLIC mnode
PUBLIC stream
PUBLIC sdb
PUBLIC os
)
target_include_directories
(
sdbDump
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/dnode/mnode"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mnode/impl/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mnode/sdb/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/dnode/mgmt/node_mgmt/inc"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录