Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a60e9e40
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
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看板
提交
a60e9e40
编写于
12月 25, 2021
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more
上级
455006cc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
158 addition
and
24 deletion
+158
-24
include/common/taosdef.h
include/common/taosdef.h
+20
-22
include/common/tmsg.h
include/common/tmsg.h
+126
-0
include/common/tmsgdef.h
include/common/tmsgdef.h
+1
-1
include/dnode/vnode/meta/meta.h
include/dnode/vnode/meta/meta.h
+0
-1
include/util/tcoding.h
include/util/tcoding.h
+11
-0
未找到文件。
include/common/taosdef.h
浏览文件 @
a60e9e40
...
...
@@ -20,36 +20,38 @@
extern
"C"
{
#endif
#include "tdef.h"
#include "taos.h"
#include "tdef.h"
#define TSWINDOW_INITIALIZER ((STimeWindow) {INT64_MIN, INT64_MAX})
#define TSWINDOW_DESC_INITIALIZER ((STimeWindow) {INT64_MAX, INT64_MIN})
typedef
uint64_t
tb_uid_t
;
#define TSWINDOW_INITIALIZER ((STimeWindow){INT64_MIN, INT64_MAX})
#define TSWINDOW_DESC_INITIALIZER ((STimeWindow){INT64_MAX, INT64_MIN})
#define IS_TSWINDOW_SPECIFIED(win) (((win).skey != INT64_MIN) || ((win).ekey != INT64_MAX))
typedef
enum
{
TAOS_QTYPE_RPC
=
1
,
TAOS_QTYPE_FWD
=
2
,
TAOS_QTYPE_WAL
=
3
,
TAOS_QTYPE_CQ
=
4
,
TAOS_QTYPE_RPC
=
1
,
TAOS_QTYPE_FWD
=
2
,
TAOS_QTYPE_WAL
=
3
,
TAOS_QTYPE_CQ
=
4
,
TAOS_QTYPE_QUERY
=
5
}
EQType
;
typedef
enum
{
TSDB_SUPER_TABLE
=
1
,
// super table
TSDB_CHILD_TABLE
=
2
,
// table created from super table
TSDB_NORMAL_TABLE
=
3
,
// ordinary table
TSDB_STREAM_TABLE
=
4
,
// table created from stream computing
TSDB_TEMP_TABLE
=
5
,
// temp table created by nest query
TSDB_TABLE_MAX
=
6
TSDB_SUPER_TABLE
=
1
,
// super table
TSDB_CHILD_TABLE
=
2
,
// table created from super table
TSDB_NORMAL_TABLE
=
3
,
// ordinary table
TSDB_STREAM_TABLE
=
4
,
// table created from stream computing
TSDB_TEMP_TABLE
=
5
,
// temp table created by nest query
TSDB_TABLE_MAX
=
6
}
ETableType
;
typedef
enum
{
TSDB_MOD_MNODE
=
1
,
TSDB_MOD_HTTP
=
2
,
TSDB_MOD_MNODE
=
1
,
TSDB_MOD_HTTP
=
2
,
TSDB_MOD_MONITOR
=
3
,
TSDB_MOD_MQTT
=
4
,
TSDB_MOD_MAX
=
5
TSDB_MOD_MQTT
=
4
,
TSDB_MOD_MAX
=
5
}
EModuleType
;
typedef
enum
{
...
...
@@ -64,11 +66,7 @@ typedef enum {
TSDB_CHECK_ITEM_MAX
}
ECheckItemType
;
typedef
enum
{
TD_ROW_DISCARD_UPDATE
=
0
,
TD_ROW_OVERWRITE_UPDATE
=
1
,
TD_ROW_PARTIAL_UPDATE
=
2
}
TDUpdateConfig
;
typedef
enum
{
TD_ROW_DISCARD_UPDATE
=
0
,
TD_ROW_OVERWRITE_UPDATE
=
1
,
TD_ROW_PARTIAL_UPDATE
=
2
}
TDUpdateConfig
;
extern
char
*
qtypeStr
[];
...
...
include/common/tmsg.h
浏览文件 @
a60e9e40
...
...
@@ -22,6 +22,7 @@ extern "C" {
#include "taosdef.h"
#include "taoserror.h"
#include "tcoding.h"
#include "tdataformat.h"
#define TD_MSG_NUMBER_
...
...
@@ -1096,6 +1097,131 @@ typedef struct {
uint64_t
tuid
;
}
SDropTopicInternalMsg
;
typedef
struct
SVCreateTbReq
{
uint64_t
ver
;
// use a general definition
char
*
name
;
uint32_t
ttl
;
uint32_t
keep
;
#define TD_SUPER_TABLE 0
#define TD_CHILD_TABLE 1
#define TD_NORMAL_TABLE 2
uint8_t
type
;
union
{
struct
{
tb_uid_t
suid
;
uint32_t
nCols
;
SSchema
*
pSchema
;
uint32_t
nTagCols
;
SSchema
*
pTagSchema
;
}
stbCfg
;
struct
{
tb_uid_t
suid
;
SKVRow
pTag
;
}
ctbCfg
;
struct
{
uint32_t
nCols
;
SSchema
*
pSchema
;
}
ntbCfg
;
};
}
SVCreateTbReq
;
static
FORCE_INLINE
int
tSerializeSVCreateTbReq
(
void
**
buf
,
const
SVCreateTbReq
*
pReq
)
{
int
tlen
=
0
;
tlen
+=
taosEncodeFixedU64
(
buf
,
pReq
->
ver
);
tlen
+=
taosEncodeString
(
buf
,
pReq
->
name
);
tlen
+=
taosEncodeFixedU32
(
buf
,
pReq
->
ttl
);
tlen
+=
taosEncodeFixedU32
(
buf
,
pReq
->
keep
);
tlen
+=
taosEncodeFixedU8
(
buf
,
pReq
->
type
);
switch
(
pReq
->
type
)
{
case
TD_SUPER_TABLE
:
tlen
+=
taosEncodeFixedU64
(
buf
,
pReq
->
stbCfg
.
suid
);
tlen
+=
taosEncodeFixedU32
(
buf
,
pReq
->
stbCfg
.
nCols
);
for
(
uint32_t
i
=
0
;
i
<
pReq
->
stbCfg
.
nCols
;
i
++
)
{
tlen
+=
taosEncodeFixedI8
(
buf
,
pReq
->
stbCfg
.
pSchema
[
i
].
type
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pReq
->
stbCfg
.
pSchema
[
i
].
colId
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pReq
->
stbCfg
.
pSchema
[
i
].
bytes
);
tlen
+=
taosEncodeString
(
buf
,
pReq
->
stbCfg
.
pSchema
[
i
].
name
);
}
tlen
+=
taosEncodeFixedU32
(
buf
,
pReq
->
stbCfg
.
nTagCols
);
for
(
uint32_t
i
=
0
;
i
<
pReq
->
stbCfg
.
nTagCols
;
i
++
)
{
tlen
+=
taosEncodeFixedI8
(
buf
,
pReq
->
stbCfg
.
pTagSchema
[
i
].
type
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pReq
->
stbCfg
.
pTagSchema
[
i
].
colId
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pReq
->
stbCfg
.
pTagSchema
[
i
].
bytes
);
tlen
+=
taosEncodeString
(
buf
,
pReq
->
stbCfg
.
pTagSchema
[
i
].
name
);
}
break
;
case
TD_CHILD_TABLE
:
tlen
+=
taosEncodeFixedU64
(
buf
,
pReq
->
ctbCfg
.
suid
);
tlen
+=
tdEncodeKVRow
(
buf
,
pReq
->
ctbCfg
.
pTag
);
break
;
case
TD_NORMAL_TABLE
:
tlen
+=
taosEncodeFixedU32
(
buf
,
pReq
->
ntbCfg
.
nCols
);
for
(
uint32_t
i
=
0
;
i
<
pReq
->
ntbCfg
.
nCols
;
i
++
)
{
tlen
+=
taosEncodeFixedI8
(
buf
,
pReq
->
ntbCfg
.
pSchema
[
i
].
type
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pReq
->
ntbCfg
.
pSchema
[
i
].
colId
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pReq
->
ntbCfg
.
pSchema
[
i
].
bytes
);
tlen
+=
taosEncodeString
(
buf
,
pReq
->
ntbCfg
.
pSchema
[
i
].
name
);
}
break
;
default:
ASSERT
(
0
);
}
return
tlen
;
}
static
FORCE_INLINE
void
*
tDeserializeSVCreateTbReq
(
void
*
buf
,
SVCreateTbReq
*
pReq
)
{
buf
=
taosDecodeFixedU64
(
buf
,
&
(
pReq
->
ver
));
buf
=
taosDecodeString
(
buf
,
&
(
pReq
->
name
));
buf
=
taosDecodeFixedU32
(
buf
,
&
(
pReq
->
ttl
));
buf
=
taosDecodeFixedU32
(
buf
,
&
(
pReq
->
keep
));
buf
=
taosDecodeFixedU8
(
buf
,
&
(
pReq
->
type
));
switch
(
pReq
->
type
)
{
case
TD_SUPER_TABLE
:
buf
=
taosDecodeFixedU64
(
buf
,
&
(
pReq
->
stbCfg
.
suid
));
buf
=
taosDecodeFixedU32
(
buf
,
&
(
pReq
->
stbCfg
.
nCols
));
pReq
->
stbCfg
.
pSchema
=
(
SSchema
*
)
malloc
(
pReq
->
stbCfg
.
nCols
*
sizeof
(
SSchema
));
for
(
uint32_t
i
=
0
;
i
<
pReq
->
stbCfg
.
nCols
;
i
++
)
{
buf
=
taosDecodeFixedI8
(
buf
,
&
(
pReq
->
stbCfg
.
pSchema
[
i
].
type
));
buf
=
taosDecodeFixedI32
(
buf
,
&
(
pReq
->
stbCfg
.
pSchema
[
i
].
colId
));
buf
=
taosDecodeFixedI32
(
buf
,
&
(
pReq
->
stbCfg
.
pSchema
[
i
].
bytes
));
buf
=
taosDecodeStringTo
(
buf
,
pReq
->
stbCfg
.
pSchema
[
i
].
name
);
}
buf
=
taosDecodeFixedU32
(
buf
,
&
pReq
->
stbCfg
.
nTagCols
);
pReq
->
stbCfg
.
pTagSchema
=
(
SSchema
*
)
malloc
(
pReq
->
stbCfg
.
nTagCols
*
sizeof
(
SSchema
));
for
(
uint32_t
i
=
0
;
i
<
pReq
->
stbCfg
.
nTagCols
;
i
++
)
{
buf
=
taosDecodeFixedI8
(
buf
,
&
(
pReq
->
stbCfg
.
pTagSchema
[
i
].
type
));
buf
=
taosDecodeFixedI32
(
buf
,
&
pReq
->
stbCfg
.
pTagSchema
[
i
].
colId
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pReq
->
stbCfg
.
pTagSchema
[
i
].
bytes
);
buf
=
taosDecodeStringTo
(
buf
,
pReq
->
stbCfg
.
pTagSchema
[
i
].
name
);
}
break
;
case
TD_CHILD_TABLE
:
buf
=
taosDecodeFixedU64
(
buf
,
&
pReq
->
ctbCfg
.
suid
);
buf
=
tdDecodeKVRow
(
buf
,
&
pReq
->
ctbCfg
.
pTag
);
break
;
case
TD_NORMAL_TABLE
:
buf
=
taosDecodeFixedU32
(
buf
,
&
pReq
->
ntbCfg
.
nCols
);
pReq
->
ntbCfg
.
pSchema
=
(
SSchema
*
)
malloc
(
pReq
->
ntbCfg
.
nCols
*
sizeof
(
SSchema
));
for
(
uint32_t
i
=
0
;
i
<
pReq
->
ntbCfg
.
nCols
;
i
++
)
{
buf
=
taosDecodeFixedI8
(
buf
,
&
pReq
->
ntbCfg
.
pSchema
[
i
].
type
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pReq
->
ntbCfg
.
pSchema
[
i
].
colId
);
buf
=
taosDecodeFixedI32
(
buf
,
&
pReq
->
ntbCfg
.
pSchema
[
i
].
bytes
);
buf
=
taosDecodeStringTo
(
buf
,
pReq
->
ntbCfg
.
pSchema
[
i
].
name
);
}
break
;
default:
ASSERT
(
0
);
}
return
buf
;
}
typedef
struct
SVCreateTbRsp
{
}
SVCreateTbRsp
;
#pragma pack(pop)
#ifdef __cplusplus
...
...
include/common/tmsgdef.h
浏览文件 @
a60e9e40
...
...
@@ -138,7 +138,7 @@ enum {
TD_DEF_MSG_TYPE
(
TDMT_VND_TASKS_STATUS
,
"vnode-tasks-status"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_VND_CANCEL_TASK
,
"vnode-cancel-task"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_VND_DROP_TASK
,
"vnode-drop-task"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_VND_CREATE_STB
,
"vnode-create-s
tb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_VND_CREATE_STB
,
"vnode-create-s
uper-table"
,
SVCreateTbReq
,
SVCreateTbRsp
)
TD_DEF_MSG_TYPE
(
TDMT_VND_ALTER_STB
,
"vnode-alter-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_VND_DROP_STB
,
"vnode-drop-stb"
,
NULL
,
NULL
)
TD_DEF_MSG_TYPE
(
TDMT_VND_CREATE_TOPIC
,
"vnode-create-topic"
,
NULL
,
NULL
)
...
...
include/dnode/vnode/meta/meta.h
浏览文件 @
a60e9e40
...
...
@@ -25,7 +25,6 @@ extern "C" {
#endif
// Types exported
typedef
uint64_t
tb_uid_t
;
typedef
struct
SMeta
SMeta
;
#define META_SUPER_TABLE 0
...
...
include/util/tcoding.h
浏览文件 @
a60e9e40
...
...
@@ -357,6 +357,17 @@ static FORCE_INLINE void *taosDecodeString(void *buf, char **value) {
return
POINTER_SHIFT
(
buf
,
size
);
}
static
FORCE_INLINE
void
*
taosDecodeStringTo
(
void
*
buf
,
char
*
value
)
{
uint64_t
size
=
0
;
buf
=
taosDecodeVariantU64
(
buf
,
&
size
);
memcpy
(
value
,
buf
,
(
size_t
)
size
);
value
[
size
]
=
'\0'
;
return
POINTER_SHIFT
(
buf
,
size
);
}
#ifdef __cplusplus
}
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录