Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6668da43
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
6668da43
编写于
5月 27, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
e4b7318c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
16 deletion
+18
-16
source/dnode/vnode/src/tsdb/dev/tsdbSttFReaderWriter.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFReaderWriter.c
+18
-16
未找到文件。
source/dnode/vnode/src/tsdb/dev/tsdbSttFReaderWriter.c
浏览文件 @
6668da43
...
...
@@ -414,13 +414,12 @@ static int32_t tsdbSttFileDoWriteSttBlk(SSttFileWriter *writer) {
int32_t
lino
;
writer
->
footer
->
sttBlkPtr
->
offset
=
writer
->
file
->
size
;
writer
->
footer
->
sttBlkPtr
->
size
=
sizeof
(
SSttBlk
)
*
TARRAY2_SIZE
(
writer
->
sttBlkArray
);
writer
->
footer
->
sttBlkPtr
->
size
=
TARRAY2_DATA_LEN
(
writer
->
sttBlkArray
);
if
(
writer
->
footer
->
sttBlkPtr
->
size
)
{
code
=
tsdbWriteFile
(
writer
->
fd
,
writer
->
file
->
size
,
(
const
uint8_t
*
)
TARRAY2_DATA
(
writer
->
sttBlkArray
),
writer
->
footer
->
sttBlkPtr
->
size
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
writer
->
file
->
size
+=
writer
->
footer
->
sttBlkPtr
->
size
;
}
...
...
@@ -437,7 +436,7 @@ static int32_t tsdbSttFileDoWriteStatisBlk(SSttFileWriter *writer) {
int32_t
lino
;
writer
->
footer
->
statisBlkPtr
->
offset
=
writer
->
file
->
size
;
writer
->
footer
->
statisBlkPtr
->
size
=
sizeof
(
STbStatisBlock
)
*
TARRAY2_SIZE
(
writer
->
statisBlkArray
);
writer
->
footer
->
statisBlkPtr
->
size
=
TARRAY2_DATA_LEN
(
writer
->
statisBlkArray
);
if
(
writer
->
footer
->
statisBlkPtr
->
size
)
{
code
=
tsdbWriteFile
(
writer
->
fd
,
writer
->
file
->
size
,
(
const
uint8_t
*
)
TARRAY2_DATA
(
writer
->
statisBlkArray
),
...
...
@@ -459,7 +458,7 @@ static int32_t tsdbSttFileDoWriteDelBlk(SSttFileWriter *writer) {
int32_t
lino
;
writer
->
footer
->
delBlkPtr
->
offset
=
writer
->
file
->
size
;
writer
->
footer
->
delBlkPtr
->
size
=
sizeof
(
SDelBlk
)
*
TARRAY2_SIZE
(
writer
->
delBlkArray
);
writer
->
footer
->
delBlkPtr
->
size
=
TARRAY2_DATA_LEN
(
writer
->
delBlkArray
);
if
(
writer
->
footer
->
delBlkPtr
->
size
)
{
code
=
tsdbWriteFile
(
writer
->
fd
,
writer
->
file
->
size
,
(
const
uint8_t
*
)
TARRAY2_DATA
(
writer
->
delBlkArray
),
...
...
@@ -526,13 +525,20 @@ _exit:
return
0
;
}
static
void
tsdbSttFWriterDoClose
(
SSttFileWriter
*
pWriter
)
{
// TODO: do clear the struct
}
static
void
tsdbSttFWriterDoClose
(
SSttFileWriter
*
writer
)
{
ASSERT
(
!
writer
->
fd
);
static
int32_t
tsdbSttFileDoWriteBloomFilter
(
SSttFileWriter
*
writer
)
{
// TODO
return
0
;
for
(
int32_t
i
=
0
;
i
<
ARRAY_SIZE
(
writer
->
aBufSize
);
++
i
)
{
tFree
(
writer
->
aBuf
[
i
]);
}
tDestroyTSchema
(
writer
->
skmRow
->
pTSchema
);
tDestroyTSchema
(
writer
->
skmTb
->
pTSchema
);
tStatisBlockFree
(
writer
->
sData
);
tDelBlockFree
(
writer
->
dData
);
tBlockDataDestroy
(
writer
->
bData
);
TARRAY2_FREE
(
writer
->
statisBlkArray
);
TARRAY2_FREE
(
writer
->
delBlkArray
);
TARRAY2_FREE
(
writer
->
sttBlkArray
);
}
static
int32_t
tsdbSttFileDoUpdateHeader
(
SSttFileWriter
*
writer
)
{
...
...
@@ -563,9 +569,6 @@ static int32_t tsdbSttFWriterCloseCommit(SSttFileWriter *writer, STFileOp *op) {
code
=
tsdbSttFileDoWriteDelBlk
(
writer
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
tsdbSttFileDoWriteBloomFilter
(
writer
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
tsdbSttFileDoWriteFooter
(
writer
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
@@ -591,9 +594,6 @@ _exit:
}
static
int32_t
tsdbSttFWriterCloseAbort
(
SSttFileWriter
*
writer
)
{
char
fname
[
TSDB_FILENAME_LEN
];
tsdbTFileName
(
writer
->
config
->
tsdb
,
&
writer
->
config
->
file
,
fname
);
if
(
writer
->
config
->
file
.
size
)
{
// truncate the file to the original size
ASSERT
(
writer
->
config
->
file
.
size
<=
writer
->
file
->
size
);
if
(
writer
->
config
->
file
.
size
<
writer
->
file
->
size
)
{
...
...
@@ -601,6 +601,8 @@ static int32_t tsdbSttFWriterCloseAbort(SSttFileWriter *writer) {
tsdbCloseFile
(
&
writer
->
fd
);
}
}
else
{
// remove the file
char
fname
[
TSDB_FILENAME_LEN
];
tsdbTFileName
(
writer
->
config
->
tsdb
,
&
writer
->
config
->
file
,
fname
);
tsdbCloseFile
(
&
writer
->
fd
);
taosRemoveFile
(
fname
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录