Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f5286359
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看板
提交
f5286359
编写于
5月 26, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
7acc124d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
100 addition
and
27 deletion
+100
-27
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFReaderWriter.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFReaderWriter.h
+5
-0
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFReaderWriter.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFReaderWriter.h
+2
-2
source/dnode/vnode/src/tsdb/dev/tsdbDataFReaderWriter.c
source/dnode/vnode/src/tsdb/dev/tsdbDataFReaderWriter.c
+49
-1
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
+44
-24
未找到文件。
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFReaderWriter.h
浏览文件 @
f5286359
...
...
@@ -30,6 +30,11 @@ typedef struct SDataFileReaderConfig SDataFileReaderConfig;
typedef
struct
SDataFileWriter
SDataFileWriter
;
typedef
struct
SDataFileWriterConfig
SDataFileWriterConfig
;
int32_t
tsdbDataFileWriterOpen
(
const
SDataFileWriterConfig
*
config
,
SDataFileWriter
**
ppWriter
);
int32_t
tsdbDataFileWriterClose
(
SDataFileWriter
*
pWriter
);
int32_t
tsdbDataFileWriteTSData
(
SDataFileWriter
*
pWriter
,
SBlockData
*
pBlockData
);
int32_t
tsdbDataFileWriteTSDataBlock
(
SDataFileWriter
*
pWriter
,
SBlockData
*
pBlockData
);
struct
SDataFileReaderConfig
{
STsdb
*
pTsdb
;
// TODO
...
...
source/dnode/vnode/src/tsdb/dev/inc/tsdbSttFReaderWriter.h
浏览文件 @
f5286359
...
...
@@ -22,7 +22,7 @@
extern
"C"
{
#endif
// SSttFReader ==========================================
// SSttF
ile
Reader ==========================================
typedef
struct
SSttFSegReader
SSttFSegReader
;
typedef
struct
SSttFileReader
SSttFileReader
;
typedef
struct
SSttFileReaderConfig
SSttFileReaderConfig
;
...
...
@@ -50,7 +50,7 @@ struct SSttFileReaderConfig {
// TODO
};
// SSttFWriter ==========================================
// SSttF
ile
Writer ==========================================
typedef
struct
SSttFileWriter
SSttFileWriter
;
typedef
struct
SSttFileWriterConfig
SSttFileWriterConfig
;
...
...
source/dnode/vnode/src/tsdb/dev/tsdbDataFReaderWriter.c
浏览文件 @
f5286359
...
...
@@ -23,4 +23,52 @@ struct SDataFileReader {
// SDataFileWriter =============================================
struct
SDataFileWriter
{
// TODO
};
\ No newline at end of file
};
int32_t
tsdbDataFileWriterOpen
(
const
SDataFileWriterConfig
*
config
,
SDataFileWriter
**
ppWriter
)
{
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
TD_VID
(
config
->
pTsdb
->
pVnode
);
// TODO
_exit:
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
return
code
;
}
int32_t
tsdbDataFileWriterClose
(
SDataFileWriter
*
pWriter
)
{
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
0
;
// TODO: TD_VID(config->pTsdb->pVnode);
// TODO
_exit:
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
return
code
;
}
int32_t
tsdbDataFileWriteTSData
(
SDataFileWriter
*
pWriter
,
SBlockData
*
pBlockData
)
{
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
0
;
// TODO: TD_VID(config->pTsdb->pVnode);
// TODO
_exit:
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
return
code
;
}
int32_t
tsdbDataFileWriteTSDataBlock
(
SDataFileWriter
*
pWriter
,
SBlockData
*
pBlockData
)
{
int32_t
code
=
0
;
int32_t
lino
=
0
;
int32_t
vid
=
0
;
// TODO: TD_VID(config->pTsdb->pVnode);
// TODO
_exit:
if
(
code
)
{
tsdbError
(
"vgId:%d %s failed at line %d since %s"
,
vid
,
__func__
,
lino
,
tstrerror
(
code
));
}
return
code
;
}
\ No newline at end of file
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
浏览文件 @
f5286359
...
...
@@ -197,9 +197,13 @@ static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
merger
->
ctx
.
level
++
;
// open the reader
SSttFileReader
*
reader
;
// code = tsdbSttFileReaderOpen(&fobj->f.stt, &reader);
// TSDB_CHECK_CODE(code, lino, _exit);
SSttFileReader
*
reader
;
SSttFileReaderConfig
config
=
{
.
pTsdb
=
merger
->
tsdb
,
// TODO
};
code
=
tsdbSttFReaderOpen
(
&
config
,
&
reader
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
code
=
TARRAY2_APPEND
(
&
merger
->
sttReaderArr
,
reader
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
...
...
@@ -216,34 +220,50 @@ static int32_t tsdbMergeFileSetBegin(SMerger *merger) {
}
// open stt file writer
SSttFileWriterConfig
config
=
{
.
pTsdb
=
merger
->
tsdb
,
.
maxRow
=
merger
->
maxRow
,
.
szPage
=
merger
->
szPage
,
.
cmprAlg
=
merger
->
cmprAlg
,
.
pSkmTb
=
&
merger
->
skmTb
,
.
pSkmRow
=
&
merger
->
skmRow
,
.
aBuf
=
merger
->
aBuf
,
};
if
(
lvl
)
{
config
.
file
=
fobj
->
f
;
SSttFileWriterConfig
config
=
{
.
pTsdb
=
merger
->
tsdb
,
.
maxRow
=
merger
->
maxRow
,
.
szPage
=
merger
->
szPage
,
.
cmprAlg
=
merger
->
cmprAlg
,
.
pSkmTb
=
&
merger
->
skmTb
,
.
pSkmRow
=
&
merger
->
skmRow
,
.
aBuf
=
merger
->
aBuf
,
.
file
=
fobj
->
f
,
};
code
=
tsdbSttFWriterOpen
(
&
config
,
&
merger
->
sttWriter
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
else
{
config
.
file
=
(
STFile
){
.
type
=
TSDB_FTYPE_STT
,
.
did
=
{.
level
=
0
,
.
id
=
0
},
.
fid
=
fset
->
fid
,
.
cid
=
merger
->
cid
,
.
size
=
0
,
.
stt
=
{.
level
=
merger
->
ctx
.
level
,
.
nseg
=
0
},
SSttFileWriterConfig
config
=
{
.
pTsdb
=
merger
->
tsdb
,
.
maxRow
=
merger
->
maxRow
,
.
szPage
=
merger
->
szPage
,
.
cmprAlg
=
merger
->
cmprAlg
,
.
pSkmTb
=
&
merger
->
skmTb
,
.
pSkmRow
=
&
merger
->
skmRow
,
.
aBuf
=
merger
->
aBuf
,
.
file
=
(
STFile
){
.
type
=
TSDB_FTYPE_STT
,
.
did
=
{.
level
=
0
,
.
id
=
0
},
.
fid
=
fset
->
fid
,
.
cid
=
merger
->
cid
,
.
size
=
0
,
.
stt
=
{.
level
=
merger
->
ctx
.
level
,
.
nseg
=
0
},
},
};
code
=
tsdbSttFWriterOpen
(
&
config
,
&
merger
->
sttWriter
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
code
=
tsdbSttFWriterOpen
(
&
config
,
&
merger
->
sttWriter
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
// open data file writer
if
(
merger
->
ctx
.
toData
)
{
// code = tsdbDataFWriterOpen();
// TSDB_CHECK_CODE(code, lino, _exit);
SDataFileWriterConfig
config
=
{
.
pTsdb
=
merger
->
tsdb
,
// TODO
};
code
=
tsdbDataFileWriterOpen
(
&
config
,
&
merger
->
dataWriter
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
_exit:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录