Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3cc29d77
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
3cc29d77
编写于
9月 07, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
d630c2fd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
11 deletion
+30
-11
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
+30
-11
未找到文件。
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
浏览文件 @
3cc29d77
...
...
@@ -1124,7 +1124,27 @@ _exit:
static
int32_t
tsdbSnapWriteTableDataStart
(
STsdbSnapWriter
*
pWriter
,
TABLEID
*
pId
)
{
int32_t
code
=
0
;
// TODO
code
=
tsdbSnapWriteCopyData
(
pWriter
,
pId
);
if
(
code
)
goto
_err
;
pWriter
->
id
.
suid
=
pId
->
suid
;
pWriter
->
id
.
uid
=
pId
->
uid
;
code
=
tsdbUpdateTableSchema
(
pWriter
->
pTsdb
->
pVnode
->
pMeta
,
pId
->
suid
,
pId
->
uid
,
&
pWriter
->
skmTable
);
if
(
code
)
goto
_err
;
// Reader (todo)
ASSERT
(
pWriter
->
dReader
.
pBlockIdx
==
NULL
||
tTABLEIDCmprFn
(
pWriter
->
dReader
.
pBlockIdx
,
pId
)
>=
0
);
// Writer
tMapDataReset
(
&
pWriter
->
dWriter
.
mDataBlk
);
code
=
tBlockDataInit
(
&
pWriter
->
dWriter
.
bData
,
pId
->
suid
,
pId
->
uid
,
pWriter
->
skmTable
.
pTSchema
);
if
(
code
)
goto
_err
;
return
code
;
_err:
return
code
;
}
...
...
@@ -1178,6 +1198,9 @@ static int32_t tsdbSnapWriteTableDataEnd(STsdbSnapWriter* pWriter) {
}
}
pWriter
->
id
.
suid
=
0
;
pWriter
->
id
.
uid
=
0
;
return
code
;
_err:
...
...
@@ -1296,18 +1319,10 @@ static int32_t tsdbSnapWriteRowData(STsdbSnapWriter* pWriter, int32_t iRow) {
if
(
id
.
suid
!=
pWriter
->
id
.
suid
||
id
.
uid
!=
pWriter
->
id
.
uid
)
{
code
=
tsdbSnapWriteTableDataEnd
(
pWriter
);
if
(
code
)
goto
_err
;
pWriter
->
id
.
suid
=
0
;
pWriter
->
id
.
uid
=
0
;
}
// Start new table data write if need
if
(
pWriter
->
id
.
suid
==
0
&&
pWriter
->
id
.
uid
==
0
)
{
// Copy table data ahead
code
=
tsdbSnapWriteCopyData
(
pWriter
,
&
id
);
if
(
code
)
goto
_err
;
// Start new table data
code
=
tsdbSnapWriteTableDataStart
(
pWriter
,
&
id
);
if
(
code
)
goto
_err
;
}
...
...
@@ -1355,7 +1370,9 @@ static int32_t tsdbSnapWriteRowData(STsdbSnapWriter* pWriter, int32_t iRow) {
if
(
code
)
goto
_err
;
if
(
pWriter
->
dWriter
.
bData
.
nRow
>=
pWriter
->
maxRow
)
{
// TODO: write data block
code
=
tsdbWriteDataBlock
(
pWriter
->
dWriter
.
pWriter
,
&
pWriter
->
dWriter
.
bData
,
&
pWriter
->
dWriter
.
mDataBlk
,
pWriter
->
cmprAlg
);
if
(
code
)
goto
_err
;
}
}
else
{
code
=
tsdbReadDataBlockEx
(
pWriter
->
dReader
.
pReader
,
&
dataBlk
,
&
pWriter
->
dReader
.
bData
);
...
...
@@ -1374,7 +1391,9 @@ static int32_t tsdbSnapWriteRowData(STsdbSnapWriter* pWriter, int32_t iRow) {
if
(
code
)
goto
_err
;
if
(
pWriter
->
dWriter
.
sData
.
nRow
>=
pWriter
->
maxRow
)
{
// TODO: write sst block
code
=
tsdbWriteSttBlock
(
pWriter
->
dWriter
.
pWriter
,
&
pWriter
->
dWriter
.
sData
,
pWriter
->
dWriter
.
aSttBlk
,
pWriter
->
cmprAlg
);
if
(
code
)
goto
_err
;
}
_exit:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录