Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d4f4ac1d
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看板
提交
d4f4ac1d
编写于
5月 31, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
dc890126
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
24 deletion
+24
-24
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
+9
-9
source/dnode/vnode/src/tsdb/dev/tsdbIter.c
source/dnode/vnode/src/tsdb/dev/tsdbIter.c
+2
-2
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
+3
-3
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
+10
-10
未找到文件。
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFileRW.h
浏览文件 @
d4f4ac1d
...
...
@@ -35,18 +35,18 @@ typedef TARRAY2(SSttFileReader *) TSttFileReaderArray;
typedef
TARRAY2
(
SSttSegReader
*
)
TSttSegReaderArray
;
// SSttFileReader
int32_t
tsdbSttFReaderOpen
(
const
char
*
fname
,
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
);
int32_t
tsdbSttFReaderClose
(
SSttFileReader
**
reader
);
int32_t
tsdbSttFReaderGetSegReader
(
SSttFileReader
*
reader
,
const
TSttSegReaderArray
**
readerArray
);
int32_t
tsdbSttF
ile
ReaderOpen
(
const
char
*
fname
,
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
);
int32_t
tsdbSttF
ile
ReaderClose
(
SSttFileReader
**
reader
);
int32_t
tsdbSttF
ile
ReaderGetSegReader
(
SSttFileReader
*
reader
,
const
TSttSegReaderArray
**
readerArray
);
// SSttSegReader
int32_t
tsdbSttFReadSttBlk
(
SSttSegReader
*
reader
,
const
TSttBlkArray
**
sttBlkArray
);
int32_t
tsdbSttFReadDelBlk
(
SSttSegReader
*
reader
,
const
TDelBlkArray
**
delBlkArray
);
int32_t
tsdbSttFReadStatisBlk
(
SSttSegReader
*
reader
,
const
TStatisBlkArray
**
statisBlkArray
);
int32_t
tsdbSttF
ile
ReadSttBlk
(
SSttSegReader
*
reader
,
const
TSttBlkArray
**
sttBlkArray
);
int32_t
tsdbSttF
ile
ReadDelBlk
(
SSttSegReader
*
reader
,
const
TDelBlkArray
**
delBlkArray
);
int32_t
tsdbSttF
ile
ReadStatisBlk
(
SSttSegReader
*
reader
,
const
TStatisBlkArray
**
statisBlkArray
);
int32_t
tsdbSttFReadSttBlock
(
SSttSegReader
*
reader
,
const
SSttBlk
*
sttBlk
,
SBlockData
*
bData
);
int32_t
tsdbSttFReadDelBlock
(
SSttSegReader
*
reader
,
const
SDelBlk
*
delBlk
,
SDelBlock
*
dData
);
int32_t
tsdbSttFReadStatisBlock
(
SSttSegReader
*
reader
,
const
STbStatisBlk
*
statisBlk
,
STbStatisBlock
*
sData
);
int32_t
tsdbSttF
ile
ReadSttBlock
(
SSttSegReader
*
reader
,
const
SSttBlk
*
sttBlk
,
SBlockData
*
bData
);
int32_t
tsdbSttF
ile
ReadDelBlock
(
SSttSegReader
*
reader
,
const
SDelBlk
*
delBlk
,
SDelBlock
*
dData
);
int32_t
tsdbSttF
ile
ReadStatisBlock
(
SSttSegReader
*
reader
,
const
STbStatisBlk
*
statisBlk
,
STbStatisBlock
*
sData
);
struct
SSttFileReaderConfig
{
STsdb
*
tsdb
;
...
...
source/dnode/vnode/src/tsdb/dev/tsdbIter.c
浏览文件 @
d4f4ac1d
...
...
@@ -77,7 +77,7 @@ static int32_t tsdbSttIterNext(STsdbIter *iter, const TABLEID *tbid) {
continue
;
}
int32_t
code
=
tsdbSttFReadSttBlock
(
iter
->
stt
->
reader
,
sttBlk
,
iter
->
stt
->
bData
);
int32_t
code
=
tsdbSttF
ile
ReadSttBlock
(
iter
->
stt
->
reader
,
sttBlk
,
iter
->
stt
->
bData
);
if
(
code
)
return
code
;
iter
->
stt
->
iRow
=
0
;
...
...
@@ -200,7 +200,7 @@ _exit:
static
int32_t
tsdbSttIterOpen
(
STsdbIter
*
iter
)
{
int32_t
code
;
code
=
tsdbSttFReadSttBlk
(
iter
->
stt
->
reader
,
&
iter
->
stt
->
sttBlkArray
);
code
=
tsdbSttF
ile
ReadSttBlk
(
iter
->
stt
->
reader
,
&
iter
->
stt
->
sttBlkArray
);
if
(
code
)
return
code
;
if
(
TARRAY2_SIZE
(
iter
->
stt
->
sttBlkArray
)
==
0
)
{
...
...
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
浏览文件 @
d4f4ac1d
...
...
@@ -229,7 +229,7 @@ static int32_t tsdbMergeFileSetBeginOpenReader(SMerger *merger) {
.
szPage
=
merger
->
szPage
,
.
file
[
0
]
=
merger
->
ctx
->
fobj
->
f
[
0
],
}};
code
=
tsdbSttFReaderOpen
(
merger
->
ctx
->
fobj
->
fname
,
config
,
&
reader
);
code
=
tsdbSttF
ile
ReaderOpen
(
merger
->
ctx
->
fobj
->
fname
,
config
,
&
reader
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
TARRAY2_APPEND
(
merger
->
sttReaderArr
,
reader
);
...
...
@@ -253,7 +253,7 @@ static int32_t tsdbMergeFileSetBeginOpenIter(SMerger *merger) {
TARRAY2_FOREACH
(
merger
->
sttReaderArr
,
sttReader
)
{
const
TSttSegReaderArray
*
segReaderArr
;
code
=
tsdbSttFReaderGetSegReader
(
sttReader
,
&
segReaderArr
);
code
=
tsdbSttF
ile
ReaderGetSegReader
(
sttReader
,
&
segReaderArr
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
SSttSegReader
*
segReader
;
...
...
@@ -450,7 +450,7 @@ static int32_t tsdbMergeFileSetEndCloseIter(SMerger *merger) {
}
static
int32_t
tsdbMergeFileSetEndCloseReader
(
SMerger
*
merger
)
{
TARRAY2_CLEAR
(
merger
->
sttReaderArr
,
tsdbSttFReaderClose
);
TARRAY2_CLEAR
(
merger
->
sttReaderArr
,
tsdbSttF
ile
ReaderClose
);
return
0
;
}
...
...
source/dnode/vnode/src/tsdb/dev/tsdbSttFileRW.c
浏览文件 @
d4f4ac1d
...
...
@@ -84,7 +84,7 @@ static int32_t tsdbSttSegReaderClose(SSttSegReader **reader) {
return
0
;
}
int32_t
tsdbSttFReaderOpen
(
const
char
*
fname
,
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
)
{
int32_t
tsdbSttF
ile
ReaderOpen
(
const
char
*
fname
,
const
SSttFileReaderConfig
*
config
,
SSttFileReader
**
reader
)
{
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
config
->
tsdb
->
pVnode
);
...
...
@@ -117,12 +117,12 @@ int32_t tsdbSttFReaderOpen(const char *fname, const SSttFileReaderConfig *config
_exit:
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
tsdbSttFReaderClose
(
reader
);
tsdbSttF
ile
ReaderClose
(
reader
);
}
return
code
;
}
int32_t
tsdbSttFReaderClose
(
SSttFileReader
**
reader
)
{
int32_t
tsdbSttF
ile
ReaderClose
(
SSttFileReader
**
reader
)
{
tsdbCloseFile
(
&
reader
[
0
]
->
fd
);
TARRAY2_CLEAR_FREE
(
reader
[
0
]
->
readerArray
,
tsdbSttSegReaderClose
);
taosMemoryFree
(
reader
[
0
]);
...
...
@@ -130,13 +130,13 @@ int32_t tsdbSttFReaderClose(SSttFileReader **reader) {
return
0
;
}
int32_t
tsdbSttFReaderGetSegReader
(
SSttFileReader
*
reader
,
const
TSttSegReaderArray
**
readerArray
)
{
int32_t
tsdbSttF
ile
ReaderGetSegReader
(
SSttFileReader
*
reader
,
const
TSttSegReaderArray
**
readerArray
)
{
readerArray
[
0
]
=
reader
->
readerArray
;
return
0
;
}
// SSttFSegReader
int32_t
tsdbSttFReadStatisBlk
(
SSttSegReader
*
reader
,
const
TStatisBlkArray
**
statisBlkArray
)
{
int32_t
tsdbSttF
ile
ReadStatisBlk
(
SSttSegReader
*
reader
,
const
TStatisBlkArray
**
statisBlkArray
)
{
if
(
!
reader
->
ctx
.
statisBlkLoaded
)
{
if
(
reader
->
footer
->
statisBlkPtr
->
size
>
0
)
{
ASSERT
(
reader
->
footer
->
statisBlkPtr
->
size
%
sizeof
(
STbStatisBlk
)
==
0
);
...
...
@@ -161,7 +161,7 @@ int32_t tsdbSttFReadStatisBlk(SSttSegReader *reader, const TStatisBlkArray **sta
return
0
;
}
int32_t
tsdbSttFReadDelBlk
(
SSttSegReader
*
reader
,
const
TDelBlkArray
**
delBlkArray
)
{
int32_t
tsdbSttF
ile
ReadDelBlk
(
SSttSegReader
*
reader
,
const
TDelBlkArray
**
delBlkArray
)
{
if
(
!
reader
->
ctx
.
delBlkLoaded
)
{
if
(
reader
->
footer
->
delBlkPtr
->
size
>
0
)
{
ASSERT
(
reader
->
footer
->
delBlkPtr
->
size
%
sizeof
(
SDelBlk
)
==
0
);
...
...
@@ -186,7 +186,7 @@ int32_t tsdbSttFReadDelBlk(SSttSegReader *reader, const TDelBlkArray **delBlkArr
return
0
;
}
int32_t
tsdbSttFReadSttBlk
(
SSttSegReader
*
reader
,
const
TSttBlkArray
**
sttBlkArray
)
{
int32_t
tsdbSttF
ile
ReadSttBlk
(
SSttSegReader
*
reader
,
const
TSttBlkArray
**
sttBlkArray
)
{
if
(
!
reader
->
ctx
.
sttBlkLoaded
)
{
if
(
reader
->
footer
->
sttBlkPtr
->
size
>
0
)
{
ASSERT
(
reader
->
footer
->
sttBlkPtr
->
size
%
sizeof
(
SSttBlk
)
==
0
);
...
...
@@ -211,13 +211,13 @@ int32_t tsdbSttFReadSttBlk(SSttSegReader *reader, const TSttBlkArray **sttBlkArr
return
0
;
}
int32_t
tsdbSttFReadSttBlock
(
SSttSegReader
*
reader
,
const
SSttBlk
*
sttBlk
,
SBlockData
*
bData
)
{
int32_t
tsdbSttF
ile
ReadSttBlock
(
SSttSegReader
*
reader
,
const
SSttBlk
*
sttBlk
,
SBlockData
*
bData
)
{
int32_t
code
=
0
;
// TODO
return
code
;
}
int32_t
tsdbSttFReadDelBlock
(
SSttSegReader
*
reader
,
const
SDelBlk
*
delBlk
,
SDelBlock
*
dData
)
{
int32_t
tsdbSttF
ile
ReadDelBlock
(
SSttSegReader
*
reader
,
const
SDelBlk
*
delBlk
,
SDelBlock
*
dData
)
{
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
reader
->
reader
->
config
->
tsdb
->
pVnode
);
...
...
@@ -246,7 +246,7 @@ _exit:
return
code
;
}
int32_t
tsdbSttFReadStatisBlock
(
SSttSegReader
*
reader
,
const
STbStatisBlk
*
statisBlk
,
STbStatisBlock
*
sData
)
{
int32_t
tsdbSttF
ile
ReadStatisBlock
(
SSttSegReader
*
reader
,
const
STbStatisBlk
*
statisBlk
,
STbStatisBlock
*
sData
)
{
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
reader
->
reader
->
config
->
tsdb
->
pVnode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录