Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8c4b73a3
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看板
提交
8c4b73a3
编写于
4月 24, 2023
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: add get table tag sync API
上级
24aff3d6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
59 addition
and
0 deletion
+59
-0
include/libs/catalog/catalog.h
include/libs/catalog/catalog.h
+2
-0
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+57
-0
未找到文件。
include/libs/catalog/catalog.h
浏览文件 @
8c4b73a3
...
@@ -314,6 +314,8 @@ int32_t catalogGetIndexMeta(SCatalog* pCtg, SRequestConnInfo* pConn, const char*
...
@@ -314,6 +314,8 @@ int32_t catalogGetIndexMeta(SCatalog* pCtg, SRequestConnInfo* pConn, const char*
int32_t
catalogGetTableIndex
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
SName
*
pTableName
,
SArray
**
pRes
);
int32_t
catalogGetTableIndex
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
SName
*
pTableName
,
SArray
**
pRes
);
int32_t
catalogGetTableTag
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
SName
*
pTableName
,
SArray
**
pRes
);
int32_t
catalogRefreshGetTableCfg
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
SName
*
pTableName
,
STableCfg
**
pCfg
);
int32_t
catalogRefreshGetTableCfg
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
SName
*
pTableName
,
STableCfg
**
pCfg
);
int32_t
catalogUpdateTableIndex
(
SCatalog
*
pCtg
,
STableIndexRsp
*
pRsp
);
int32_t
catalogUpdateTableIndex
(
SCatalog
*
pCtg
,
STableIndexRsp
*
pRsp
);
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
8c4b73a3
...
@@ -429,6 +429,48 @@ int32_t ctgGetTbCfg(SCatalog* pCtg, SRequestConnInfo* pConn, SName* pTableName,
...
@@ -429,6 +429,48 @@ int32_t ctgGetTbCfg(SCatalog* pCtg, SRequestConnInfo* pConn, SName* pTableName,
CTG_RET
(
TSDB_CODE_SUCCESS
);
CTG_RET
(
TSDB_CODE_SUCCESS
);
}
}
int32_t
ctgGetTbTag
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
SName
*
pTableName
,
SArray
**
pRes
)
{
SVgroupInfo
vgroupInfo
=
{
0
};
STableCfg
*
pCfg
=
NULL
;
int32_t
code
=
0
;
CTG_ERR_RET
(
ctgGetTbHashVgroup
(
pCtg
,
pConn
,
pTableName
,
&
vgroupInfo
,
NULL
));
CTG_ERR_RET
(
ctgGetTableCfgFromVnode
(
pCtg
,
pConn
,
pTableName
,
&
vgroupInfo
,
&
pCfg
,
NULL
));
if
(
NULL
==
pCfg
->
pTags
||
pCfg
->
tagsLen
<=
0
)
{
ctgError
(
"invalid tag in tbCfg rsp, pTags:%p, len:%d"
,
pCfg
->
pTags
,
pCfg
->
tagsLen
);
CTG_ERR_JRET
(
TSDB_CODE_INVALID_MSG
);
}
SArray
*
pTagVals
=
NULL
;
STag
*
pTag
=
(
STag
*
)
pCfg
->
pTags
;
if
(
tTagIsJson
(
pTag
))
{
pTagVals
=
taosArrayInit
(
1
,
sizeof
(
STagVal
));
if
(
NULL
==
pTagVals
)
{
CTG_ERR_JRET
(
TSDB_CODE_OUT_OF_MEMORY
);
}
char
*
pJson
=
parseTagDatatoJson
(
pTag
);
STagVal
tagVal
;
tagVal
.
cid
=
0
;
tagVal
.
type
=
TSDB_DATA_TYPE_JSON
;
tagVal
.
pData
=
pJson
;
tagVal
.
nData
=
strlen
(
pJson
);
taosArrayPush
(
pTagVals
,
&
tagVal
);
}
else
{
CTG_ERR_JRET
(
tTagToValArray
((
const
STag
*
)
pCfg
->
pTags
,
&
pTagVals
));
}
*
pRes
=
pTagVals
;
_return:
tFreeSTableCfgRsp
((
STableCfgRsp
*
)
pCfg
);
CTG_RET
(
code
);
}
int32_t
ctgGetTbDistVgInfo
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
SName
*
pTableName
,
SArray
**
pVgList
)
{
int32_t
ctgGetTbDistVgInfo
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
SName
*
pTableName
,
SArray
**
pVgList
)
{
STableMeta
*
tbMeta
=
NULL
;
STableMeta
*
tbMeta
=
NULL
;
int32_t
code
=
0
;
int32_t
code
=
0
;
...
@@ -1414,6 +1456,21 @@ _return:
...
@@ -1414,6 +1456,21 @@ _return:
CTG_API_LEAVE
(
code
);
CTG_API_LEAVE
(
code
);
}
}
int32_t
catalogGetTableTag
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
SName
*
pTableName
,
SArray
**
pRes
)
{
CTG_API_ENTER
();
if
(
NULL
==
pCtg
||
NULL
==
pConn
||
NULL
==
pTableName
||
NULL
==
pRes
)
{
CTG_API_LEAVE
(
TSDB_CODE_CTG_INVALID_INPUT
);
}
int32_t
code
=
0
;
CTG_ERR_JRET
(
ctgGetTbTag
(
pCtg
,
pConn
,
(
SName
*
)
pTableName
,
pRes
));
_return:
CTG_API_LEAVE
(
code
);
}
int32_t
catalogRefreshGetTableCfg
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
SName
*
pTableName
,
STableCfg
**
pCfg
)
{
int32_t
catalogRefreshGetTableCfg
(
SCatalog
*
pCtg
,
SRequestConnInfo
*
pConn
,
const
SName
*
pTableName
,
STableCfg
**
pCfg
)
{
CTG_API_ENTER
();
CTG_API_ENTER
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录