Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1b4cfa64
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看板
提交
1b4cfa64
编写于
6月 30, 2022
作者:
M
Minglei Jin
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feat/tsdb_refact' of
https://github.com/taosdata/TDengine
into feat/tsdb_refact
上级
a730764a
1abc5911
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
38 deletion
+16
-38
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+16
-38
未找到文件。
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
1b4cfa64
...
...
@@ -324,7 +324,6 @@ static int32_t tsdbCommitterUpdateSchema(SCommitter *pCommitter, int64_t suid, i
}
}
_update_schema:
pCommitter
->
suid
=
suid
;
pCommitter
->
uid
=
uid
;
tTSchemaDestroy
(
pCommitter
->
pTSchema
);
...
...
@@ -341,15 +340,22 @@ static int32_t tsdbCommitBlockData(SCommitter *pCommitter, SBlockData *pBlockDat
int8_t
toDataOnly
)
{
int32_t
code
=
0
;
if
(
!
toDataOnly
&&
pBlockData
->
nRow
<
pCommitter
->
minRow
)
{
pBlock
->
last
=
1
;
}
else
{
pBlock
->
last
=
0
;
if
(
pBlock
->
nSubBlock
==
0
)
{
if
(
!
toDataOnly
&&
pBlockData
->
nRow
<
pCommitter
->
minRow
)
{
pBlock
->
last
=
1
;
}
else
{
pBlock
->
last
=
0
;
}
}
code
=
tsdbWriteBlockData
(
pCommitter
->
pWriter
,
pBlockData
,
NULL
,
NULL
,
pBlockIdx
,
pBlock
,
pCommitter
->
cmprAlg
);
if
(
code
)
goto
_err
;
#if 0
code = tsdbWriteBlockSMA(pCommitter, pBlockData, pBlock);
if (code) goto _err;
#endif
code
=
tMapDataPutItem
(
&
pCommitter
->
nBlockMap
,
pBlock
,
tPutBlock
);
if
(
code
)
goto
_err
;
...
...
@@ -446,16 +452,7 @@ static int32_t tsdbMergeTableData(SCommitter *pCommitter, STbDataIter *pIter, SB
}
_write_block:
if
(
!
toDataOnly
&&
pBlockData
->
nRow
<
pCommitter
->
minRow
)
{
pBlock
->
last
=
1
;
}
else
{
pBlock
->
last
=
0
;
}
code
=
tsdbWriteBlockData
(
pCommitter
->
pWriter
,
pBlockData
,
NULL
,
NULL
,
pBlockIdx
,
pBlock
,
pCommitter
->
cmprAlg
);
if
(
code
)
goto
_err
;
code
=
tMapDataPutItem
(
&
pCommitter
->
nBlockMap
,
pBlock
,
tPutBlock
);
code
=
tsdbCommitBlockData
(
pCommitter
,
pBlockData
,
pBlock
,
pBlockIdx
,
toDataOnly
);
if
(
code
)
goto
_err
;
tBlockReset
(
pBlock
);
...
...
@@ -491,7 +488,7 @@ static int32_t tsdbCommitTableMemData(SCommitter *pCommitter, STbDataIter *pIter
}
// update schema
code
=
tsdbCommitterUpdateSchema
(
pCommitter
,
pIter
->
pTbData
->
suid
,
pIter
->
pTbData
->
uid
,
TSDBROW_SVERSION
(
pRow
));
code
=
tsdbCommitterUpdateSchema
(
pCommitter
,
suid
,
uid
,
TSDBROW_SVERSION
(
pRow
));
if
(
code
)
goto
_err
;
// append
...
...
@@ -506,17 +503,7 @@ static int32_t tsdbCommitTableMemData(SCommitter *pCommitter, STbDataIter *pIter
continue
;
_write_block:
if
(
!
toDataOnly
&&
pBlockData
->
nRow
<
pCommitter
->
minRow
)
{
pBlock
->
last
=
1
;
}
else
{
pBlock
->
last
=
0
;
}
code
=
tsdbWriteBlockData
(
pCommitter
->
pWriter
,
pBlockData
,
NULL
,
NULL
,
&
(
SBlockIdx
){.
suid
=
suid
,
.
uid
=
uid
},
pBlock
,
pCommitter
->
cmprAlg
);
if
(
code
)
goto
_err
;
code
=
tMapDataPutItem
(
&
pCommitter
->
nBlockMap
,
pBlock
,
tPutBlock
);
code
=
tsdbCommitBlockData
(
pCommitter
,
pBlockData
,
pBlock
,
&
(
SBlockIdx
){.
suid
=
suid
,
.
uid
=
uid
},
toDataOnly
);
if
(
code
)
goto
_err
;
tBlockReset
(
pBlock
);
...
...
@@ -538,12 +525,7 @@ static int32_t tsdbCommitTableDiskData(SCommitter *pCommitter, SBlock *pBlock, S
if
(
code
)
goto
_err
;
tBlockReset
(
&
pCommitter
->
nBlock
);
pCommitter
->
nBlock
.
last
=
pBlock
->
last
;
code
=
tsdbWriteBlockData
(
pCommitter
->
pWriter
,
&
pCommitter
->
oBlockData
,
NULL
,
NULL
,
pBlockIdx
,
&
pCommitter
->
nBlock
,
pCommitter
->
cmprAlg
);
if
(
code
)
goto
_err
;
code
=
tMapDataPutItem
(
&
pCommitter
->
nBlockMap
,
&
pCommitter
->
nBlock
,
tPutBlock
);
code
=
tsdbCommitBlockData
(
pCommitter
,
&
pCommitter
->
oBlockData
,
&
pCommitter
->
nBlock
,
pBlockIdx
,
0
);
if
(
code
)
goto
_err
;
}
else
{
code
=
tMapDataPutItem
(
&
pCommitter
->
nBlockMap
,
pBlock
,
tPutBlock
);
...
...
@@ -639,11 +621,7 @@ static int32_t tsdbMergeAsSubBlock(SCommitter *pCommitter, STbDataIter *pIter, S
code
=
tBlockCopy
(
pBlock
,
&
pCommitter
->
nBlock
);
if
(
code
)
goto
_err
;
code
=
tsdbWriteBlockData
(
pCommitter
->
pWriter
,
pBlockData
,
NULL
,
NULL
,
pBlockIdx
,
&
pCommitter
->
nBlock
,
pCommitter
->
cmprAlg
);
if
(
code
)
goto
_err
;
code
=
tMapDataPutItem
(
&
pCommitter
->
nBlockMap
,
&
pCommitter
->
nBlock
,
tPutBlock
);
code
=
tsdbCommitBlockData
(
pCommitter
,
pBlockData
,
&
pCommitter
->
nBlock
,
pBlockIdx
,
0
);
if
(
code
)
goto
_err
;
return
code
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录