Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7435abcf
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看板
提交
7435abcf
编写于
3月 12, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename files
上级
2bbed649
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
60 addition
and
35 deletion
+60
-35
include/dnode/mgmt/dnode.h
include/dnode/mgmt/dnode.h
+2
-2
source/dnode/mgmt/CMakeLists.txt
source/dnode/mgmt/CMakeLists.txt
+3
-3
source/dnode/mgmt/dnode/inc/dndInt.h
source/dnode/mgmt/dnode/inc/dndInt.h
+20
-0
source/dnode/mgmt/dnode/inc/dndMain.h
source/dnode/mgmt/dnode/inc/dndMain.h
+1
-16
source/dnode/mgmt/dnode/src/dndMain.c
source/dnode/mgmt/dnode/src/dndMain.c
+3
-3
source/dnode/mgmt/exec/inc/dndExec.h
source/dnode/mgmt/exec/inc/dndExec.h
+4
-5
source/dnode/mgmt/exec/src/dndExec.c
source/dnode/mgmt/exec/src/dndExec.c
+2
-2
source/dnode/mgmt/exec/src/dndUtil.c
source/dnode/mgmt/exec/src/dndUtil.c
+21
-0
source/dnode/mgmt/test/CMakeLists.txt
source/dnode/mgmt/test/CMakeLists.txt
+0
-0
source/dnode/mgmt/test/bnode/CMakeLists.txt
source/dnode/mgmt/test/bnode/CMakeLists.txt
+0
-0
source/dnode/mgmt/test/bnode/dbnode.cpp
source/dnode/mgmt/test/bnode/dbnode.cpp
+0
-0
source/dnode/mgmt/test/mnode/CMakeLists.txt
source/dnode/mgmt/test/mnode/CMakeLists.txt
+0
-0
source/dnode/mgmt/test/mnode/dmnode.cpp
source/dnode/mgmt/test/mnode/dmnode.cpp
+0
-0
source/dnode/mgmt/test/qnode/CMakeLists.txt
source/dnode/mgmt/test/qnode/CMakeLists.txt
+0
-0
source/dnode/mgmt/test/qnode/dqnode.cpp
source/dnode/mgmt/test/qnode/dqnode.cpp
+0
-0
source/dnode/mgmt/test/snode/CMakeLists.txt
source/dnode/mgmt/test/snode/CMakeLists.txt
+0
-0
source/dnode/mgmt/test/snode/dsnode.cpp
source/dnode/mgmt/test/snode/dsnode.cpp
+0
-0
source/dnode/mgmt/test/sut/CMakeLists.txt
source/dnode/mgmt/test/sut/CMakeLists.txt
+0
-0
source/dnode/mgmt/test/sut/inc/client.h
source/dnode/mgmt/test/sut/inc/client.h
+0
-0
source/dnode/mgmt/test/sut/inc/server.h
source/dnode/mgmt/test/sut/inc/server.h
+1
-1
source/dnode/mgmt/test/sut/inc/sut.h
source/dnode/mgmt/test/sut/inc/sut.h
+0
-0
source/dnode/mgmt/test/sut/src/client.cpp
source/dnode/mgmt/test/sut/src/client.cpp
+0
-0
source/dnode/mgmt/test/sut/src/server.cpp
source/dnode/mgmt/test/sut/src/server.cpp
+3
-3
source/dnode/mgmt/test/sut/src/sut.cpp
source/dnode/mgmt/test/sut/src/sut.cpp
+0
-0
source/dnode/mgmt/test/vnode/CMakeLists.txt
source/dnode/mgmt/test/vnode/CMakeLists.txt
+0
-0
source/dnode/mgmt/test/vnode/vnode.cpp
source/dnode/mgmt/test/vnode/vnode.cpp
+0
-0
未找到文件。
include/dnode/mgmt/dnode.h
浏览文件 @
7435abcf
...
...
@@ -48,7 +48,7 @@ typedef struct {
char
secondEp
[
TSDB_EP_LEN
];
SDiskCfg
*
pDisks
;
int32_t
numOfDisks
;
}
SDn
odeObj
Cfg
;
}
SDn
d
Cfg
;
typedef
enum
{
DND_EVENT_STOP
=
1
,
DND_EVENT_RELOAD
}
EDndEvent
;
...
...
@@ -58,7 +58,7 @@ typedef enum { DND_EVENT_STOP = 1, DND_EVENT_RELOAD } EDndEvent;
* @param pCfg Config of the dnode.
* @return SDnode* The dnode object.
*/
SDnode
*
dndCreate
(
SDn
odeObj
Cfg
*
pCfg
);
SDnode
*
dndCreate
(
SDn
d
Cfg
*
pCfg
);
/**
* @brief Stop and cleanup the dnode.
...
...
source/dnode/mgmt/CMakeLists.txt
浏览文件 @
7435abcf
...
...
@@ -14,6 +14,6 @@ target_include_directories(
add_subdirectory
(
exec
)
#
if(${BUILD_TEST})
#
add_subdirectory(test)
#
endif(${BUILD_TEST})
if
(
${
BUILD_TEST
}
)
add_subdirectory
(
test
)
endif
(
${
BUILD_TEST
}
)
source/dnode/mgmt/dnode/inc/dndInt.h
浏览文件 @
7435abcf
...
...
@@ -64,6 +64,26 @@ typedef enum { DND_ENV_INIT, DND_ENV_READY, DND_ENV_CLEANU } EEnvStat;
typedef
void
(
*
DndMsgFp
)(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEps
);
typedef
int32_t
(
*
MndMsgFp
)(
SDnode
*
pDnode
,
SMndMsg
*
pMsg
);
typedef
struct
SDnode
{
EDndStatus
status
;
SDndCfg
cfg
;
SDnodeDir
dir
;
TdFilePtr
pLockFile
;
SDnodeMgmt
dmgmt
;
SMndMgmt
mmgmt
;
SQnodeMgmt
qmgmt
;
SSnodeMgmt
smgmt
;
SBnodeMgmt
bmgmt
;
SVnodesMgmt
vmgmt
;
STransMgmt
tmgmt
;
STfs
*
pTfs
;
SStartupReq
startup
;
EDndEvent
event
;
}
SDnode
;
EDndStatus
dndGetStatus
(
SDnode
*
pDnode
);
void
dndSetStatus
(
SDnode
*
pDnode
,
EDndStatus
stat
);
const
char
*
dndStatStr
(
EDndStatus
stat
);
...
...
source/dnode/mgmt/dnode/inc/dndMain.h
浏览文件 @
7435abcf
...
...
@@ -138,22 +138,7 @@ typedef struct {
DndMsgFp
msgFp
[
TDMT_MAX
];
}
STransMgmt
;
typedef
struct
SDnode
{
EDndStatus
status
;
SDnodeObjCfg
cfg
;
SDnodeDir
dir
;
TdFilePtr
pLockFile
;
SDnodeMgmt
dmgmt
;
SMndMgmt
mmgmt
;
SQnodeMgmt
qmgmt
;
SSnodeMgmt
smgmt
;
SBnodeMgmt
bmgmt
;
SVnodesMgmt
vmgmt
;
STransMgmt
tmgmt
;
STfs
*
pTfs
;
SStartupReq
startup
;
EDndEvent
event
;
}
SDnode
;
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/dnode/src/dndMain.c
浏览文件 @
7435abcf
...
...
@@ -28,7 +28,7 @@
static
int8_t
once
=
DND_ENV_INIT
;
static
int32_t
dndInitDir
(
SDnode
*
pDnode
,
SDn
odeObj
Cfg
*
pCfg
)
{
static
int32_t
dndInitDir
(
SDnode
*
pDnode
,
SDn
d
Cfg
*
pCfg
)
{
pDnode
->
pLockFile
=
dndCheckRunning
(
pCfg
->
dataDir
);
if
(
pDnode
->
pLockFile
==
NULL
)
{
return
-
1
;
...
...
@@ -83,7 +83,7 @@ static int32_t dndInitDir(SDnode *pDnode, SDnodeObjCfg *pCfg) {
return
-
1
;
}
memcpy
(
&
pDnode
->
cfg
,
pCfg
,
sizeof
(
SDn
odeObj
Cfg
));
memcpy
(
&
pDnode
->
cfg
,
pCfg
,
sizeof
(
SDn
d
Cfg
));
return
0
;
}
...
...
@@ -101,7 +101,7 @@ static void dndCloseDir(SDnode *pDnode) {
}
}
SDnode
*
dndCreate
(
SDn
odeObj
Cfg
*
pCfg
)
{
SDnode
*
dndCreate
(
SDn
d
Cfg
*
pCfg
)
{
dInfo
(
"start to create dnode object"
);
SDnode
*
pDnode
=
calloc
(
1
,
sizeof
(
SDnode
));
...
...
source/dnode/mgmt/exec/inc/dndExec.h
浏览文件 @
7435abcf
...
...
@@ -36,11 +36,10 @@ extern "C" {
#define dDebug(...) { if (dDebugFlag & DEBUG_DEBUG) { taosPrintLog("DND ", DEBUG_DEBUG, dDebugFlag, __VA_ARGS__); }}
#define dTrace(...) { if (dDebugFlag & DEBUG_TRACE) { taosPrintLog("DND ", DEBUG_TRACE, dDebugFlag, __VA_ARGS__); }}
void
dndDumpCfg
();
void
dndPrintVersion
();
void
dndGenerateGrant
();
SDnodeObjCfg
dndGetObjCfg
();
void
dndDumpCfg
();
void
dndPrintVersion
();
void
dndGenerateGrant
();
SDndCfg
dndGetCfg
();
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/exec/src/dndExec.c
浏览文件 @
7435abcf
...
...
@@ -71,8 +71,8 @@ static int32_t dndRunDnode() {
return
-
1
;
}
SDn
odeObjCfg
objCfg
=
dndGetObj
Cfg
();
SDnode
*
pDnode
=
dndCreate
(
&
objCfg
);
SDn
dCfg
objCfg
=
dndGet
Cfg
();
SDnode
*
pDnode
=
dndCreate
(
&
objCfg
);
if
(
pDnode
==
NULL
)
{
dError
(
"failed to to create dnode object since %s"
,
terrstr
());
return
-
1
;
...
...
source/dnode/mgmt/exec/src/dndUtil.c
浏览文件 @
7435abcf
...
...
@@ -32,3 +32,24 @@ void dndPrintVersion() {
printf
(
"gitinfo: %s
\n
"
,
gitinfo
);
printf
(
"builuInfo: %s
\n
"
,
buildinfo
);
}
void
dndDumpCfg
()
{
SConfig
*
pCfg
=
taosGetCfg
();
cfgDumpCfg
(
pCfg
,
0
,
1
);
}
SDndCfg
dndGetCfg
()
{
SConfig
*
pCfg
=
taosGetCfg
();
SDndCfg
objCfg
=
{
0
};
objCfg
.
numOfSupportVnodes
=
cfgGetItem
(
pCfg
,
"supportVnodes"
)
->
i32
;
tstrncpy
(
objCfg
.
dataDir
,
tsDataDir
,
sizeof
(
objCfg
.
dataDir
));
tstrncpy
(
objCfg
.
firstEp
,
tsFirst
,
sizeof
(
objCfg
.
firstEp
));
tstrncpy
(
objCfg
.
secondEp
,
tsSecond
,
sizeof
(
objCfg
.
firstEp
));
objCfg
.
serverPort
=
tsServerPort
;
tstrncpy
(
objCfg
.
localFqdn
,
tsLocalFqdn
,
sizeof
(
objCfg
.
localFqdn
));
snprintf
(
objCfg
.
localEp
,
sizeof
(
objCfg
.
localEp
),
"%s:%u"
,
objCfg
.
localFqdn
,
objCfg
.
serverPort
);
objCfg
.
pDisks
=
tsDiskCfg
;
objCfg
.
numOfDisks
=
tsDiskCfgNum
;
return
objCfg
;
}
source/dnode/mgmt/
impl/
test/CMakeLists.txt
→
source/dnode/mgmt/test/CMakeLists.txt
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/bnode/CMakeLists.txt
→
source/dnode/mgmt/test/bnode/CMakeLists.txt
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/bnode/dbnode.cpp
→
source/dnode/mgmt/test/bnode/dbnode.cpp
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/mnode/CMakeLists.txt
→
source/dnode/mgmt/test/mnode/CMakeLists.txt
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/mnode/dmnode.cpp
→
source/dnode/mgmt/test/mnode/dmnode.cpp
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/qnode/CMakeLists.txt
→
source/dnode/mgmt/test/qnode/CMakeLists.txt
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/qnode/dqnode.cpp
→
source/dnode/mgmt/test/qnode/dqnode.cpp
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/snode/CMakeLists.txt
→
source/dnode/mgmt/test/snode/CMakeLists.txt
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/snode/dsnode.cpp
→
source/dnode/mgmt/test/snode/dsnode.cpp
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/sut/CMakeLists.txt
→
source/dnode/mgmt/test/sut/CMakeLists.txt
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/sut/inc/client.h
→
source/dnode/mgmt/test/sut/inc/client.h
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/sut/inc/server.h
→
source/dnode/mgmt/test/sut/inc/server.h
浏览文件 @
7435abcf
...
...
@@ -24,7 +24,7 @@ class TestServer {
bool
DoStart
();
private:
SDn
odeObj
Cfg
BuildOption
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
);
SDn
d
Cfg
BuildOption
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
);
private:
SDnode
*
pDnode
;
...
...
source/dnode/mgmt/
impl/
test/sut/inc/sut.h
→
source/dnode/mgmt/test/sut/inc/sut.h
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/sut/src/client.cpp
→
source/dnode/mgmt/test/sut/src/client.cpp
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/sut/src/server.cpp
→
source/dnode/mgmt/test/sut/src/server.cpp
浏览文件 @
7435abcf
...
...
@@ -22,8 +22,8 @@ void* serverLoop(void* param) {
}
}
SDn
odeObj
Cfg
TestServer
::
BuildOption
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
)
{
SDn
odeObj
Cfg
cfg
=
{
0
};
SDn
d
Cfg
TestServer
::
BuildOption
(
const
char
*
path
,
const
char
*
fqdn
,
uint16_t
port
,
const
char
*
firstEp
)
{
SDn
d
Cfg
cfg
=
{
0
};
cfg
.
numOfSupportVnodes
=
16
;
cfg
.
serverPort
=
port
;
strcpy
(
cfg
.
dataDir
,
path
);
...
...
@@ -34,7 +34,7 @@ SDnodeObjCfg TestServer::BuildOption(const char* path, const char* fqdn, uint16_
}
bool
TestServer
::
DoStart
()
{
SDn
odeObj
Cfg
cfg
=
BuildOption
(
path
,
fqdn
,
port
,
firstEp
);
SDn
d
Cfg
cfg
=
BuildOption
(
path
,
fqdn
,
port
,
firstEp
);
taosMkDir
(
path
);
pDnode
=
dndCreate
(
&
cfg
);
...
...
source/dnode/mgmt/
impl/
test/sut/src/sut.cpp
→
source/dnode/mgmt/test/sut/src/sut.cpp
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/vnode/CMakeLists.txt
→
source/dnode/mgmt/test/vnode/CMakeLists.txt
浏览文件 @
7435abcf
文件已移动
source/dnode/mgmt/
impl/
test/vnode/vnode.cpp
→
source/dnode/mgmt/test/vnode/vnode.cpp
浏览文件 @
7435abcf
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录