Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2c5b5289
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看板
提交
2c5b5289
编写于
6月 09, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix more code
上级
74a09e27
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
38 deletion
+40
-38
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
+1
-1
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
+2
-0
source/dnode/vnode/src/tsdb/dev/tsdbIter.c
source/dnode/vnode/src/tsdb/dev/tsdbIter.c
+37
-37
未找到文件。
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
浏览文件 @
2c5b5289
...
...
@@ -57,7 +57,7 @@ int32_t tsdbDataFileReadBlockSma(SDataFileReader *reader);
int32_t
tsdbDataFileReadTombBlk
(
SDataFileReader
*
reader
,
const
TTombBlkArray
**
tombBlkArray
);
int32_t
tsdbDataFileReadTombBlock
(
SDataFileReader
*
reader
,
const
STombBlk
*
tombBlk
,
STombBlock
*
tData
);
#if
1
#if
0
int32_t tsdbDataFileReadBlockIdx(SDataFileReader *reader, const TBlockIdxArray **blockIdxArray);
int32_t tsdbDataFileReadDataBlk(SDataFileReader *reader, const SBlockIdx *blockIdx, const TDataBlkArray **dataBlkArray);
int32_t tsdbDataFileReadDataBlock(SDataFileReader *reader, const SDataBlk *dataBlk, SBlockData *bData);
...
...
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
浏览文件 @
2c5b5289
...
...
@@ -297,6 +297,7 @@ _exit:
return
code
;
}
#if 0
int32_t tsdbDataFileReadBlockIdx(SDataFileReader *reader, const TBlockIdxArray **blockIdxArray) {
int32_t code = 0;
int32_t lino = 0;
...
...
@@ -392,6 +393,7 @@ _exit:
}
return code;
}
#endif
int32_t
tsdbDataFileReadTombBlk
(
SDataFileReader
*
reader
,
const
TTombBlkArray
**
tombBlkArray
)
{
int32_t
code
=
0
;
...
...
source/dnode/vnode/src/tsdb/dev/tsdbIter.c
浏览文件 @
2c5b5289
...
...
@@ -35,13 +35,13 @@ struct STsdbIter {
int32_t
iRow
;
}
stt
[
1
];
struct
{
SDataFileReader
*
reader
;
const
TB
lockIdxArray
*
blockIdx
Array
;
int32_t
blockIdx
ArrayIdx
;
const
TDataBlkArray
*
dataBlkArray
;
int32_t
dataBlkArray
Idx
;
SBlockData
bData
[
1
];
int32_t
iRow
;
SDataFileReader
*
reader
;
const
TB
rinBlkArray
*
brinBlk
Array
;
int32_t
brinBlk
ArrayIdx
;
SBrinBlock
brinBlock
[
1
]
;
int32_t
brinBlock
Idx
;
SBlockData
bData
[
1
];
int32_t
iRow
;
}
data
[
1
];
struct
{
SMemTable
*
memt
;
...
...
@@ -118,6 +118,7 @@ static int32_t tsdbDataIterNext(STsdbIter *iter, const TABLEID *tbid) {
while
(
!
iter
->
ctx
->
noMoreData
)
{
for
(;;)
{
// SBlockData
for
(;
iter
->
data
->
iRow
<
iter
->
data
->
bData
->
nRow
;
iter
->
data
->
iRow
++
)
{
if
(
tbid
&&
tbid
->
suid
==
iter
->
data
->
bData
->
suid
&&
tbid
->
uid
==
iter
->
data
->
bData
->
uid
)
{
iter
->
data
->
iRow
=
iter
->
data
->
bData
->
nRow
;
...
...
@@ -129,51 +130,48 @@ static int32_t tsdbDataIterNext(STsdbIter *iter, const TABLEID *tbid) {
goto
_exit
;
}
if
(
iter
->
data
->
dataBlkArray
==
NULL
||
iter
->
data
->
dataBlkArrayIdx
>=
TARRAY2_SIZE
(
iter
->
data
->
dataBlkArray
))
{
// SBrinBlock
if
(
iter
->
data
->
brinBlockIdx
>=
BRIN_BLOCK_SIZE
(
iter
->
data
->
brinBlock
))
{
break
;
}
for
(;
iter
->
data
->
dataBlkArray
&&
iter
->
data
->
dataBlkArrayIdx
<
TARRAY2_SIZE
(
iter
->
data
->
dataBlkArray
);
iter
->
data
->
dataBlkArrayIdx
++
)
{
const
SDataBlk
*
dataBlk
=
TARRAY2_GET_PTR
(
iter
->
data
->
dataBlkArray
,
iter
->
data
->
dataBlkArrayIdx
);
if
(
tbid
)
{
const
SBlockIdx
*
blockIdx
=
TARRAY2_GET_PTR
(
iter
->
data
->
blockIdxArray
,
iter
->
data
->
blockIdxArrayIdx
-
1
);
for
(;
iter
->
data
->
brinBlockIdx
<
BRIN_BLOCK_SIZE
(
iter
->
data
->
brinBlock
);
iter
->
data
->
brinBlockIdx
++
)
{
SBrinRecord
record
[
1
];
tBrinBlockGet
(
iter
->
data
->
brinBlock
,
iter
->
data
->
brinBlockIdx
,
record
);
if
(
tbid
->
suid
==
blockIdx
->
suid
&&
tbid
->
uid
==
blockIdx
->
uid
)
{
iter
->
data
->
dataBlkArrayIdx
=
TARRAY2_SIZE
(
iter
->
data
->
dataBlkArray
);
break
;
}
if
(
tbid
&&
tbid
->
suid
==
record
->
suid
&&
tbid
->
uid
==
record
->
uid
)
{
continue
;
}
code
=
tsdbDataFileReadDataBlock
(
iter
->
data
->
reader
,
dataBlk
,
iter
->
data
->
bData
);
iter
->
row
->
suid
=
record
->
suid
;
iter
->
row
->
uid
=
record
->
uid
;
code
=
tsdbDataFileReadBlockData
(
iter
->
data
->
reader
,
record
,
iter
->
data
->
bData
);
if
(
code
)
return
code
;
iter
->
data
->
iRow
=
0
;
iter
->
data
->
dataBlkArray
Idx
++
;
iter
->
data
->
brinBlock
Idx
++
;
break
;
}
}
if
(
iter
->
data
->
b
lockIdxArrayIdx
>=
TARRAY2_SIZE
(
iter
->
data
->
blockIdx
Array
))
{
if
(
iter
->
data
->
b
rinBlkArrayIdx
>=
TARRAY2_SIZE
(
iter
->
data
->
brinBlk
Array
))
{
iter
->
ctx
->
noMoreData
=
true
;
break
;
}
for
(;
iter
->
data
->
b
lockIdxArrayIdx
<
TARRAY2_SIZE
(
iter
->
data
->
blockIdxArray
);
iter
->
data
->
blockIdx
ArrayIdx
++
)
{
const
SB
lockIdx
*
blockIdx
=
TARRAY2_GET_PTR
(
iter
->
data
->
blockIdxArray
,
iter
->
data
->
blockIdx
ArrayIdx
);
for
(;
iter
->
data
->
b
rinBlkArrayIdx
<
TARRAY2_SIZE
(
iter
->
data
->
brinBlkArray
);
iter
->
data
->
brinBlk
ArrayIdx
++
)
{
const
SB
rinBlk
*
brinBlk
=
TARRAY2_GET_PTR
(
iter
->
data
->
brinBlkArray
,
iter
->
data
->
brinBlk
ArrayIdx
);
if
(
tbid
&&
tbid
->
suid
==
blockIdx
->
suid
&&
tbid
->
uid
==
blockIdx
->
uid
)
{
if
(
tbid
&&
tbid
->
uid
==
brinBlk
->
minTbid
.
uid
&&
tbid
->
uid
==
brinBlk
->
maxTbid
.
uid
)
{
continue
;
}
code
=
tsdbDataFileRead
DataBlk
(
iter
->
data
->
reader
,
blockIdx
,
&
iter
->
data
->
dataBlkArray
);
code
=
tsdbDataFileRead
BrinBlock
(
iter
->
data
->
reader
,
brinBlk
,
iter
->
data
->
brinBlock
);
if
(
code
)
return
code
;
iter
->
row
->
suid
=
blockIdx
->
suid
;
iter
->
row
->
uid
=
blockIdx
->
uid
;
iter
->
data
->
dataBlkArrayIdx
=
0
;
iter
->
data
->
blockIdxArrayIdx
++
;
iter
->
data
->
brinBlockIdx
=
0
;
iter
->
data
->
brinBlkArrayIdx
++
;
break
;
}
}
...
...
@@ -290,19 +288,20 @@ static int32_t tsdbSttIterOpen(STsdbIter *iter) {
static
int32_t
tsdbDataIterOpen
(
STsdbIter
*
iter
)
{
int32_t
code
;
code
=
tsdbDataFileReadBlockIdx
(
iter
->
data
->
reader
,
&
iter
->
data
->
blockIdxArray
);
// SBrinBlk
code
=
tsdbDataFileReadBrinBlk
(
iter
->
data
->
reader
,
&
iter
->
data
->
brinBlkArray
);
if
(
code
)
return
code
;
// SBlockIdx
if
(
TARRAY2_SIZE
(
iter
->
data
->
blockIdxArray
)
==
0
)
{
if
(
TARRAY2_SIZE
(
iter
->
data
->
brinBlkArray
)
==
0
)
{
iter
->
ctx
->
noMoreData
=
true
;
return
0
;
}
iter
->
data
->
blockIdxArrayIdx
=
0
;
// SDataBlk
iter
->
data
->
dataBlkArray
=
NULL
;
iter
->
data
->
dataBlkArrayIdx
=
0
;
iter
->
data
->
brinBlkArrayIdx
=
0
;
// SBrinBlock
tBrinBlockInit
(
iter
->
data
->
brinBlock
);
iter
->
data
->
brinBlockIdx
=
0
;
// SBlockData
tBlockDataCreate
(
iter
->
data
->
bData
);
...
...
@@ -331,7 +330,7 @@ static int32_t tsdbDataTombIterOpen(STsdbIter *iter) {
iter
->
ctx
->
noMoreData
=
true
;
return
0
;
}
iter
->
data
->
blockIdx
ArrayIdx
=
0
;
iter
->
data
Tomb
->
tombBlk
ArrayIdx
=
0
;
tTombBlockInit
(
iter
->
dataTomb
->
tData
);
iter
->
dataTomb
->
iRow
=
0
;
...
...
@@ -340,6 +339,7 @@ static int32_t tsdbDataTombIterOpen(STsdbIter *iter) {
}
static
int32_t
tsdbDataIterClose
(
STsdbIter
*
iter
)
{
tBrinBlockDestroy
(
iter
->
data
->
brinBlock
);
tBlockDataDestroy
(
iter
->
data
->
bData
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录