Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
69617030
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看板
提交
69617030
编写于
12月 01, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
78beb8f4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
12 deletion
+13
-12
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+3
-2
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+2
-4
source/dnode/vnode/src/tsdb/tsdbUtil.c
source/dnode/vnode/src/tsdb/tsdbUtil.c
+8
-6
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
69617030
...
...
@@ -105,8 +105,9 @@ static FORCE_INLINE int64_t tsdbLogicToFileSize(int64_t lSize, int32_t szPage) {
// tsdbUtil.c ==============================================================================================
// TSDBROW
#define TSDBROW_TS(ROW) (((ROW)->type == 0) ? (ROW)->pTSRow->ts : (ROW)->pBlockData->aTSKEY[(ROW)->iRow])
#define TSDBROW_VERSION(ROW) (((ROW)->type == 0) ? (ROW)->version : (ROW)->pBlockData->aVersion[(ROW)->iRow])
#define TSDBROW_TS(ROW) (((ROW)->type == TSDBROW_ROW_FMT) ? (ROW)->pTSRow->ts : (ROW)->pBlockData->aTSKEY[(ROW)->iRow])
#define TSDBROW_VERSION(ROW) \
(((ROW)->type == TSDBROW_ROW_FMT) ? (ROW)->version : (ROW)->pBlockData->aVersion[(ROW)->iRow])
#define TSDBROW_SVERSION(ROW) TD_ROW_SVER((ROW)->pTSRow)
#define TSDBROW_KEY(ROW) ((TSDBKEY){.version = TSDBROW_VERSION(ROW), .ts = TSDBROW_TS(ROW)})
#define tsdbRowFromTSRow(VERSION, TSROW) ((TSDBROW){.type = TSDBROW_ROW_FMT, .version = (VERSION), .pTSRow = (TSROW)})
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
69617030
...
...
@@ -1173,7 +1173,6 @@ static int32_t tsdbCommitAheadBlock(SCommitter *pCommitter, SDataBlk *pDataBlk)
tBlockDataClear
(
pBlockData
);
while
(
pRowInfo
)
{
ASSERT
(
pRowInfo
->
row
.
type
==
0
);
code
=
tsdbCommitterUpdateRowSchema
(
pCommitter
,
id
.
suid
,
id
.
uid
,
TSDBROW_SVERSION
(
&
pRowInfo
->
row
));
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
@@ -1241,7 +1240,6 @@ static int32_t tsdbCommitMergeBlock(SCommitter *pCommitter, SDataBlk *pDataBlk)
pRow
=
NULL
;
}
}
else
if
(
c
>
0
)
{
ASSERT
(
pRowInfo
->
row
.
type
==
0
);
code
=
tsdbCommitterUpdateRowSchema
(
pCommitter
,
id
.
suid
,
id
.
uid
,
TSDBROW_SVERSION
(
&
pRowInfo
->
row
));
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
@@ -1483,7 +1481,7 @@ static int32_t tsdbCommitTableData(SCommitter *pCommitter, TABLEID id) {
while
(
pRowInfo
)
{
STSchema
*
pTSchema
=
NULL
;
if
(
pRowInfo
->
row
.
type
==
0
)
{
if
(
pRowInfo
->
row
.
type
==
TSDBROW_ROW_FMT
)
{
code
=
tsdbCommitterUpdateRowSchema
(
pCommitter
,
id
.
suid
,
id
.
uid
,
TSDBROW_SVERSION
(
&
pRowInfo
->
row
));
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
pTSchema
=
pCommitter
->
skmRow
.
pTSchema
;
...
...
@@ -1526,7 +1524,7 @@ static int32_t tsdbCommitTableData(SCommitter *pCommitter, TABLEID id) {
while
(
pRowInfo
)
{
STSchema
*
pTSchema
=
NULL
;
if
(
pRowInfo
->
row
.
type
==
0
)
{
if
(
pRowInfo
->
row
.
type
==
TSDBROW_ROW_FMT
)
{
code
=
tsdbCommitterUpdateRowSchema
(
pCommitter
,
id
.
suid
,
id
.
uid
,
TSDBROW_SVERSION
(
&
pRowInfo
->
row
));
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
pTSchema
=
pCommitter
->
skmRow
.
pTSchema
;
...
...
source/dnode/vnode/src/tsdb/tsdbUtil.c
浏览文件 @
69617030
...
...
@@ -572,9 +572,9 @@ void tsdbRowGetColVal(TSDBROW *pRow, STSchema *pTSchema, int32_t iCol, SColVal *
ASSERT
(
iCol
>
0
);
if
(
pRow
->
type
==
0
)
{
if
(
pRow
->
type
==
TSDBROW_ROW_FMT
)
{
tRowGet
(
pRow
->
pTSRow
,
pTSchema
,
iCol
,
pColVal
);
}
else
if
(
pRow
->
type
==
1
)
{
}
else
if
(
pRow
->
type
==
TSDBROW_COL_FMT
)
{
SColData
*
pColData
;
tBlockDataGetColData
(
pRow
->
pBlockData
,
pTColumn
->
colId
,
&
pColData
);
...
...
@@ -606,11 +606,11 @@ int32_t tsdbRowCmprFn(const void *p1, const void *p2) {
// STSDBRowIter ======================================================
void
tsdbRowIterInit
(
STSDBRowIter
*
pIter
,
TSDBROW
*
pRow
,
STSchema
*
pTSchema
)
{
pIter
->
pRow
=
pRow
;
if
(
pRow
->
type
==
0
)
{
if
(
pRow
->
type
==
TSDBROW_ROW_FMT
)
{
ASSERT
(
pTSchema
);
pIter
->
pTSchema
=
pTSchema
;
pIter
->
i
=
1
;
}
else
if
(
pRow
->
type
==
1
)
{
}
else
if
(
pRow
->
type
==
TSDBROW_COL_FMT
)
{
pIter
->
pTSchema
=
NULL
;
pIter
->
i
=
0
;
}
else
{
...
...
@@ -619,14 +619,14 @@ void tsdbRowIterInit(STSDBRowIter *pIter, TSDBROW *pRow, STSchema *pTSchema) {
}
SColVal
*
tsdbRowIterNext
(
STSDBRowIter
*
pIter
)
{
if
(
pIter
->
pRow
->
type
==
0
)
{
if
(
pIter
->
pRow
->
type
==
TSDBROW_ROW_FMT
)
{
if
(
pIter
->
i
<
pIter
->
pTSchema
->
numOfCols
)
{
tRowGet
(
pIter
->
pRow
->
pTSRow
,
pIter
->
pTSchema
,
pIter
->
i
,
&
pIter
->
colVal
);
pIter
->
i
++
;
return
&
pIter
->
colVal
;
}
}
else
{
}
else
if
(
pIter
->
pRow
->
type
==
TSDBROW_COL_FMT
)
{
if
(
pIter
->
i
<
pIter
->
pRow
->
pBlockData
->
nColData
)
{
SColData
*
pColData
=
tBlockDataGetColDataByIdx
(
pIter
->
pRow
->
pBlockData
,
pIter
->
i
);
...
...
@@ -635,6 +635,8 @@ SColVal *tsdbRowIterNext(STSDBRowIter *pIter) {
return
&
pIter
->
colVal
;
}
}
else
{
ASSERT
(
0
);
}
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录