Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
81e54541
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
81e54541
编写于
4月 25, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
05d16920
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
27 deletion
+27
-27
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+1
-1
source/dnode/vnode/src/tsdb/tsdbCache.c
source/dnode/vnode/src/tsdb/tsdbCache.c
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+25
-25
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
81e54541
...
...
@@ -769,7 +769,7 @@ typedef struct SLDataIter {
bool
ignoreEarlierTs
;
}
SLDataIter
;
#define tMergeTreeGetRow(_t) (
(_t)->pIter->rInfo.row
)
#define tMergeTreeGetRow(_t) (
&((_t)->pIter->rInfo.row)
)
int32_t
tMergeTreeOpen
(
SMergeTree
*
pMTree
,
int8_t
backward
,
SDataFReader
*
pFReader
,
uint64_t
suid
,
uint64_t
uid
,
STimeWindow
*
pTimeWindow
,
SVersionRange
*
pVerRange
,
SSttBlockLoadInfo
*
pBlockLoadInfo
,
bool
destroyLoadInfo
,
const
char
*
idStr
,
bool
strictTimeRange
,
SLDataIter
*
pLDataIter
);
...
...
source/dnode/vnode/src/tsdb/tsdbCache.c
浏览文件 @
81e54541
...
...
@@ -668,7 +668,7 @@ static int32_t getNextRowFromFSLast(void *iter, TSDBROW **ppRow, bool *pIgnoreEa
state
->
state
=
SFSLASTNEXTROW_FILESET
;
goto
_next_fileset
;
}
state
->
row
=
tMergeTreeGetRow
(
&
state
->
mergeTree
);
state
->
row
=
*
tMergeTreeGetRow
(
&
state
->
mergeTree
);
*
ppRow
=
&
state
->
row
;
if
(
TSDBROW_TS
(
&
state
->
row
)
<=
state
->
lastTs
)
{
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
81e54541
...
...
@@ -1870,8 +1870,8 @@ static bool nextRowFromLastBlocks(SLastBlockReader* pLastBlockReader, STableBloc
return
false
;
}
TSDBROW
r
ow
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
TSDBKEY
k
=
{.
version
=
row
.
version
,
.
ts
=
row
.
pBlockData
->
aTSKEY
[
row
.
iRow
]};
TSDBROW
*
pR
ow
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
TSDBKEY
k
=
{.
version
=
pRow
->
version
,
.
ts
=
pRow
->
pBlockData
->
aTSKEY
[
pRow
->
iRow
]};
pLastBlockReader
->
currentKey
=
k
.
ts
;
pScanInfo
->
lastKeyInStt
=
k
.
ts
;
...
...
@@ -2029,12 +2029,12 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
}
if
(
minKey
==
tsLast
)
{
TSDBROW
fRow1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
TSDBROW
*
fRow1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
if
(
init
)
{
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
&
fRow1
,
NULL
);
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
fRow1
,
NULL
);
}
else
{
init
=
true
;
int32_t
code
=
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
&
fRow1
,
pReader
->
pSchema
);
int32_t
code
=
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
fRow1
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -2081,12 +2081,12 @@ static int32_t doMergeBufAndFileRows(STsdbReader* pReader, STableBlockScanInfo*
}
if
(
minKey
==
tsLast
)
{
TSDBROW
fRow1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
TSDBROW
*
fRow1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
if
(
init
)
{
tsdbRowMergerAdd
(
pMerger
,
&
fRow1
,
NULL
);
tsdbRowMergerAdd
(
pMerger
,
fRow1
,
NULL
);
}
else
{
init
=
true
;
int32_t
code
=
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
&
fRow1
,
pReader
->
pSchema
);
int32_t
code
=
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
fRow1
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -2130,12 +2130,12 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
bool
copied
=
false
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
SRow
*
pTSRow
=
NULL
;
TSDBROW
f
Row
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
tsdbTrace
(
"fRow ptr:%p, %d, uid:%"
PRIu64
", %s"
,
fRow
.
pBlockData
,
fRow
.
iRow
,
pLastBlockReader
->
uid
,
pReader
->
idStr
);
TSDBROW
*
p
Row
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
tsdbTrace
(
"fRow ptr:%p, %d, uid:%"
PRIu64
", %s"
,
pRow
->
pBlockData
,
pRow
->
iRow
,
pLastBlockReader
->
uid
,
pReader
->
idStr
);
// only last block exists
if
((
!
mergeBlockData
)
||
(
tsLastBlock
!=
pBlockData
->
aTSKEY
[
pDumpInfo
->
rowIndex
]))
{
code
=
tryCopyDistinctRowFromSttBlock
(
&
f
Row
,
pLastBlockReader
,
pBlockScanInfo
,
tsLastBlock
,
pReader
,
&
copied
);
code
=
tryCopyDistinctRowFromSttBlock
(
p
Row
,
pLastBlockReader
,
pBlockScanInfo
,
tsLastBlock
,
pReader
,
&
copied
);
if
(
code
)
{
return
code
;
}
...
...
@@ -2144,13 +2144,13 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
pBlockScanInfo
->
lastKey
=
tsLastBlock
;
return
TSDB_CODE_SUCCESS
;
}
else
{
code
=
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
&
f
Row
,
pReader
->
pSchema
);
code
=
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
p
Row
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
TSDBROW
f
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
tsdbRowMergerAdd
(
pMerger
,
&
f
Row1
,
NULL
);
TSDBROW
*
p
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
tsdbRowMergerAdd
(
pMerger
,
p
Row1
,
NULL
);
doMergeRowsInLastBlock
(
pLastBlockReader
,
pBlockScanInfo
,
tsLastBlock
,
pMerger
,
&
pReader
->
verRange
,
pReader
->
idStr
);
code
=
tsdbRowMergerGetRow
(
pMerger
,
&
pTSRow
);
...
...
@@ -2168,7 +2168,7 @@ static int32_t doMergeFileBlockAndLastBlock(SLastBlockReader* pLastBlockReader,
}
}
}
else
{
// not merge block data
code
=
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
&
f
Row
,
pReader
->
pSchema
);
code
=
tsdbRowMergerAdd
(
&
pReader
->
status
.
merger
,
p
Row
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -2227,8 +2227,8 @@ static int32_t mergeFileBlockAndLastBlock(STsdbReader* pReader, SLastBlockReader
doMergeRowsInFileBlocks
(
pBlockData
,
pBlockScanInfo
,
pReader
);
TSDBROW
f
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
tsdbRowMergerAdd
(
pMerger
,
&
f
Row1
,
NULL
);
TSDBROW
*
p
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
tsdbRowMergerAdd
(
pMerger
,
p
Row1
,
NULL
);
doMergeRowsInLastBlock
(
pLastBlockReader
,
pBlockScanInfo
,
ts
,
pMerger
,
&
pReader
->
verRange
,
pReader
->
idStr
);
...
...
@@ -2337,12 +2337,12 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
}
if
(
minKey
==
tsLast
)
{
TSDBROW
f
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
TSDBROW
*
p
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
if
(
init
)
{
tsdbRowMergerAdd
(
pMerger
,
&
f
Row1
,
NULL
);
tsdbRowMergerAdd
(
pMerger
,
p
Row1
,
NULL
);
}
else
{
init
=
true
;
code
=
tsdbRowMergerAdd
(
pMerger
,
&
f
Row1
,
pReader
->
pSchema
);
code
=
tsdbRowMergerAdd
(
pMerger
,
p
Row1
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -2414,12 +2414,12 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
}
if
(
minKey
==
tsLast
)
{
TSDBROW
f
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
TSDBROW
*
p
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
if
(
init
)
{
tsdbRowMergerAdd
(
pMerger
,
&
f
Row1
,
NULL
);
tsdbRowMergerAdd
(
pMerger
,
p
Row1
,
NULL
);
}
else
{
init
=
true
;
code
=
tsdbRowMergerAdd
(
pMerger
,
&
f
Row1
,
pReader
->
pSchema
);
code
=
tsdbRowMergerAdd
(
pMerger
,
p
Row1
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -3827,8 +3827,8 @@ int32_t doMergeRowsInLastBlock(SLastBlockReader* pLastBlockReader, STableBlockSc
while
(
nextRowFromLastBlocks
(
pLastBlockReader
,
pScanInfo
,
pVerRange
))
{
int64_t
next1
=
getCurrentKeyInLastBlock
(
pLastBlockReader
);
if
(
next1
==
ts
)
{
TSDBROW
f
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
tsdbRowMergerAdd
(
pMerger
,
&
f
Row1
,
NULL
);
TSDBROW
*
p
Row1
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
tsdbRowMergerAdd
(
pMerger
,
p
Row1
,
NULL
);
}
else
{
tsdbTrace
(
"uid:%"
PRIu64
" last del index:%d, del range:%d, lastKeyInStt:%"
PRId64
", %s"
,
pScanInfo
->
uid
,
pScanInfo
->
lastBlockDelIndex
,
(
int32_t
)
taosArrayGetSize
(
pScanInfo
->
delSkyline
),
pScanInfo
->
lastKeyInStt
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录