Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
05d16920
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看板
提交
05d16920
编写于
4月 25, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
d8762b9b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
7 addition
and
6 deletion
+7
-6
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+7
-6
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
05d16920
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#include "tsimplehash.h"
#include "tsimplehash.h"
#define ASCENDING_TRAVERSE(o) (o == TSDB_ORDER_ASC)
#define ASCENDING_TRAVERSE(o) (o == TSDB_ORDER_ASC)
#define getCurrentKeyInLastBlock(_r) ((_r)->currentKey)
typedef
enum
{
typedef
enum
{
EXTERNAL_ROWS_PREV
=
0x1
,
EXTERNAL_ROWS_PREV
=
0x1
,
...
@@ -108,6 +109,7 @@ typedef struct SLastBlockReader {
...
@@ -108,6 +109,7 @@ typedef struct SLastBlockReader {
uint64_t
uid
;
uint64_t
uid
;
SMergeTree
mergeTree
;
SMergeTree
mergeTree
;
SSttBlockLoadInfo
*
pInfo
;
SSttBlockLoadInfo
*
pInfo
;
int64_t
currentKey
;
}
SLastBlockReader
;
}
SLastBlockReader
;
typedef
struct
SFilesetIter
{
typedef
struct
SFilesetIter
{
...
@@ -234,7 +236,6 @@ static int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, STsdb
...
@@ -234,7 +236,6 @@ static int32_t initDelSkylineIterator(STableBlockScanInfo* pBlockScanInfo, STsdb
static
STsdb
*
getTsdbByRetentions
(
SVnode
*
pVnode
,
TSKEY
winSKey
,
SRetention
*
retentions
,
const
char
*
idstr
,
static
STsdb
*
getTsdbByRetentions
(
SVnode
*
pVnode
,
TSKEY
winSKey
,
SRetention
*
retentions
,
const
char
*
idstr
,
int8_t
*
pLevel
);
int8_t
*
pLevel
);
static
SVersionRange
getQueryVerRange
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
int8_t
level
);
static
SVersionRange
getQueryVerRange
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
int8_t
level
);
static
int64_t
getCurrentKeyInLastBlock
(
SLastBlockReader
*
pLastBlockReader
);
static
bool
hasDataInLastBlock
(
SLastBlockReader
*
pLastBlockReader
);
static
bool
hasDataInLastBlock
(
SLastBlockReader
*
pLastBlockReader
);
static
int32_t
doBuildDataBlock
(
STsdbReader
*
pReader
);
static
int32_t
doBuildDataBlock
(
STsdbReader
*
pReader
);
static
TSDBKEY
getCurrentKeyInBuf
(
STableBlockScanInfo
*
pScanInfo
,
STsdbReader
*
pReader
);
static
TSDBKEY
getCurrentKeyInBuf
(
STableBlockScanInfo
*
pScanInfo
,
STsdbReader
*
pReader
);
...
@@ -1870,7 +1871,8 @@ static bool nextRowFromLastBlocks(SLastBlockReader* pLastBlockReader, STableBloc
...
@@ -1870,7 +1871,8 @@ static bool nextRowFromLastBlocks(SLastBlockReader* pLastBlockReader, STableBloc
}
}
TSDBROW
row
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
TSDBROW
row
=
tMergeTreeGetRow
(
&
pLastBlockReader
->
mergeTree
);
TSDBKEY
k
=
TSDBROW_KEY
(
&
row
);
TSDBKEY
k
=
{.
version
=
row
.
version
,
.
ts
=
row
.
pBlockData
->
aTSKEY
[
row
.
iRow
]};
pLastBlockReader
->
currentKey
=
k
.
ts
;
pScanInfo
->
lastKeyInStt
=
k
.
ts
;
pScanInfo
->
lastKeyInStt
=
k
.
ts
;
if
(
!
hasBeenDropped
(
pScanInfo
->
delSkyline
,
&
pScanInfo
->
lastBlockDelIndex
,
&
k
,
pLastBlockReader
->
order
,
pVerRange
))
{
if
(
!
hasBeenDropped
(
pScanInfo
->
delSkyline
,
&
pScanInfo
->
lastBlockDelIndex
,
&
k
,
pLastBlockReader
->
order
,
pVerRange
))
{
...
@@ -2582,10 +2584,9 @@ static bool initLastBlockReader(SLastBlockReader* pLBlockReader, STableBlockScan
...
@@ -2582,10 +2584,9 @@ static bool initLastBlockReader(SLastBlockReader* pLBlockReader, STableBlockScan
return
nextRowFromLastBlocks
(
pLBlockReader
,
pScanInfo
,
&
pReader
->
verRange
);
return
nextRowFromLastBlocks
(
pLBlockReader
,
pScanInfo
,
&
pReader
->
verRange
);
}
}
static
int64_t
getCurrentKeyInLastBlock
(
SLastBlockReader
*
pLastBlockReader
)
{
//static int64_t getCurrentKeyInLastBlock(SLastBlockReader* pLastBlockReader) {
TSDBROW
*
pRow
=
&
tMergeTreeGetRow
((
&
(
pLastBlockReader
)
->
mergeTree
));
// return pLastBlockReader->currentKey;
return
pRow
->
pBlockData
->
aTSKEY
[
pRow
->
iRow
];
//}
}
static
bool
hasDataInLastBlock
(
SLastBlockReader
*
pLastBlockReader
)
{
return
pLastBlockReader
->
mergeTree
.
pIter
!=
NULL
;
}
static
bool
hasDataInLastBlock
(
SLastBlockReader
*
pLastBlockReader
)
{
return
pLastBlockReader
->
mergeTree
.
pIter
!=
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录