Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
d3c12027
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d3c12027
编写于
12月 02, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1843
上级
bd0f7fff
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
52 deletion
+21
-52
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+8
-25
src/mnode/src/mnodeMain.c
src/mnode/src/mnodeMain.c
+8
-21
src/util/inc/tstep.h
src/util/inc/tstep.h
+0
-1
src/vnode/src/vnodeMgmt.c
src/vnode/src/vnodeMgmt.c
+5
-5
未找到文件。
src/dnode/src/dnodeMain.c
浏览文件 @
d3c12027
...
...
@@ -20,6 +20,7 @@
#include "tconfig.h"
#include "tglobal.h"
#include "tfile.h"
#include "tstep.h"
#include "twal.h"
#include "trpc.h"
#include "dnode.h"
...
...
@@ -46,17 +47,9 @@ static int32_t dnodeInitStorage();
static
void
dnodeCleanupStorage
();
static
void
dnodeSetRunStatus
(
SRunStatus
status
);
static
void
dnodeCheckDataDirOpenned
(
char
*
dir
);
static
int32_t
dnodeInitComponents
();
static
void
dnodeCleanupComponents
(
int32_t
stepId
);
static
int
dnodeCreateDir
(
const
char
*
dir
);
typedef
struct
{
const
char
*
const
name
;
int32_t
(
*
init
)();
void
(
*
cleanup
)();
}
SDnodeComponent
;
static
const
SDnodeComponent
tsDnodeComponents
[]
=
{
static
SStep
tsDnodeSteps
[]
=
{
{
"tfile"
,
tfInit
,
tfCleanup
},
{
"rpc"
,
rpcInit
,
rpcCleanup
},
{
"storage"
,
dnodeInitStorage
,
dnodeCleanupStorage
},
...
...
@@ -88,24 +81,14 @@ static int dnodeCreateDir(const char *dir) {
return
0
;
}
static
void
dnodeCleanupComponents
(
int32_t
stepId
)
{
for
(
int32_t
i
=
stepId
;
i
>=
0
;
i
--
)
{
if
(
tsDnodeComponents
[
i
].
cleanup
)
{
(
*
tsDnodeComponents
[
i
].
cleanup
)();
}
}
static
void
dnodeCleanupComponents
()
{
int32_t
stepSize
=
sizeof
(
tsDnodeSteps
)
/
sizeof
(
SStep
);
taosStepCleanup
(
tsDnodeSteps
,
stepSize
);
}
static
int32_t
dnodeInitComponents
()
{
int32_t
code
=
0
;
for
(
int32_t
i
=
0
;
i
<
sizeof
(
tsDnodeComponents
)
/
sizeof
(
tsDnodeComponents
[
0
]);
i
++
)
{
if
(
tsDnodeComponents
[
i
].
init
()
!=
0
)
{
dnodeCleanupComponents
(
i
);
code
=
-
1
;
break
;
}
}
return
code
;
int32_t
stepSize
=
sizeof
(
tsDnodeSteps
)
/
sizeof
(
SStep
);
return
taosStepInit
(
tsDnodeSteps
,
stepSize
);
}
int32_t
dnodeInitSystem
()
{
...
...
@@ -152,7 +135,7 @@ int32_t dnodeInitSystem() {
void
dnodeCleanUpSystem
()
{
if
(
dnodeGetRunStatus
()
!=
TSDB_RUN_STATUS_STOPPED
)
{
dnodeSetRunStatus
(
TSDB_RUN_STATUS_STOPPED
);
dnodeCleanupComponents
(
sizeof
(
tsDnodeComponents
)
/
sizeof
(
tsDnodeComponents
[
0
])
-
1
);
dnodeCleanupComponents
();
taos_cleanup
();
taosCloseLog
();
}
...
...
src/mnode/src/mnodeMain.c
浏览文件 @
d3c12027
...
...
@@ -21,6 +21,7 @@
#include "tgrant.h"
#include "ttimer.h"
#include "tglobal.h"
#include "tstep.h"
#include "mnode.h"
#include "dnode.h"
#include "mnodeDef.h"
...
...
@@ -37,16 +38,10 @@
#include "mnodeShow.h"
#include "mnodeProfile.h"
typedef
struct
{
const
char
*
const
name
;
int
(
*
init
)();
void
(
*
cleanup
)();
}
SMnodeComponent
;
void
*
tsMnodeTmr
=
NULL
;
static
bool
tsMgmtIsRunning
=
false
;
static
const
SMnodeComponent
tsMnodeComponent
s
[]
=
{
static
SStep
tsMnodeStep
s
[]
=
{
{
"sdbref"
,
sdbInitRef
,
sdbCleanUpRef
},
{
"profile"
,
mnodeInitProfile
,
mnodeCleanupProfile
},
{
"cluster"
,
mnodeInitCluster
,
mnodeCleanupCluster
},
...
...
@@ -67,22 +62,14 @@ static void mnodeInitTimer();
static
void
mnodeCleanupTimer
();
static
bool
mnodeNeedStart
()
;
static
void
mnodeCleanupComponents
(
int32_t
stepId
)
{
for
(
int32_t
i
=
stepId
;
i
>=
0
;
i
--
)
{
tsMnodeComponents
[
i
].
cleanup
();
}
static
void
mnodeCleanupComponents
()
{
int32_t
stepSize
=
sizeof
(
tsMnodeSteps
)
/
sizeof
(
SStep
);
taosStepCleanup
(
tsMnodeSteps
,
stepSize
);
}
static
int32_t
mnodeInitComponents
()
{
int32_t
code
=
0
;
for
(
int32_t
i
=
0
;
i
<
sizeof
(
tsMnodeComponents
)
/
sizeof
(
tsMnodeComponents
[
0
]);
i
++
)
{
if
(
tsMnodeComponents
[
i
].
init
()
!=
0
)
{
mnodeCleanupComponents
(
i
);
code
=
-
1
;
break
;
}
}
return
code
;
int32_t
stepSize
=
sizeof
(
tsMnodeSteps
)
/
sizeof
(
SStep
);
return
taosStepInit
(
tsMnodeSteps
,
stepSize
);
}
int32_t
mnodeStartSystem
()
{
...
...
@@ -132,7 +119,7 @@ void mnodeCleanupSystem() {
dnodeFreeMReadQueue
();
dnodeFreeMPeerQueue
();
mnodeCleanupTimer
();
mnodeCleanupComponents
(
sizeof
(
tsMnodeComponents
)
/
sizeof
(
tsMnodeComponents
[
0
])
-
1
);
mnodeCleanupComponents
();
mInfo
(
"mnode is cleaned up"
);
}
...
...
src/util/inc/tstep.h
浏览文件 @
d3c12027
...
...
@@ -24,7 +24,6 @@ typedef struct {
const
char
*
const
name
;
int32_t
(
*
initFp
)();
void
(
*
cleanupFp
)();
int32_t
step
;
}
SStep
;
int32_t
taosStepInit
(
SStep
*
pSteps
,
int32_t
stepSize
);
...
...
src/vnode/src/vnodeMgmt.c
浏览文件 @
d3c12027
...
...
@@ -28,11 +28,11 @@ static void vnodeCleanupHash(void);
static
void
vnodeIncRef
(
void
*
ptNode
);
static
SStep
tsVnodeSteps
[]
=
{
{
"vsync"
,
syncInit
,
syncCleanUp
,
0
},
{
"vwrite"
,
vnodeInitWrite
,
vnodeCleanupWrite
,
1
},
{
"vread"
,
vnodeInitRead
,
vnodeCleanupRead
,
2
},
{
"vhash"
,
vnodeInitHash
,
vnodeCleanupHash
,
3
},
{
"vqueue"
,
tsdbInitCommitQueue
,
tsdbDestroyCommitQueue
,
4
}
{
"vsync"
,
syncInit
,
syncCleanUp
},
{
"vwrite"
,
vnodeInitWrite
,
vnodeCleanupWrite
},
{
"vread"
,
vnodeInitRead
,
vnodeCleanupRead
},
{
"vhash"
,
vnodeInitHash
,
vnodeCleanupHash
},
{
"vqueue"
,
tsdbInitCommitQueue
,
tsdbDestroyCommitQueue
}
};
int32_t
vnodeInitMgmt
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录