Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dc5d4d52
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
dc5d4d52
编写于
10月 13, 2021
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code optimization
上级
e4f41ef3
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
11 addition
and
17 deletion
+11
-17
src/tsdb/inc/tsdbFile.h
src/tsdb/inc/tsdbFile.h
+5
-11
src/tsdb/src/tsdbCommit.c
src/tsdb/src/tsdbCommit.c
+1
-1
src/tsdb/src/tsdbCompact.c
src/tsdb/src/tsdbCompact.c
+1
-1
src/tsdb/src/tsdbFS.c
src/tsdb/src/tsdbFS.c
+4
-4
未找到文件。
src/tsdb/inc/tsdbFile.h
浏览文件 @
dc5d4d52
...
@@ -327,7 +327,7 @@ static FORCE_INLINE uint8_t tsdbGetNFiles(SDFileSet* pSet) {
...
@@ -327,7 +327,7 @@ static FORCE_INLINE uint8_t tsdbGetNFiles(SDFileSet* pSet) {
#define TSDB_FSET_ID(s) TSDB_FILE_ID(TSDB_DFILE_IN_SET(s, 0))
#define TSDB_FSET_ID(s) TSDB_FILE_ID(TSDB_DFILE_IN_SET(s, 0))
#define TSDB_FSET_SET_CLOSED(s) \
#define TSDB_FSET_SET_CLOSED(s) \
do { \
do { \
for (TSDB_FILE_T ftype = TSDB_FILE_HEAD; ftype <
tsdbGetNFiles(s)
; ftype++) { \
for (TSDB_FILE_T ftype = TSDB_FILE_HEAD; ftype <
TSDB_FILE_MAX
; ftype++) { \
TSDB_FILE_SET_CLOSED(TSDB_DFILE_IN_SET(s, ftype)); \
TSDB_FILE_SET_CLOSED(TSDB_DFILE_IN_SET(s, ftype)); \
} \
} \
} while (0);
} while (0);
...
@@ -337,12 +337,6 @@ static FORCE_INLINE uint8_t tsdbGetNFiles(SDFileSet* pSet) {
...
@@ -337,12 +337,6 @@ static FORCE_INLINE uint8_t tsdbGetNFiles(SDFileSet* pSet) {
TSDB_FILE_FSYNC(TSDB_DFILE_IN_SET(s, ftype)); \
TSDB_FILE_FSYNC(TSDB_DFILE_IN_SET(s, ftype)); \
} \
} \
} while (0);
} while (0);
#define TSDB_FSET_SET_INIT(s) \
do { \
for (TSDB_FILE_T ftype = TSDB_FILE_HEAD; ftype < TSDB_FILE_MAX; ftype++) { \
TSDB_FILE_SET_CLOSED(TSDB_DFILE_IN_SET(s, ftype)); \
} \
} while (0);
void
tsdbInitDFileSet
(
SDFileSet
*
pSet
,
SDiskID
did
,
int
vid
,
int
fid
,
uint32_t
ver
,
uint8_t
fsetVer
);
void
tsdbInitDFileSet
(
SDFileSet
*
pSet
,
SDiskID
did
,
int
vid
,
int
fid
,
uint32_t
ver
,
uint8_t
fsetVer
);
void
tsdbInitDFileSetEx
(
SDFileSet
*
pSet
,
SDFileSet
*
pOSet
);
void
tsdbInitDFileSetEx
(
SDFileSet
*
pSet
,
SDFileSet
*
pOSet
);
...
...
src/tsdb/src/tsdbCommit.c
浏览文件 @
dc5d4d52
...
@@ -844,7 +844,7 @@ static int tsdbInitCommitH(SCommitH *pCommith, STsdbRepo *pRepo) {
...
@@ -844,7 +844,7 @@ static int tsdbInitCommitH(SCommitH *pCommith, STsdbRepo *pRepo) {
memset
(
pCommith
,
0
,
sizeof
(
*
pCommith
));
memset
(
pCommith
,
0
,
sizeof
(
*
pCommith
));
tsdbGetRtnSnap
(
pRepo
,
&
(
pCommith
->
rtn
));
tsdbGetRtnSnap
(
pRepo
,
&
(
pCommith
->
rtn
));
TSDB_FSET_SET_
INIT
(
TSDB_COMMIT_WRITE_FSET
(
pCommith
));
TSDB_FSET_SET_
CLOSED
(
TSDB_COMMIT_WRITE_FSET
(
pCommith
));
// Init read handle
// Init read handle
if
(
tsdbInitReadH
(
&
(
pCommith
->
readh
),
pRepo
)
<
0
)
{
if
(
tsdbInitReadH
(
&
(
pCommith
->
readh
),
pRepo
)
<
0
)
{
...
...
src/tsdb/src/tsdbCompact.c
浏览文件 @
dc5d4d52
...
@@ -274,7 +274,7 @@ static int tsdbCompactMeta(STsdbRepo *pRepo) {
...
@@ -274,7 +274,7 @@ static int tsdbCompactMeta(STsdbRepo *pRepo) {
memset
(
pComph
,
0
,
sizeof
(
*
pComph
));
memset
(
pComph
,
0
,
sizeof
(
*
pComph
));
TSDB_FSET_SET_
INIT
(
TSDB_COMPACT_WSET
(
pComph
));
TSDB_FSET_SET_
CLOSED
(
TSDB_COMPACT_WSET
(
pComph
));
tsdbGetRtnSnap
(
pRepo
,
&
(
pComph
->
rtn
));
tsdbGetRtnSnap
(
pRepo
,
&
(
pComph
->
rtn
));
tsdbFSIterInit
(
&
(
pComph
->
fsIter
),
REPO_FS
(
pRepo
),
TSDB_FS_ITER_FORWARD
);
tsdbFSIterInit
(
&
(
pComph
->
fsIter
),
REPO_FS
(
pRepo
),
TSDB_FS_ITER_FORWARD
);
...
...
src/tsdb/src/tsdbFS.c
浏览文件 @
dc5d4d52
...
@@ -1200,7 +1200,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1200,7 +1200,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
SDFileSet fset = {0};
SDFileSet fset = {0};
TSDB_FSET_SET_
INIT
(&fset);
TSDB_FSET_SET_
CLOSED
(&fset);
// Loop to recover ONE fset
// Loop to recover ONE fset
for (TSDB_FILE_T ftype = 0; ftype < TSDB_FILE_MAX; ftype++) {
for (TSDB_FILE_T ftype = 0; ftype < TSDB_FILE_MAX; ftype++) {
...
@@ -1355,7 +1355,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1355,7 +1355,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
if
(
index
==
0
)
{
if
(
index
==
0
)
{
memset
(
&
fset
,
0
,
sizeof
(
SDFileSet
));
memset
(
&
fset
,
0
,
sizeof
(
SDFileSet
));
TSDB_FSET_SET_
INIT
(
&
fset
);
TSDB_FSET_SET_
CLOSED
(
&
fset
);
nDFiles
=
1
;
nDFiles
=
1
;
fset
.
fid
=
tfid
;
fset
.
fid
=
tfid
;
pDFile
->
f
=
*
pf
;
pDFile
->
f
=
*
pf
;
...
@@ -1377,7 +1377,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1377,7 +1377,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
}
else
{
}
else
{
// next FSet
// next FSet
memset
(
&
fset
,
0
,
sizeof
(
SDFileSet
));
memset
(
&
fset
,
0
,
sizeof
(
SDFileSet
));
TSDB_FSET_SET_
INIT
(
&
fset
);
TSDB_FSET_SET_
CLOSED
(
&
fset
);
nDFiles
=
1
;
nDFiles
=
1
;
fset
.
fid
=
tfid
;
fset
.
fid
=
tfid
;
pDFile
->
f
=
*
pf
;
pDFile
->
f
=
*
pf
;
...
@@ -1437,7 +1437,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
...
@@ -1437,7 +1437,7 @@ static int tsdbRestoreDFileSet(STsdbRepo *pRepo) {
// next FSet
// next FSet
memset
(
&
fset
,
0
,
sizeof
(
SDFileSet
));
memset
(
&
fset
,
0
,
sizeof
(
SDFileSet
));
TSDB_FSET_SET_
INIT
(
&
fset
);
TSDB_FSET_SET_
CLOSED
(
&
fset
);
nDFiles
=
1
;
nDFiles
=
1
;
fset
.
fid
=
tfid
;
fset
.
fid
=
tfid
;
pDFile
->
f
=
*
pf
;
pDFile
->
f
=
*
pf
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录