Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
43a07479
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看板
提交
43a07479
编写于
4年前
作者:
H
hzcheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add tbname in tsdb
上级
3330d8d0
Branches不可用
ver
ver-3.1.0.2
ver-3.1.0.1
ver-3.1.0.0
ver-3.0.7.8
ver-3.0.7.1
ver-3.0.7.0
ver-3.0.6.1
ver-3.0.6.0
ver-3.0.5.1
ver-3.0.5.0
ver-3.0.4.2
ver-3.0.4.1
ver-3.0.4.0
ver-3.0.3.2
ver-3.0.3.1
ver-3.0.3.0
ver-3.0.2.220221228
ver-3.0.2.20221226
ver-3.0.2.20105
ver-3.0.2.6
ver-3.0.2.5
ver-3.0.2.4
ver-3.0.2.3
ver-3.0.2.2
ver-3.0.2.1
ver-3.0.2.0
ver-3.0.1.8
ver-3.0.1.7
ver-3.0.1.6
ver-3.0.1.5
ver-3.0.1.4
ver-3.0.1.3
ver-3.0.1.2
ver-3.0.1.1
ver-3.0.1.0
ver-3.0.0.2
ver-3.0.0.1
ver-3.0.0.0
ver-2.6.0.99
ver-2.6.0.63
ver-2.6.0.61
ver-2.6.0.59
ver-2.6.0.57
ver-2.6.0.55
ver-2.6.0.53
ver-2.6.0.51
ver-2.6.0.49
ver-2.6.0.47
ver-2.6.0.45
ver-2.6.0.44
ver-2.6.0.43
ver-2.6.0.41
ver-2.6.0.39
ver-2.6.0.38
ver-2.6.0.36
ver-2.6.0.35
ver-2.6.0.34
ver-2.6.0.33
ver-2.6.0.32
ver-2.6.0.31
ver-2.6.0.30
ver-2.6.0.28
ver-2.6.0.27
ver-2.6.0.25
ver-2.6.0.24
ver-2.6.0.22
ver-2.6.0.21
ver-2.6.0.19
ver-2.6.0.18
ver-2.6.0.17
ver-2.6.0.16
ver-2.6.0.15
ver-2.6.0.14
ver-2.6.0.12
ver-2.6.0.10
ver-2.6.0.8
ver-2.6.0.7
ver-2.6.0.6
ver-2.6.0.4
ver-2.6.0.3-kh
ver-2.6.0.1
ver-2.6.0.0
ver-2.5.0.1
ver-2.5.0.0
ver-2.4.0.43
ver-2.4.0.41
ver-2.4.0.39
ver-2.4.0.38
ver-2.4.0.37
ver-2.4.0.36
ver-2.4.0.35
ver-2.4.0.33
ver-2.4.0.31
ver-2.4.0.30
ver-2.4.0.27
ver-2.4.0.26
ver-2.4.0.25
ver-2.4.0.24
ver-2.4.0.20
ver-2.4.0.18
ver-2.4.0.16
ver-2.4.0.14
ver-2.4.0.12
ver-2.4.0.11
ver-2.4.0.10
ver-2.4.0.9
ver-2.4.0.8
ver-2.4.0.7
ver-2.4.0.6
ver-2.4.0.5
ver-2.4.0.4
ver-2.4.0.3
ver-2.4.0.2
ver-2.4.0.1
ver-2.4.0.0
ver-2.3.6.0
ver-2.3.5.0
ver-2.3.4.0
ver-2.3.3.0
ver-2.3.2.2
ver-2.3.2.1
ver-2.3.2.0
ver-2.3.1.0
ver-2.3.0.0
ver-2.2.2.16
ver-2.2.2.15
ver-2.2.2.14
ver-2.2.2.13
ver-2.2.2.12
ver-2.2.2.11
ver-2.2.2.10
ver-2.2.2.9
ver-2.2.2.8
ver-2.2.2.7
ver-2.2.2.6
ver-2.2.2.5
ver-2.2.2.4
ver-2.2.2.3
ver-2.2.2.1
ver-2.2.2.1-ningsi
ver-2.2.2.0
ver-2.2.1.6
ver-2.2.1.5
ver-2.2.1.4
ver-2.2.1.3
ver-2.2.1.2
ver-2.2.1.1
ver-2.2.1.0
ver-2.2.0.1001
ver-2.2.0.7
ver-2.2.0.6
ver-2.2.0.5
ver-2.2.0.4
ver-2.2.0.3
ver-2.2.0.2
ver-2.2.0.1
ver-2.2.0.0
ver-2.1.7.7
ver-2.1.7.6
ver-2.1.7.2
ver-2.1.7.1
ver-2.1.6.0
ver-2.1.5.0
ver-2.1.4.1
ver-2.1.3.2
ver-2.1.3.0
ver-2.1.2.0
ver-2.1.1.0
ver-2.1.0.1
ver-2.1.0.0
ver-2.1.0
ver-2.0.22.3
ver-2.0.22.2
ver-2.0.22.1
ver-2.0.22.0
ver-2.0.21.6
ver-2.0.21.5
ver-2.0.21.4
ver-2.0.21.3
ver-2.0.21.2
ver-2.0.21.1
ver-2.0.21.0
ver-2.0.20.20
ver-2.0.20.19
ver-2.0.20.18
ver-2.0.20.16
ver-2.0.20.13
ver-2.0.20.12
ver-2.0.20.11
ver-2.0.20.10
ver-2.0.20.9
ver-2.0.20.4
ver-2.0.20.3
ver-2.0.20.2
ver-2.0.20.0
ver-2.0.19.1
ver-2.0.19.0
ver-2.0.18.2
ver-2.0.18.0
ver-2.0.17.4
ver-2.0.17.0
ver-2.0.16.0
ver-2.0.15.0
ver-2.0.14.0
ver-2.0.13.0
ver-2.0.12.0
ver-2.0.11.0
ver-2.0.10.0
ver-2.0.9.0
ver-2.0.8.2
ver-2.0.8.0
ver-2.0.7.0
ver-2.0.6.0
ver-2.0.5.2
ver-2.0.5.0
ver-2.0.4.0
ver-2.0.3.2
ver-2.0.3.1
ver-2.0.3.0
ver-2.0.2.2
ver-2.0.2.2-beta
ver-2.0.2.1
ver-2.0.2.0
ver-2.0.1.9
ver-2.0.1.1
ver-2.0.1.1-ningsi
ver-2.0.1.0
ver-2.0.0.4
ver-2.0.0.3
ver-2.0.0.2
ver-2.0.0.1
ver-2.0.0.0
tq-1.0.0.1
release/ver-2.1.2.0
mac-enter-test
autoaddcol_07161651
autoaddcol_07161108
autoaddcol_07150626
autoaddcol_0720_1434
autoaddcol_0719_1122
autoaddcol_0718_2208
TDB-ver0.8
TDB-ver-0.7
无相关合并请求
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
48 addition
and
1 deletion
+48
-1
src/inc/tsdb.h
src/inc/tsdb.h
+4
-0
src/tsdb/inc/tsdbMain.h
src/tsdb/inc/tsdbMain.h
+1
-0
src/tsdb/src/tsdbMain.c
src/tsdb/src/tsdbMain.c
+25
-0
src/tsdb/src/tsdbMeta.c
src/tsdb/src/tsdbMeta.c
+16
-1
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+2
-0
未找到文件。
src/inc/tsdb.h
浏览文件 @
43a07479
...
...
@@ -77,8 +77,10 @@ typedef struct {
// --------- TSDB TABLE configuration
typedef
struct
{
ETableType
type
;
char
*
name
;
STableId
tableId
;
int32_t
sversion
;
char
*
sname
;
// super table name
int64_t
superUid
;
STSchema
*
schema
;
STSchema
*
tagSchema
;
...
...
@@ -90,6 +92,8 @@ int tsdbTableSetSuperUid(STableCfg *config, int64_t uid);
int
tsdbTableSetSchema
(
STableCfg
*
config
,
STSchema
*
pSchema
,
bool
dup
);
int
tsdbTableSetTagSchema
(
STableCfg
*
config
,
STSchema
*
pSchema
,
bool
dup
);
int
tsdbTableSetTagValue
(
STableCfg
*
config
,
SDataRow
row
,
bool
dup
);
int
tsdbTableSetName
(
STableCfg
*
config
,
char
*
name
,
bool
dup
);
int
tsdbTableSetSName
(
STableCfg
*
config
,
char
*
sname
,
bool
dup
);
void
tsdbClearTableCfg
(
STableCfg
*
config
);
int32_t
tsdbGetTableTagVal
(
tsdb_repo_t
*
repo
,
STableId
id
,
int32_t
col
,
int16_t
*
type
,
int16_t
*
bytes
,
char
**
val
);
...
...
This diff is collapsed.
Click to expand it.
src/tsdb/inc/tsdbMain.h
浏览文件 @
43a07479
...
...
@@ -62,6 +62,7 @@ typedef struct {
// ---------- TSDB TABLE DEFINITION
typedef
struct
STable
{
int8_t
type
;
char
*
name
;
STableId
tableId
;
int64_t
superUid
;
// Super table UID
int32_t
sversion
;
...
...
This diff is collapsed.
Click to expand it.
src/tsdb/src/tsdbMain.c
浏览文件 @
43a07479
...
...
@@ -459,10 +459,35 @@ int tsdbTableSetTagValue(STableCfg *config, SDataRow row, bool dup) {
return
0
;
}
int
tsdbTableSetName
(
STableCfg
*
config
,
char
*
name
,
bool
dup
)
{
if
(
dup
)
{
config
->
name
=
strdup
(
name
);
if
(
config
->
name
==
NULL
)
return
-
1
;
}
else
{
config
->
name
=
name
;
}
return
0
;
}
int
tsdbTableSetSName
(
STableCfg
*
config
,
char
*
sname
,
bool
dup
)
{
if
(
config
->
type
!=
TSDB_CHILD_TABLE
)
return
-
1
;
if
(
dup
)
{
config
->
sname
=
strdup
(
sname
);
if
(
config
->
sname
==
NULL
)
return
-
1
;
}
else
{
config
->
sname
=
sname
;
}
return
0
;
}
void
tsdbClearTableCfg
(
STableCfg
*
config
)
{
if
(
config
->
schema
)
tdFreeSchema
(
config
->
schema
);
if
(
config
->
tagSchema
)
tdFreeSchema
(
config
->
tagSchema
);
if
(
config
->
tagValues
)
tdFreeDataRow
(
config
->
tagValues
);
tfree
(
config
->
name
);
tfree
(
config
->
sname
);
}
int
tsdbInitSubmitBlkIter
(
SSubmitBlk
*
pBlock
,
SSubmitBlkIter
*
pIter
)
{
...
...
This diff is collapsed.
Click to expand it.
src/tsdb/src/tsdbMeta.c
浏览文件 @
43a07479
...
...
@@ -39,6 +39,11 @@ void *tsdbEncodeTable(STable *pTable, int *contLen) {
void
*
ptr
=
ret
;
T_APPEND_MEMBER
(
ptr
,
pTable
,
STable
,
type
);
// Encode name
*
(
int
*
)
ptr
=
strlen
(
pTable
->
name
);
ptr
=
(
char
*
)
ptr
+
sizeof
(
int
);
memcpy
(
ptr
,
pTable
->
name
,
strlen
(
pTable
->
name
));
ptr
=
(
char
*
)
ptr
+
strlen
(
pTable
->
name
);
T_APPEND_MEMBER
(
ptr
,
&
(
pTable
->
tableId
),
STableId
,
uid
);
T_APPEND_MEMBER
(
ptr
,
&
(
pTable
->
tableId
),
STableId
,
tid
);
T_APPEND_MEMBER
(
ptr
,
pTable
,
STable
,
superUid
);
...
...
@@ -72,6 +77,12 @@ STable *tsdbDecodeTable(void *cont, int contLen) {
void
*
ptr
=
cont
;
T_READ_MEMBER
(
ptr
,
int8_t
,
pTable
->
type
);
int
len
=
*
(
int
*
)
ptr
;
ptr
=
(
char
*
)
ptr
+
sizeof
(
int
);
pTable
->
name
=
calloc
(
1
,
len
+
1
);
if
(
pTable
->
name
==
NULL
)
return
NULL
;
memcpy
(
pTable
->
name
,
ptr
,
len
);
ptr
=
(
char
*
)
ptr
+
len
;
T_READ_MEMBER
(
ptr
,
int64_t
,
pTable
->
tableId
.
uid
);
T_READ_MEMBER
(
ptr
,
int32_t
,
pTable
->
tableId
.
tid
);
T_READ_MEMBER
(
ptr
,
int64_t
,
pTable
->
superUid
);
...
...
@@ -252,7 +263,8 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) {
super
->
schema
=
tdDupSchema
(
pCfg
->
schema
);
super
->
tagSchema
=
tdDupSchema
(
pCfg
->
tagSchema
);
super
->
tagVal
=
tdDataRowDup
(
pCfg
->
tagValues
);
super
->
name
=
strdup
(
pCfg
->
sname
);
// index the first tag column
STColumn
*
pColSchema
=
schemaColAt
(
super
->
tagSchema
,
0
);
super
->
pIndex
=
tSkipListCreate
(
TSDB_SUPER_TABLE_SL_LEVEL
,
pColSchema
->
type
,
pColSchema
->
bytes
,
...
...
@@ -277,6 +289,7 @@ int32_t tsdbCreateTableImpl(STsdbMeta *pMeta, STableCfg *pCfg) {
}
table
->
tableId
=
pCfg
->
tableId
;
table
->
name
=
strdup
(
pCfg
->
name
);
if
(
IS_CREATE_STABLE
(
pCfg
))
{
// TSDB_CHILD_TABLE
table
->
type
=
TSDB_CHILD_TABLE
;
table
->
superUid
=
pCfg
->
superUid
;
...
...
@@ -374,6 +387,7 @@ static int tsdbFreeTable(STable *pTable) {
tsdbFreeMemTable
(
pTable
->
mem
);
tsdbFreeMemTable
(
pTable
->
imem
);
tfree
(
pTable
->
name
);
free
(
pTable
);
return
0
;
}
...
...
@@ -468,6 +482,7 @@ static int tsdbRemoveTableFromIndex(STsdbMeta *pMeta, STable *pTable) {
static
int
tsdbEstimateTableEncodeSize
(
STable
*
pTable
)
{
int
size
=
0
;
size
+=
T_MEMBER_SIZE
(
STable
,
type
);
size
+=
sizeof
(
int
)
+
strlen
(
pTable
->
name
);
size
+=
T_MEMBER_SIZE
(
STable
,
tableId
);
size
+=
T_MEMBER_SIZE
(
STable
,
superUid
);
size
+=
T_MEMBER_SIZE
(
STable
,
sversion
);
...
...
This diff is collapsed.
Click to expand it.
src/vnode/src/vnodeWrite.c
浏览文件 @
43a07479
...
...
@@ -126,6 +126,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
tdSchemaAppendCol
(
pDestSchema
,
pSchema
[
i
].
type
,
htons
(
pSchema
[
i
].
colId
),
htons
(
pSchema
[
i
].
bytes
));
}
tsdbTableSetSchema
(
&
tCfg
,
pDestSchema
,
false
);
tsdbTableSetName
(
&
tCfg
,
pTable
->
tableId
,
false
);
if
(
numOfTags
!=
0
)
{
STSchema
*
pDestTagSchema
=
tdNewSchema
(
numOfTags
);
...
...
@@ -133,6 +134,7 @@ static int32_t vnodeProcessCreateTableMsg(SVnodeObj *pVnode, void *pCont, SRspRe
tdSchemaAppendCol
(
pDestTagSchema
,
pSchema
[
i
].
type
,
htons
(
pSchema
[
i
].
colId
),
htons
(
pSchema
[
i
].
bytes
));
}
tsdbTableSetTagSchema
(
&
tCfg
,
pDestTagSchema
,
false
);
tsdbTableSetSName
(
&
tCfg
,
pTable
->
superTableId
,
false
);
char
*
pTagData
=
pTable
->
data
+
totalCols
*
sizeof
(
SSchema
);
int
accumBytes
=
0
;
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部