Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
687dd81c
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
687dd81c
编写于
9月 02, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact more code
上级
7d023d72
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
17 addition
and
16 deletion
+17
-16
source/dnode/vnode/src/inc/tsdb.h
source/dnode/vnode/src/inc/tsdb.h
+8
-8
source/dnode/vnode/src/tsdb/tsdbCommit.c
source/dnode/vnode/src/tsdb/tsdbCommit.c
+4
-4
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
+5
-4
未找到文件。
source/dnode/vnode/src/inc/tsdb.h
浏览文件 @
687dd81c
...
@@ -68,8 +68,8 @@ typedef struct SVersionRange SVersionRange;
...
@@ -68,8 +68,8 @@ typedef struct SVersionRange SVersionRange;
#define TSDB_FILE_DLMT ((uint32_t)0xF00AFA0F)
#define TSDB_FILE_DLMT ((uint32_t)0xF00AFA0F)
#define TSDB_MAX_SUBBLOCKS 8
#define TSDB_MAX_SUBBLOCKS 8
#define TSDB_MAX_
LA
ST_FILE 16
#define TSDB_MAX_
S
ST_FILE 16
#define TSDB_DEFAULT_
LA
ST_FILE 8
#define TSDB_DEFAULT_
S
ST_FILE 8
#define TSDB_FHDR_SIZE 512
#define TSDB_FHDR_SIZE 512
#define HAS_NONE ((int8_t)0x1)
#define HAS_NONE ((int8_t)0x1)
...
@@ -563,7 +563,7 @@ struct SDFileSet {
...
@@ -563,7 +563,7 @@ struct SDFileSet {
SDataFile
*
pDataF
;
SDataFile
*
pDataF
;
SSmaFile
*
pSmaF
;
SSmaFile
*
pSmaF
;
uint8_t
nSstF
;
uint8_t
nSstF
;
SSstFile
*
aSstF
[
TSDB_MAX_
LA
ST_FILE
];
SSstFile
*
aSstF
[
TSDB_MAX_
S
ST_FILE
];
};
};
struct
SRowIter
{
struct
SRowIter
{
...
@@ -598,7 +598,7 @@ struct SDataFWriter {
...
@@ -598,7 +598,7 @@ struct SDataFWriter {
SHeadFile
fHead
;
SHeadFile
fHead
;
SDataFile
fData
;
SDataFile
fData
;
SSmaFile
fSma
;
SSmaFile
fSma
;
SSstFile
fSst
[
TSDB_MAX_
LA
ST_FILE
];
SSstFile
fSst
[
TSDB_MAX_
S
ST_FILE
];
uint8_t
*
aBuf
[
4
];
uint8_t
*
aBuf
[
4
];
};
};
...
@@ -615,7 +615,7 @@ struct SDataFReader {
...
@@ -615,7 +615,7 @@ struct SDataFReader {
TdFilePtr
pHeadFD
;
TdFilePtr
pHeadFD
;
TdFilePtr
pDataFD
;
TdFilePtr
pDataFD
;
TdFilePtr
pSmaFD
;
TdFilePtr
pSmaFD
;
TdFilePtr
aLastFD
[
TSDB_MAX_
LA
ST_FILE
];
TdFilePtr
aLastFD
[
TSDB_MAX_
S
ST_FILE
];
uint8_t
*
aBuf
[
3
];
uint8_t
*
aBuf
[
3
];
};
};
...
...
source/dnode/vnode/src/tsdb/tsdbCommit.c
浏览文件 @
687dd81c
...
@@ -71,7 +71,7 @@ typedef struct {
...
@@ -71,7 +71,7 @@ typedef struct {
SDataIter
*
pIter
;
SDataIter
*
pIter
;
SRBTree
rbt
;
SRBTree
rbt
;
SDataIter
dataIter
;
SDataIter
dataIter
;
SDataIter
aDataIter
[
TSDB_MAX_
LA
ST_FILE
];
SDataIter
aDataIter
[
TSDB_MAX_
S
ST_FILE
];
int8_t
toLastOnly
;
int8_t
toLastOnly
;
};
};
struct
{
struct
{
...
@@ -760,7 +760,7 @@ static int32_t tsdbStartCommit(STsdb *pTsdb, SCommitter *pCommitter) {
...
@@ -760,7 +760,7 @@ static int32_t tsdbStartCommit(STsdb *pTsdb, SCommitter *pCommitter) {
pCommitter
->
minRow
=
pTsdb
->
pVnode
->
config
.
tsdbCfg
.
minRows
;
pCommitter
->
minRow
=
pTsdb
->
pVnode
->
config
.
tsdbCfg
.
minRows
;
pCommitter
->
maxRow
=
pTsdb
->
pVnode
->
config
.
tsdbCfg
.
maxRows
;
pCommitter
->
maxRow
=
pTsdb
->
pVnode
->
config
.
tsdbCfg
.
maxRows
;
pCommitter
->
cmprAlg
=
pTsdb
->
pVnode
->
config
.
tsdbCfg
.
compression
;
pCommitter
->
cmprAlg
=
pTsdb
->
pVnode
->
config
.
tsdbCfg
.
compression
;
pCommitter
->
maxLast
=
TSDB_DEFAULT_
LA
ST_FILE
;
// TODO: make it as a config
pCommitter
->
maxLast
=
TSDB_DEFAULT_
S
ST_FILE
;
// TODO: make it as a config
pCommitter
->
aTbDataP
=
tsdbMemTableGetTbDataArray
(
pTsdb
->
imem
);
pCommitter
->
aTbDataP
=
tsdbMemTableGetTbDataArray
(
pTsdb
->
imem
);
if
(
pCommitter
->
aTbDataP
==
NULL
)
{
if
(
pCommitter
->
aTbDataP
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
...
@@ -790,7 +790,7 @@ static int32_t tsdbCommitDataStart(SCommitter *pCommitter) {
...
@@ -790,7 +790,7 @@ static int32_t tsdbCommitDataStart(SCommitter *pCommitter) {
if
(
code
)
goto
_exit
;
if
(
code
)
goto
_exit
;
// merger
// merger
for
(
int32_t
iSst
=
0
;
iSst
<
TSDB_MAX_
LA
ST_FILE
;
iSst
++
)
{
for
(
int32_t
iSst
=
0
;
iSst
<
TSDB_MAX_
S
ST_FILE
;
iSst
++
)
{
SDataIter
*
pIter
=
&
pCommitter
->
aDataIter
[
iSst
];
SDataIter
*
pIter
=
&
pCommitter
->
aDataIter
[
iSst
];
pIter
->
aSstBlk
=
taosArrayInit
(
0
,
sizeof
(
SSstBlk
));
pIter
->
aSstBlk
=
taosArrayInit
(
0
,
sizeof
(
SSstBlk
));
if
(
pIter
->
aSstBlk
==
NULL
)
{
if
(
pIter
->
aSstBlk
==
NULL
)
{
...
@@ -832,7 +832,7 @@ static void tsdbCommitDataEnd(SCommitter *pCommitter) {
...
@@ -832,7 +832,7 @@ static void tsdbCommitDataEnd(SCommitter *pCommitter) {
tBlockDataDestroy
(
&
pCommitter
->
dReader
.
bData
,
1
);
tBlockDataDestroy
(
&
pCommitter
->
dReader
.
bData
,
1
);
// merger
// merger
for
(
int32_t
iSst
=
0
;
iSst
<
TSDB_MAX_
LA
ST_FILE
;
iSst
++
)
{
for
(
int32_t
iSst
=
0
;
iSst
<
TSDB_MAX_
S
ST_FILE
;
iSst
++
)
{
SDataIter
*
pIter
=
&
pCommitter
->
aDataIter
[
iSst
];
SDataIter
*
pIter
=
&
pCommitter
->
aDataIter
[
iSst
];
taosArrayDestroy
(
pIter
->
aSstBlk
);
taosArrayDestroy
(
pIter
->
aSstBlk
);
tBlockDataDestroy
(
&
pIter
->
bData
,
1
);
tBlockDataDestroy
(
&
pIter
->
bData
,
1
);
...
...
source/dnode/vnode/src/tsdb/tsdbMergeTree.c
浏览文件 @
687dd81c
...
@@ -273,7 +273,8 @@ static FORCE_INLINE int32_t tLDataIterCmprFn(const void *p1, const void *p2) {
...
@@ -273,7 +273,8 @@ static FORCE_INLINE int32_t tLDataIterCmprFn(const void *p1, const void *p2) {
}
}
}
}
int32_t
tMergeTreeOpen
(
SMergeTree
*
pMTree
,
int8_t
backward
,
SDataFReader
*
pFReader
,
uint64_t
uid
,
STimeWindow
*
pTimeWindow
,
SVersionRange
*
pVerRange
)
{
int32_t
tMergeTreeOpen
(
SMergeTree
*
pMTree
,
int8_t
backward
,
SDataFReader
*
pFReader
,
uint64_t
uid
,
STimeWindow
*
pTimeWindow
,
SVersionRange
*
pVerRange
)
{
pMTree
->
backward
=
backward
;
pMTree
->
backward
=
backward
;
pMTree
->
pIter
=
NULL
;
pMTree
->
pIter
=
NULL
;
pMTree
->
pIterList
=
taosArrayInit
(
4
,
POINTER_BYTES
);
pMTree
->
pIterList
=
taosArrayInit
(
4
,
POINTER_BYTES
);
...
@@ -284,8 +285,8 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader* pFRead
...
@@ -284,8 +285,8 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader* pFRead
tRBTreeCreate
(
&
pMTree
->
rbt
,
tLDataIterCmprFn
);
tRBTreeCreate
(
&
pMTree
->
rbt
,
tLDataIterCmprFn
);
int32_t
code
=
TSDB_CODE_OUT_OF_MEMORY
;
int32_t
code
=
TSDB_CODE_OUT_OF_MEMORY
;
struct
SLDataIter
*
pIterList
[
TSDB_DEFAULT_LA
ST_FILE
]
=
{
0
};
struct
SLDataIter
*
pIterList
[
TSDB_DEFAULT_S
ST_FILE
]
=
{
0
};
for
(
int32_t
i
=
0
;
i
<
pFReader
->
pSet
->
nSstF
;
++
i
)
{
// open all last file
for
(
int32_t
i
=
0
;
i
<
pFReader
->
pSet
->
nSstF
;
++
i
)
{
// open all last file
code
=
tLDataIterOpen
(
&
pIterList
[
i
],
pFReader
,
i
,
pMTree
->
backward
,
uid
,
pTimeWindow
,
pVerRange
);
code
=
tLDataIterOpen
(
&
pIterList
[
i
],
pFReader
,
i
,
pMTree
->
backward
,
uid
,
pTimeWindow
,
pVerRange
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_end
;
goto
_end
;
...
@@ -302,7 +303,7 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader* pFRead
...
@@ -302,7 +303,7 @@ int32_t tMergeTreeOpen(SMergeTree *pMTree, int8_t backward, SDataFReader* pFRead
return
code
;
return
code
;
_end:
_end:
tMergeTreeClose
(
pMTree
);
tMergeTreeClose
(
pMTree
);
return
code
;
return
code
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录