Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1c40f32e
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看板
提交
1c40f32e
编写于
10月 04, 2021
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10430] resolve fix problems
上级
140ec7c8
变更
16
显示空白变更内容
内联
并排
Showing
16 changed file
with
178 addition
and
18 deletion
+178
-18
include/server/dnode/dnode.h
include/server/dnode/dnode.h
+1
-1
include/server/mnode/mnode.h
include/server/mnode/mnode.h
+1
-1
include/server/vnode/vnode.h
include/server/vnode/vnode.h
+1
-1
source/os/CMakeLists.txt
source/os/CMakeLists.txt
+7
-0
source/server/CMakeLists.txt
source/server/CMakeLists.txt
+1
-1
source/server/dnode/CMakeLists.txt
source/server/dnode/CMakeLists.txt
+0
-4
source/server/dnode/src/dnodeInt.c
source/server/dnode/src/dnodeInt.c
+3
-3
source/server/dnode/src/dnodeMain.c
source/server/dnode/src/dnodeMain.c
+2
-0
source/server/mnode/CMakeLists.txt
source/server/mnode/CMakeLists.txt
+4
-0
source/server/mnode/inc/mnodeInt.h
source/server/mnode/inc/mnodeInt.h
+5
-0
source/server/mnode/src/mnodeMain.c
source/server/mnode/src/mnodeMain.c
+23
-1
source/server/server.c
source/server/server.c
+18
-1
source/server/vnode/CMakeLists.txt
source/server/vnode/CMakeLists.txt
+5
-4
source/server/vnode/inc/vnodeInt.h
source/server/vnode/inc/vnodeInt.h
+5
-0
source/server/vnode/src/vnodeMain.c
source/server/vnode/src/vnodeMain.c
+17
-1
source/util/src/tstep.c
source/util/src/tstep.c
+85
-0
未找到文件。
include/server/dnode/dnode.h
浏览文件 @
1c40f32e
...
...
@@ -32,7 +32,7 @@ struct Dnode *dnodeCreateInstance();
*
* @param dnode, instance of dnode module.
*/
void
dnode
Cleanu
pInstance
(
struct
Dnode
*
dnode
);
void
dnode
Dro
pInstance
(
struct
Dnode
*
dnode
);
/**
* Send messages to other dnodes, such as create vnode message.
...
...
include/server/mnode/mnode.h
浏览文件 @
1c40f32e
...
...
@@ -82,7 +82,7 @@ struct Mnode *mnodeCreateInstance(SMnodePara para);
*
* @param mnode, instance of mnode module.
*/
void
mnode
Cleanu
pInstance
(
struct
Mnode
*
vnode
);
void
mnode
Dro
pInstance
(
struct
Mnode
*
vnode
);
/**
* Deploy mnode instances in dnode.
...
...
include/server/vnode/vnode.h
浏览文件 @
1c40f32e
...
...
@@ -71,7 +71,7 @@ struct Vnode *vnodeCreateInstance(SVnodePara para);
*
* @param vnode, instance of vnode module.
*/
void
vnode
Cleanu
pInstance
(
struct
Vnode
*
vnode
);
void
vnode
Dro
pInstance
(
struct
Vnode
*
vnode
);
typedef
struct
{
int32_t
unused
;
...
...
source/os/CMakeLists.txt
浏览文件 @
1c40f32e
...
...
@@ -5,3 +5,10 @@ target_include_directories(
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/os"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/include"
)
target_link_libraries
(
os
PUBLIC pthread
PUBLIC dl
PUBLIC rt
PUBLIC m
)
\ No newline at end of file
source/server/CMakeLists.txt
浏览文件 @
1c40f32e
...
...
@@ -7,5 +7,5 @@ aux_source_directory(. TAOSD_SRC)
add_executable
(
taosd
${
TAOSD_SRC
}
)
target_link_libraries
(
taosd
PUBLIC
os
PUBLIC
dnode
)
\ No newline at end of file
source/server/dnode/CMakeLists.txt
浏览文件 @
1c40f32e
...
...
@@ -2,11 +2,7 @@ aux_source_directory(src DNODE_SRC)
add_library
(
dnode
${
DNODE_SRC
}
)
target_link_libraries
(
dnode
PUBLIC os
PUBLIC cjson
PUBLIC util
PUBLIC common
PUBLIC transport
PUBLIC mnode
PUBLIC vnode
)
...
...
source/server/dnode/src/dnodeInt.c
浏览文件 @
1c40f32e
...
...
@@ -65,7 +65,7 @@ static int32_t dnodeInitVnodeModule(Dnode *dnode, struct Vnode** out) {
static
void
dnodeCleanupVnodeModule
(
Dnode
*
dnode
,
struct
Vnode
**
out
)
{
struct
Vnode
*
vnode
=
*
out
;
*
out
=
NULL
;
vnode
Cleanu
pInstance
(
vnode
);
vnode
Dro
pInstance
(
vnode
);
}
static
int32_t
dnodeInitMnodeModule
(
Dnode
*
dnode
,
struct
Mnode
**
out
)
{
...
...
@@ -90,7 +90,7 @@ static int32_t dnodeInitMnodeModule(Dnode *dnode, struct Mnode **out) {
static
void
dnodeCleanupMnodeModule
(
Dnode
*
dnode
,
struct
Mnode
**
out
)
{
struct
Mnode
*
mnode
=
*
out
;
*
out
=
NULL
;
mnode
Cleanu
pInstance
(
mnode
);
mnode
Dro
pInstance
(
mnode
);
}
Dnode
*
dnodeCreateInstance
()
{
...
...
@@ -223,7 +223,7 @@ Dnode *dnodeCreateInstance() {
return
dnode
;
}
void
dnode
Cleanu
pInstance
(
Dnode
*
dnode
)
{
void
dnode
Dro
pInstance
(
Dnode
*
dnode
)
{
if
(
dnode
->
main
->
runStatus
!=
TD_RUN_STAT_STOPPED
)
{
dnode
->
main
->
runStatus
=
TD_RUN_STAT_STOPPED
;
taosStepCleanup
(
dnode
->
steps
);
...
...
source/server/dnode/src/dnodeMain.c
浏览文件 @
1c40f32e
...
...
@@ -112,7 +112,9 @@ void dnodeCleanupMain(DnMain **out) {
main
->
dnodeTimer
=
NULL
;
}
#if 0
taos_cleanup();
#endif
taosCloseLog
();
taosStopCacheRefreshWorker
();
...
...
source/server/mnode/CMakeLists.txt
浏览文件 @
1c40f32e
...
...
@@ -5,3 +5,7 @@ target_include_directories(
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/server/mnode"
private
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
mnode
PUBLIC transport
)
\ No newline at end of file
source/server/mnode/inc/mnodeInt.h
浏览文件 @
1c40f32e
...
...
@@ -20,6 +20,11 @@
extern
"C"
{
#endif
#include "os.h"
#include "taosmsg.h"
#include "trpc.h"
#include "mnode.h"
#ifdef __cplusplus
}
#endif
...
...
source/server/
vnode/src/vnode
.c
→
source/server/
mnode/src/mnodeMain
.c
浏览文件 @
1c40f32e
...
...
@@ -12,3 +12,25 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "mnodeInt.h"
struct
Mnode
*
mnodeCreateInstance
(
SMnodePara
para
)
{
return
NULL
;
}
void
mnodeDropInstance
(
struct
Mnode
*
vnode
)
{}
int32_t
mnodeDeploy
(
struct
Mnode
*
mnode
,
struct
SMInfos
*
minfos
)
{
return
0
;
}
void
mnodeUnDeploy
(
struct
Mnode
*
mnode
)
{}
bool
mnodeIsServing
(
struct
Mnode
*
mnode
)
{
return
false
;
}
int32_t
mnodeGetStatistics
(
struct
Mnode
*
mnode
,
SMnodeStat
*
stat
)
{
return
0
;
}
int32_t
mnodeRetriveAuth
(
struct
Mnode
*
mnode
,
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
)
{
return
0
;
}
void
mnodeProcessMsg
(
struct
Mnode
*
mnode
,
SRpcMsg
*
rpcMsg
)
{}
source/server/
main
.c
→
source/server/
server
.c
浏览文件 @
1c40f32e
...
...
@@ -13,8 +13,25 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "os.h"
#include "tulog.h"
#include "trpc.h"
#include "dnode.h"
int
main
(
int
argc
,
char
const
*
argv
[])
{
printf
(
"Hello world!
\n
"
);
struct
Dnode
*
dnode
=
dnodeCreateInstance
();
if
(
dnode
==
NULL
)
{
uInfo
(
"Failed to start TDengine, please check the log at:%s"
,
tsLogDir
);
exit
(
EXIT_FAILURE
);
}
uInfo
(
"Started TDengine service successfully."
);
// if (tsem_wait(&exitSem) != 0) {
// syslog(LOG_ERR, "failed to wait exit semphore: %s", strerror(errno));
// }
dnodeDropInstance
(
dnode
);
uInfo
(
"TDengine is shut down!"
);
return
0
;
}
source/server/vnode/CMakeLists.txt
浏览文件 @
1c40f32e
...
...
@@ -9,9 +9,10 @@ target_include_directories(
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/server/vnode"
private
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_
include_directo
ries
(
target_
link_libra
ries
(
vnode
PRIVATE meta
PRIVATE tq
PRIVATE tsdb
PUBLIC transport
PUBLIC meta
PUBLIC tq
PUBLIC tsdb
)
\ No newline at end of file
source/server/vnode/inc/vnodeInt.h
浏览文件 @
1c40f32e
...
...
@@ -20,6 +20,11 @@
extern
"C"
{
#endif
#include "os.h"
#include "taosmsg.h"
#include "trpc.h"
#include "vnode.h"
#ifdef __cplusplus
}
#endif
...
...
source/server/
mnode/src/mnode
.c
→
source/server/
vnode/src/vnodeMain
.c
浏览文件 @
1c40f32e
...
...
@@ -12,3 +12,19 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "vnodeInt.h"
struct
Vnode
*
vnodeCreateInstance
(
SVnodePara
para
)
{
return
NULL
;
}
void
vnodeDropInstance
(
struct
Vnode
*
vnode
)
{}
int32_t
vnodeGetStatistics
(
struct
Vnode
*
vnode
,
SVnodeStat
*
stat
)
{
return
0
;
}
void
vnodeGetStatus
(
struct
Vnode
*
vnode
,
struct
SStatusMsg
*
status
)
{}
void
vnodeSetAccess
(
struct
Vnode
*
vnode
,
struct
SVgroupAccess
*
access
,
int32_t
numOfVnodes
)
{}
void
vnodeProcessMsg
(
struct
Vnode
*
vnode
,
SRpcMsg
*
msg
)
{}
source/util/src/tstep.c
0 → 100644
浏览文件 @
1c40f32e
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "tulog.h"
#include "tstep.h"
SSteps
*
taosStepInit
(
int32_t
maxsize
)
{
SSteps
*
steps
=
calloc
(
1
,
sizeof
(
SSteps
));
if
(
steps
==
NULL
)
return
NULL
;
steps
->
maxsize
=
maxsize
;
steps
->
cursize
=
0
;
steps
->
steps
=
calloc
(
maxsize
,
sizeof
(
SStepObj
));
return
steps
;
}
int32_t
taosStepAdd
(
SSteps
*
steps
,
SStepObj
*
step
)
{
if
(
steps
==
NULL
)
return
-
1
;
if
(
steps
->
cursize
>=
steps
->
maxsize
)
{
uError
(
"failed to add step since up to the maxsize"
);
return
-
1
;
}
steps
->
steps
[
steps
->
cursize
++
]
=
*
step
;
return
0
;
}
static
void
taosStepCleanupImp
(
SSteps
*
steps
,
int32_t
pos
)
{
for
(
int32_t
s
=
pos
;
s
>=
0
;
s
--
)
{
SStepObj
*
step
=
steps
->
steps
+
s
;
uDebug
(
"step:%s will cleanup"
,
step
->
name
);
if
(
step
->
cleanupFp
!=
NULL
)
{
(
*
step
->
cleanupFp
)(
step
->
self
);
}
}
}
int32_t
taosStepExec
(
SSteps
*
steps
)
{
if
(
steps
==
NULL
)
return
-
1
;
for
(
int32_t
s
=
0
;
s
<
steps
->
cursize
;
s
++
)
{
SStepObj
*
step
=
steps
->
steps
+
s
;
if
(
step
->
initFp
==
NULL
)
continue
;
if
(
step
->
reportFp
!=
NULL
)
{
(
*
step
->
reportFp
)(
step
->
parent
,
step
->
name
,
"start initialize"
);
}
int32_t
code
=
(
*
step
->
initFp
)(
step
->
parent
,
step
->
self
);
if
(
code
!=
0
)
{
uDebug
(
"step:%s will cleanup"
,
step
->
name
);
taosStepCleanupImp
(
steps
,
s
);
return
code
;
}
uInfo
(
"step:%s is initialized"
,
step
->
name
);
if
(
step
->
reportFp
!=
NULL
)
{
(
*
step
->
reportFp
)(
step
->
parent
,
step
->
name
,
"initialize completed"
);
}
}
return
0
;
}
void
taosStepCleanup
(
SSteps
*
steps
)
{
if
(
steps
==
NULL
)
return
;
taosStepCleanupImp
(
steps
,
steps
->
cursize
-
1
);
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录