Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6c723559
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看板
提交
6c723559
编写于
10月 06, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10529] add query module APIs.
上级
3f593dc8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
100 addition
and
1 deletion
+100
-1
include/libs/catalog/catalog.h
include/libs/catalog/catalog.h
+90
-0
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+7
-0
source/libs/catalog/src/catalog.c
source/libs/catalog/src/catalog.c
+3
-1
未找到文件。
include/libs/catalog/catalog.h
浏览文件 @
6c723559
...
...
@@ -20,6 +20,96 @@
extern
"C"
{
#endif
#include "os.h"
#include "thash.h"
#include "tarray.h"
#include "taosdef.h"
#include "transport.h"
struct
SCatalog
;
typedef
struct
SMetaReq
{
char
clusterId
[
TSDB_CLUSTER_ID_LEN
];
SArray
*
pTableName
;
// table full name
SArray
*
pVgroup
;
// vgroup id
SArray
*
pUdf
;
// udf name
bool
qNodeEpset
;
// valid qnode
}
SMetaReq
;
typedef
struct
SMetaData
{
SArray
*
pTableMeta
;
// tableMeta
SArray
*
pVgroupInfo
;
// vgroupInfo list
SArray
*
pUdfList
;
// udf info list
SEpSet
*
pEpSet
;
// qnode epset list
}
SMetaData
;
typedef
struct
STableComInfo
{
uint8_t
numOfTags
;
// the number of tags in schema
uint8_t
precision
;
// the number of precision
int16_t
numOfColumns
;
// the number of columns
int32_t
rowSize
;
// row size of the schema
}
STableComInfo
;
/*
* ASSERT(sizeof(SCTableMeta) == 24)
* ASSERT(tableType == TSDB_CHILD_TABLE)
* The cached child table meta info. For each child table, 24 bytes are required to keep the essential table info.
*/
typedef
struct
SCTableMeta
{
int32_t
vgId
:
24
;
int8_t
tableType
;
uint32_t
tid
;
uint64_t
uid
;
uint64_t
suid
;
}
SCTableMeta
;
typedef
struct
SSchema
{
uint8_t
type
;
char
name
[
TSDB_COL_NAME_LEN
];
int16_t
colId
;
int16_t
bytes
;
}
SSchema
;
/*
* Note that the first 24 bytes of STableMeta are identical to SCTableMeta, it is safe to cast a STableMeta to be a SCTableMeta.
*/
typedef
struct
STableMeta
{
int32_t
vgId
:
24
;
int8_t
tableType
;
uint32_t
tid
;
uint64_t
uid
;
uint64_t
suid
;
// if the table is TSDB_CHILD_TABLE, the following information is acquired from the corresponding super table meta info
int16_t
sversion
;
int16_t
tversion
;
STableComInfo
tableInfo
;
SSchema
schema
[];
}
STableMeta
;
/**
* Catalog service object, which is utilized to hold tableMeta (meta/vgroupInfo/udfInfo) at the client-side.
* There is ONLY one SCatalog object for one process space, and this function returns a singleton.
* @param pMgmtEps
* @return
*/
struct
SCatalog
*
getCatalogHandle
(
const
SEpSet
*
pMgmtEps
);
/**
* Get the required meta data from mnode.
* Note that this is a synchronized API and is also thread-safety.
* @param pCatalog
* @param pMetaReq
* @param pMetaData
* @return
*/
int32_t
catalogGetMetaData
(
struct
SCatalog
*
pCatalog
,
const
SMetaReq
*
pMetaReq
,
SMetaData
*
pMetaData
);
/**
* Destroy catalog service handle
* @param pCatalog
*/
void
destroyCatalog
(
struct
SCatalog
*
pCatalog
);
#ifdef __cplusplus
}
#endif
...
...
source/libs/catalog/inc/catalogInt.h
浏览文件 @
6c723559
...
...
@@ -20,6 +20,13 @@
extern
"C"
{
#endif
#include "catalog.h"
typedef
struct
SCatalog
{
void
*
pMsgSender
;
// used to send messsage to mnode to fetch necessary metadata
SHashObj
*
pData
;
// items cached for each cluster, the hash key is the cluster-id, returned by mgmt node
}
SCatalog
;
#ifdef __cplusplus
}
#endif
...
...
source/libs/catalog/src/catalog.c
浏览文件 @
6c723559
...
...
@@ -11,4 +11,6 @@
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
\ No newline at end of file
*/
#include "catalogInt.h"
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录