Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
aa4a5ad0
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看板
提交
aa4a5ad0
编写于
12月 28, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
catalog get table meta from mnode
上级
1219747e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
2 deletion
+42
-2
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+40
-2
source/libs/qcom/src/querymsg.c
source/libs/qcom/src/querymsg.c
+2
-0
未找到文件。
source/libs/catalog/src/catalog.c
浏览文件 @
aa4a5ad0
...
...
@@ -146,8 +146,44 @@ void ctgGenEpSet(SEpSet *epSet, SVgroupInfo *vgroupInfo) {
}
}
int32_t
ctgGetTableMetaFromMnode
(
struct
SCatalog
*
pCatalog
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
const
char
*
pTableName
,
STableMetaOutput
*
output
)
{
if
(
NULL
==
pCatalog
||
NULL
==
pRpc
||
NULL
==
pMgmtEps
||
NULL
==
pDBName
||
NULL
==
pTableName
||
NULL
==
output
)
{
CTG_ERR_RET
(
TSDB_CODE_CTG_INVALID_INPUT
);
}
char
tbFullName
[
TSDB_TABLE_FNAME_LEN
];
snprintf
(
tbFullName
,
sizeof
(
tbFullName
),
"%s.%s"
,
pDBName
,
pTableName
);
SBuildTableMetaInput
bInput
=
{.
vgId
=
0
,
.
tableFullName
=
tbFullName
};
char
*
msg
=
NULL
;
SEpSet
*
pVnodeEpSet
=
NULL
;
int32_t
msgLen
=
0
;
CTG_ERR_RET
(
queryBuildMsg
[
TDMT_MND_STB_META
](
&
bInput
,
&
msg
,
0
,
&
msgLen
));
SRpcMsg
rpcMsg
=
{
.
msgType
=
TDMT_MND_STB_META
,
.
pCont
=
msg
,
.
contLen
=
msgLen
,
};
int32_t
ctgGetTableMetaFromMnode
(
struct
SCatalog
*
pCatalog
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
const
char
*
pTableName
,
SVgroupInfo
*
vgroupInfo
,
STableMetaOutput
*
output
)
{
SRpcMsg
rpcRsp
=
{
0
};
rpcSendRecv
(
pRpc
,
(
SEpSet
*
)
pMgmtEps
,
&
rpcMsg
,
&
rpcRsp
);
if
(
TSDB_CODE_SUCCESS
!=
rpcRsp
.
code
)
{
ctgError
(
"error rsp for table meta, code:%x"
,
rpcRsp
.
code
);
CTG_ERR_RET
(
rpcRsp
.
code
);
}
CTG_ERR_RET
(
queryProcessMsgRsp
[
TDMT_MND_STB_META
](
output
,
rpcRsp
.
pCont
,
rpcRsp
.
contLen
));
return
TSDB_CODE_SUCCESS
;
}
int32_t
ctgGetTableMetaFromVnode
(
struct
SCatalog
*
pCatalog
,
void
*
pRpc
,
const
SEpSet
*
pMgmtEps
,
const
char
*
pDBName
,
const
char
*
pTableName
,
SVgroupInfo
*
vgroupInfo
,
STableMetaOutput
*
output
)
{
if
(
NULL
==
pCatalog
||
NULL
==
pRpc
||
NULL
==
pMgmtEps
||
NULL
==
pDBName
||
NULL
==
pTableName
||
NULL
==
vgroupInfo
||
NULL
==
output
)
{
CTG_ERR_RET
(
TSDB_CODE_CTG_INVALID_INPUT
);
}
...
...
@@ -515,7 +551,9 @@ int32_t catalogRenewTableMeta(struct SCatalog* pCatalog, void *pRpc, const SEpSe
STableMetaOutput
output
=
{
0
};
CTG_ERR_RET
(
ctgGetTableMetaFromMnode
(
pCatalog
,
pRpc
,
pMgmtEps
,
pDBName
,
pTableName
,
&
vgroupInfo
,
&
output
));
//CTG_ERR_RET(ctgGetTableMetaFromVnode(pCatalog, pRpc, pMgmtEps, pDBName, pTableName, &vgroupInfo, &output));
CTG_ERR_RET
(
ctgGetTableMetaFromMnode
(
pCatalog
,
pRpc
,
pMgmtEps
,
pDBName
,
pTableName
,
&
output
));
CTG_ERR_RET
(
ctgUpdateTableMetaCache
(
pCatalog
,
&
output
));
...
...
source/libs/qcom/src/querymsg.c
浏览文件 @
aa4a5ad0
...
...
@@ -266,9 +266,11 @@ int32_t queryProcessTableMetaRsp(void* output, char *msg, int32_t msgSize) {
void
initQueryModuleMsgHandle
()
{
queryBuildMsg
[
TDMT_VND_TABLE_META
]
=
queryBuildTableMetaReqMsg
;
queryBuildMsg
[
TDMT_MND_STB_META
]
=
queryBuildTableMetaReqMsg
;
queryBuildMsg
[
TDMT_MND_USE_DB
]
=
queryBuildUseDbMsg
;
queryProcessMsgRsp
[
TDMT_VND_TABLE_META
]
=
queryProcessTableMetaRsp
;
queryProcessMsgRsp
[
TDMT_MND_STB_META
]
=
queryProcessTableMetaRsp
;
queryProcessMsgRsp
[
TDMT_MND_USE_DB
]
=
queryProcessUseDBRsp
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录