Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0c9b66b5
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0c9b66b5
编写于
6月 08, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
2f5f0b75
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
15 addition
and
25 deletion
+15
-25
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
+3
-7
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
+1
-1
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
+1
-9
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
+10
-8
未找到文件。
source/dnode/vnode/src/tsdb/dev/inc/tsdbUtil.h
浏览文件 @
0c9b66b5
...
@@ -65,16 +65,14 @@ int32_t tTombBlockPut(STombBlock *tombBlock, const STombRecord *record);
...
@@ -65,16 +65,14 @@ int32_t tTombBlockPut(STombBlock *tombBlock, const STombRecord *record);
int32_t
tTombRecordCompare
(
const
STombRecord
*
record1
,
const
STombRecord
*
record2
);
int32_t
tTombRecordCompare
(
const
STombRecord
*
record1
,
const
STombRecord
*
record2
);
// STbStatisBlock ----------
// STbStatisBlock ----------
#define STATIS_RECORD_NUM_ELEM
9
#define STATIS_RECORD_NUM_ELEM
7
typedef
union
{
typedef
union
{
int64_t
dataArr
[
STATIS_RECORD_NUM_ELEM
];
int64_t
dataArr
[
STATIS_RECORD_NUM_ELEM
];
struct
{
struct
{
int64_t
suid
;
int64_t
suid
;
int64_t
uid
;
int64_t
uid
;
int64_t
firstKey
;
int64_t
firstKey
;
int64_t
firstKeyVer
;
int64_t
lastKey
;
int64_t
lastKey
;
int64_t
lastKeyVer
;
int64_t
minVer
;
int64_t
minVer
;
int64_t
maxVer
;
int64_t
maxVer
;
int64_t
count
;
int64_t
count
;
...
@@ -87,9 +85,7 @@ typedef union {
...
@@ -87,9 +85,7 @@ typedef union {
TARRAY2
(
int64_t
)
suid
[
1
];
TARRAY2
(
int64_t
)
suid
[
1
];
TARRAY2
(
int64_t
)
uid
[
1
];
TARRAY2
(
int64_t
)
uid
[
1
];
TARRAY2
(
int64_t
)
firstKey
[
1
];
TARRAY2
(
int64_t
)
firstKey
[
1
];
TARRAY2
(
int64_t
)
firstKeyVer
[
1
];
TARRAY2
(
int64_t
)
lastKey
[
1
];
TARRAY2
(
int64_t
)
lastKey
[
1
];
TARRAY2
(
int64_t
)
lastKeyVer
[
1
];
TARRAY2
(
int64_t
)
minVer
[
1
];
TARRAY2
(
int64_t
)
minVer
[
1
];
TARRAY2
(
int64_t
)
maxVer
[
1
];
TARRAY2
(
int64_t
)
maxVer
[
1
];
TARRAY2
(
int64_t
)
count
[
1
];
TARRAY2
(
int64_t
)
count
[
1
];
...
@@ -109,9 +105,9 @@ typedef struct SStatisBlk {
...
@@ -109,9 +105,9 @@ typedef struct SStatisBlk {
#define STATIS_BLOCK_SIZE(db) TARRAY2_SIZE((db)->suid)
#define STATIS_BLOCK_SIZE(db) TARRAY2_SIZE((db)->suid)
int32_t
tStatisBlockInit
(
STbStatisBlock
*
statisBlock
);
int32_t
tStatisBlockInit
(
STbStatisBlock
*
statisBlock
);
int32_t
tStatisBlock
Free
(
STbStatisBlock
*
statisBlock
);
int32_t
tStatisBlock
Destroy
(
STbStatisBlock
*
statisBlock
);
int32_t
tStatisBlockClear
(
STbStatisBlock
*
statisBlock
);
int32_t
tStatisBlockClear
(
STbStatisBlock
*
statisBlock
);
int32_t
tStatisBlockPut
(
STbStatisBlock
*
statisBlock
,
const
STbStatisRecord
*
statisR
ecord
);
int32_t
tStatisBlockPut
(
STbStatisBlock
*
statisBlock
,
const
STbStatisRecord
*
r
ecord
);
// other apis
// other apis
int32_t
tsdbUpdateSkmTb
(
STsdb
*
pTsdb
,
const
TABLEID
*
tbid
,
SSkmInfo
*
pSkmTb
);
int32_t
tsdbUpdateSkmTb
(
STsdb
*
pTsdb
,
const
TABLEID
*
tbid
,
SSkmInfo
*
pSkmTb
);
...
...
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
浏览文件 @
0c9b66b5
...
@@ -390,7 +390,7 @@ static int32_t tsdbDataFileWriterDoClose(SDataFileWriter *writer) {
...
@@ -390,7 +390,7 @@ static int32_t tsdbDataFileWriterDoClose(SDataFileWriter *writer) {
}
}
tTombBlockDestroy
(
writer
->
tData
);
tTombBlockDestroy
(
writer
->
tData
);
tStatisBlock
Free
(
writer
->
sData
);
tStatisBlock
Destroy
(
writer
->
sData
);
tBlockDataDestroy
(
writer
->
bData
);
tBlockDataDestroy
(
writer
->
bData
);
TARRAY2_DESTROY
(
writer
->
tombBlkArray
,
NULL
);
TARRAY2_DESTROY
(
writer
->
tombBlkArray
,
NULL
);
TARRAY2_DESTROY
(
writer
->
dataBlkArray
,
NULL
);
TARRAY2_DESTROY
(
writer
->
dataBlkArray
,
NULL
);
...
...
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
浏览文件 @
0c9b66b5
...
@@ -626,7 +626,7 @@ static void tsdbSttFWriterDoClose(SSttFileWriter *writer) {
...
@@ -626,7 +626,7 @@ static void tsdbSttFWriterDoClose(SSttFileWriter *writer) {
tDestroyTSchema
(
writer
->
skmRow
->
pTSchema
);
tDestroyTSchema
(
writer
->
skmRow
->
pTSchema
);
tDestroyTSchema
(
writer
->
skmTb
->
pTSchema
);
tDestroyTSchema
(
writer
->
skmTb
->
pTSchema
);
tTombBlockDestroy
(
writer
->
tData
);
tTombBlockDestroy
(
writer
->
tData
);
tStatisBlock
Free
(
writer
->
sData
);
tStatisBlock
Destroy
(
writer
->
sData
);
tBlockDataDestroy
(
writer
->
bData
);
tBlockDataDestroy
(
writer
->
bData
);
TARRAY2_DESTROY
(
writer
->
tombBlkArray
,
NULL
);
TARRAY2_DESTROY
(
writer
->
tombBlkArray
,
NULL
);
TARRAY2_DESTROY
(
writer
->
statisBlkArray
,
NULL
);
TARRAY2_DESTROY
(
writer
->
statisBlkArray
,
NULL
);
...
@@ -774,9 +774,7 @@ int32_t tsdbSttFileWriteTSData(SSttFileWriter *writer, SRowInfo *row) {
...
@@ -774,9 +774,7 @@ int32_t tsdbSttFileWriteTSData(SSttFileWriter *writer, SRowInfo *row) {
.
suid
=
row
->
suid
,
.
suid
=
row
->
suid
,
.
uid
=
row
->
uid
,
.
uid
=
row
->
uid
,
.
firstKey
=
key
->
ts
,
.
firstKey
=
key
->
ts
,
.
firstKeyVer
=
key
->
version
,
.
lastKey
=
key
->
ts
,
.
lastKey
=
key
->
ts
,
.
lastKeyVer
=
key
->
version
,
.
minVer
=
key
->
version
,
.
minVer
=
key
->
version
,
.
maxVer
=
key
->
version
,
.
maxVer
=
key
->
version
,
.
count
=
1
,
.
count
=
1
,
...
@@ -789,9 +787,7 @@ int32_t tsdbSttFileWriteTSData(SSttFileWriter *writer, SRowInfo *row) {
...
@@ -789,9 +787,7 @@ int32_t tsdbSttFileWriteTSData(SSttFileWriter *writer, SRowInfo *row) {
if
(
key
->
ts
>
TARRAY2_LAST
(
writer
->
sData
->
lastKey
))
{
if
(
key
->
ts
>
TARRAY2_LAST
(
writer
->
sData
->
lastKey
))
{
TARRAY2_LAST
(
writer
->
sData
->
count
)
++
;
TARRAY2_LAST
(
writer
->
sData
->
count
)
++
;
TARRAY2_LAST
(
writer
->
sData
->
lastKey
)
=
key
->
ts
;
TARRAY2_LAST
(
writer
->
sData
->
lastKey
)
=
key
->
ts
;
TARRAY2_LAST
(
writer
->
sData
->
lastKeyVer
)
=
key
->
version
;
}
else
if
(
key
->
ts
==
TARRAY2_LAST
(
writer
->
sData
->
lastKey
))
{
}
else
if
(
key
->
ts
==
TARRAY2_LAST
(
writer
->
sData
->
lastKey
))
{
TARRAY2_LAST
(
writer
->
sData
->
lastKeyVer
)
=
key
->
version
;
}
else
{
}
else
{
ASSERTS
(
0
,
"timestamp should be in ascending order"
);
ASSERTS
(
0
,
"timestamp should be in ascending order"
);
}
}
...
@@ -811,10 +807,6 @@ int32_t tsdbSttFileWriteTSData(SSttFileWriter *writer, SRowInfo *row) {
...
@@ -811,10 +807,6 @@ int32_t tsdbSttFileWriteTSData(SSttFileWriter *writer, SRowInfo *row) {
:
writer
->
bData
->
aUid
[
writer
->
bData
->
nRow
-
1
])
==
row
->
uid
//
:
writer
->
bData
->
aUid
[
writer
->
bData
->
nRow
-
1
])
==
row
->
uid
//
&&
writer
->
bData
->
aTSKEY
[
writer
->
bData
->
nRow
-
1
]
==
key
->
ts
//
&&
writer
->
bData
->
aTSKEY
[
writer
->
bData
->
nRow
-
1
]
==
key
->
ts
//
)
{
)
{
if
(
writer
->
bData
->
nRow
==
1
)
{
TARRAY2_LAST
(
writer
->
sData
->
firstKeyVer
)
=
key
->
version
;
}
code
=
tBlockDataUpdateRow
(
writer
->
bData
,
&
row
->
row
,
writer
->
config
->
skmRow
->
pTSchema
);
code
=
tBlockDataUpdateRow
(
writer
->
bData
,
&
row
->
row
,
writer
->
config
->
skmRow
->
pTSchema
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
else
{
}
else
{
...
...
source/dnode/vnode/src/tsdb/dev/tsdbUtil.c
浏览文件 @
0c9b66b5
...
@@ -38,8 +38,9 @@ int32_t tTombBlockClear(STombBlock *tombBlock) {
...
@@ -38,8 +38,9 @@ int32_t tTombBlockClear(STombBlock *tombBlock) {
}
}
int32_t
tTombBlockPut
(
STombBlock
*
tombBlock
,
const
STombRecord
*
record
)
{
int32_t
tTombBlockPut
(
STombBlock
*
tombBlock
,
const
STombRecord
*
record
)
{
int32_t
code
;
for
(
int32_t
i
=
0
;
i
<
TOMB_RECORD_ELEM_NUM
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
TOMB_RECORD_ELEM_NUM
;
++
i
)
{
int32_t
code
=
TARRAY2_APPEND
(
&
tombBlock
->
dataArr
[
i
],
record
->
dataArr
[
i
]);
code
=
TARRAY2_APPEND
(
&
tombBlock
->
dataArr
[
i
],
record
->
dataArr
[
i
]);
if
(
code
)
return
code
;
if
(
code
)
return
code
;
}
}
return
0
;
return
0
;
...
@@ -57,29 +58,30 @@ int32_t tTombRecordCompare(const STombRecord *r1, const STombRecord *r2) {
...
@@ -57,29 +58,30 @@ int32_t tTombRecordCompare(const STombRecord *r1, const STombRecord *r2) {
// STbStatisBlock ----------
// STbStatisBlock ----------
int32_t
tStatisBlockInit
(
STbStatisBlock
*
statisBlock
)
{
int32_t
tStatisBlockInit
(
STbStatisBlock
*
statisBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
)
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
STATIS_RECORD_NUM_ELEM
;
++
i
)
{
TARRAY2_INIT
(
&
statisBlock
->
dataArr
[
i
]);
TARRAY2_INIT
(
&
statisBlock
->
dataArr
[
i
]);
}
}
return
0
;
return
0
;
}
}
int32_t
tStatisBlock
Free
(
STbStatisBlock
*
statisBlock
)
{
int32_t
tStatisBlock
Destroy
(
STbStatisBlock
*
statisBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
)
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
STATIS_RECORD_NUM_ELEM
;
++
i
)
{
TARRAY2_DESTROY
(
&
statisBlock
->
dataArr
[
i
],
NULL
);
TARRAY2_DESTROY
(
&
statisBlock
->
dataArr
[
i
],
NULL
);
}
}
return
0
;
return
0
;
}
}
int32_t
tStatisBlockClear
(
STbStatisBlock
*
statisBlock
)
{
int32_t
tStatisBlockClear
(
STbStatisBlock
*
statisBlock
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
)
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
STATIS_RECORD_NUM_ELEM
;
++
i
)
{
TARRAY2_CLEAR
(
&
statisBlock
->
dataArr
[
i
],
NULL
);
TARRAY2_CLEAR
(
&
statisBlock
->
dataArr
[
i
],
NULL
);
}
}
return
0
;
return
0
;
}
}
int32_t
tStatisBlockPut
(
STbStatisBlock
*
statisBlock
,
const
STbStatisRecord
*
statisRecord
)
{
int32_t
tStatisBlockPut
(
STbStatisBlock
*
statisBlock
,
const
STbStatisRecord
*
record
)
{
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
statisBlock
->
dataArr
);
++
i
)
{
int32_t
code
;
int32_t
code
=
TARRAY2_APPEND
(
&
statisBlock
->
dataArr
[
i
],
statisRecord
->
dataArr
[
i
]);
for
(
int32_t
i
=
0
;
i
<
STATIS_RECORD_NUM_ELEM
;
++
i
)
{
code
=
TARRAY2_APPEND
(
&
statisBlock
->
dataArr
[
i
],
record
->
dataArr
[
i
]);
if
(
code
)
return
code
;
if
(
code
)
return
code
;
}
}
return
0
;
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录