Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a2dafefe
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a2dafefe
编写于
6月 02, 2023
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more code
上级
33afb08e
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
405 addition
and
137 deletion
+405
-137
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
+19
-14
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
+363
-81
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
+23
-42
未找到文件。
source/dnode/vnode/src/tsdb/dev/inc/tsdbDataFileRW.h
浏览文件 @
a2dafefe
...
...
@@ -32,31 +32,36 @@ typedef TARRAY2(SColumnDataAgg) TColumnDataAggArray;
typedef
struct
SDataFileReader
SDataFileReader
;
typedef
struct
SDataFileReaderConfig
{
STsdb
*
tsdb
;
STFile
f
[
TSDB_FTYPE_MAX
];
int32_t
szPage
;
struct
{
bool
exist
;
STFile
file
;
}
files
[
TSDB_FTYPE_MAX
];
uint8_t
**
bufArr
;
}
SDataFileReaderConfig
;
int32_t
tsdbDataFileReaderOpen
(
const
char
*
fname
[
/* TSDB_FTYPE_MAX */
],
const
SDataFileReaderConfig
*
config
,
SDataFileReader
**
reader
);
int32_t
tsdbDataFileReaderClose
(
SDataFileReader
*
reader
);
int32_t
tsdbDataFileReaderClose
(
SDataFileReader
*
*
reader
);
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
);
int32_t
tsdbDataFileReadDelData
(
SDataFileReader
*
reader
,
const
SDelBlk
*
delBlk
,
SDelData
*
dData
);
// SDataFileWriter =============================================
typedef
struct
SDataFileWriter
SDataFileWriter
;
typedef
struct
SDataFileWriterConfig
{
STsdb
*
tsdb
;
bool
hasOldFile
;
STFile
of
[
TSDB_FTYPE_MAX
];
int8_t
cmprAlg
;
int32_t
maxRow
;
int32_t
szPage
;
int64_t
cid
;
SDiskID
did
[
1
];
int64_t
compactVersion
;
STsdb
*
tsdb
;
int8_t
cmprAlg
;
int32_t
maxRow
;
int32_t
szPage
;
int32_t
fid
;
int64_t
cid
;
SDiskID
did
;
int64_t
compactVersion
;
struct
{
bool
exist
;
STFile
file
;
}
files
[
TSDB_FTYPE_MAX
];
SSkmInfo
*
skmTb
;
SSkmInfo
*
skmRow
;
uint8_t
**
bufArr
;
...
...
@@ -66,7 +71,7 @@ int32_t tsdbDataFileWriterOpen(const SDataFileWriterConfig *config, SDataFileWri
int32_t
tsdbDataFileWriterClose
(
SDataFileWriter
**
writer
,
bool
abort
,
STFileOp
op
[
/*TSDB_FTYPE_MAX*/
]);
int32_t
tsdbDataFileWriteTSData
(
SDataFileWriter
*
writer
,
SRowInfo
*
row
);
int32_t
tsdbDataFileWriteTSDataBlock
(
SDataFileWriter
*
writer
,
SBlockData
*
bData
);
int32_t
tsdbDataFileF
L
ushTSDataBlock
(
SDataFileWriter
*
writer
);
int32_t
tsdbDataFileF
l
ushTSDataBlock
(
SDataFileWriter
*
writer
);
#ifdef __cplusplus
}
...
...
source/dnode/vnode/src/tsdb/dev/tsdbDataFileRW.c
浏览文件 @
a2dafefe
此差异已折叠。
点击以展开。
source/dnode/vnode/src/tsdb/dev/tsdbMerge.c
浏览文件 @
a2dafefe
...
...
@@ -127,7 +127,7 @@ static int32_t tsdbMergeToDataTableEnd(SMerger *merger) {
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
code
=
tsdbDataFileF
L
ushTSDataBlock
(
merger
->
dataWriter
);
code
=
tsdbDataFileF
l
ushTSDataBlock
(
merger
->
dataWriter
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
for
(
int32_t
i
=
numRow
;
i
<
merger
->
ctx
->
bData
[
pidx
].
nRow
;
i
++
)
{
...
...
@@ -406,54 +406,35 @@ static int32_t tsdbMergeFileSetBeginOpenWriter(SMerger *merger) {
}
if
(
merger
->
ctx
->
toData
)
{
// TODO
SDiskID
did
[
1
];
SDiskID
did
;
int32_t
level
=
tsdbFidLevel
(
merger
->
ctx
->
fset
->
fid
,
&
merger
->
tsdb
->
keepCfg
,
merger
->
ctx
->
now
);
if
(
tfsAllocDisk
(
merger
->
tsdb
->
pVnode
->
pTfs
,
level
,
did
)
<
0
)
{
if
(
tfsAllocDisk
(
merger
->
tsdb
->
pVnode
->
pTfs
,
level
,
&
did
)
<
0
)
{
code
=
TSDB_CODE_FS_NO_VALID_DISK
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
SDataFileWriterConfig
config
=
{
SDataFileWriterConfig
config
[
1
]
=
{
{
.
tsdb
=
merger
->
tsdb
,
.
cmprAlg
=
merger
->
cmprAlg
,
.
maxRow
=
merger
->
maxRow
,
.
of
=
{
[
0
]
=
{
.
type
=
TSDB_FTYPE_HEAD
,
.
did
=
did
[
0
],
.
fid
=
merger
->
ctx
->
fset
->
fid
,
.
cid
=
merger
->
cid
,
.
size
=
0
,
},
[
1
]
=
{
.
type
=
TSDB_FTYPE_DATA
,
.
did
=
did
[
0
],
.
fid
=
merger
->
ctx
->
fset
->
fid
,
.
cid
=
merger
->
cid
,
.
size
=
0
,
},
[
2
]
=
{
.
type
=
TSDB_FTYPE_SMA
,
.
did
=
did
[
0
],
.
fid
=
merger
->
ctx
->
fset
->
fid
,
.
cid
=
merger
->
cid
,
.
size
=
0
,
},
[
3
]
=
{
.
type
=
TSDB_FTYPE_TOMB
,
.
did
=
did
[
0
],
.
fid
=
merger
->
ctx
->
fset
->
fid
,
.
cid
=
merger
->
cid
,
.
size
=
0
,
},
},
};
code
=
tsdbDataFileWriterOpen
(
&
config
,
&
merger
->
dataWriter
);
.
szPage
=
merger
->
szPage
,
.
fid
=
merger
->
ctx
->
fset
->
fid
,
.
cid
=
merger
->
cid
,
.
did
=
did
,
.
compactVersion
=
merger
->
compactVersion
,
}};
for
(
int32_t
i
=
0
;
i
<
TSDB_FTYPE_MAX
;
i
++
)
{
if
(
merger
->
ctx
->
fset
->
farr
[
i
])
{
config
->
files
[
i
].
exist
=
true
;
config
->
files
[
i
].
file
=
merger
->
ctx
->
fset
->
farr
[
i
]
->
f
[
0
];
}
else
{
config
->
files
[
i
].
exist
=
false
;
}
}
code
=
tsdbDataFileWriterOpen
(
config
,
&
merger
->
dataWriter
);
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录