Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4df0c48f
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
4df0c48f
编写于
4月 12, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact(cluster): node mgmt
上级
35e29f0b
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
154 addition
and
109 deletion
+154
-109
source/dnode/mgmt/CMakeLists.txt
source/dnode/mgmt/CMakeLists.txt
+8
-35
source/dnode/mgmt/exe/CMakeLists.txt
source/dnode/mgmt/exe/CMakeLists.txt
+7
-0
source/dnode/mgmt/implement/CMakeLists.txt
source/dnode/mgmt/implement/CMakeLists.txt
+9
-0
source/dnode/mgmt/implement/inc/dndNode.h
source/dnode/mgmt/implement/inc/dndNode.h
+1
-3
source/dnode/mgmt/implement/src/dmMonitor.c
source/dnode/mgmt/implement/src/dmMonitor.c
+1
-14
source/dnode/mgmt/implement/src/dndTransport.c
source/dnode/mgmt/implement/src/dndTransport.c
+13
-11
source/dnode/mgmt/interface/CMakeLists.txt
source/dnode/mgmt/interface/CMakeLists.txt
+1
-1
source/dnode/mgmt/interface/inc/dndInt.h
source/dnode/mgmt/interface/inc/dndInt.h
+2
-0
source/dnode/mgmt/interface/src/dndInt.c
source/dnode/mgmt/interface/src/dndInt.c
+19
-0
source/dnode/mgmt/mgmt_bnode/CMakeLists.txt
source/dnode/mgmt/mgmt_bnode/CMakeLists.txt
+9
-0
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
+1
-1
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
+3
-2
source/dnode/mgmt/mgmt_mnode/CMakeLists.txt
source/dnode/mgmt/mgmt_mnode/CMakeLists.txt
+9
-0
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
+2
-1
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+1
-1
source/dnode/mgmt/mgmt_qnode/CMakeLists.txt
source/dnode/mgmt/mgmt_qnode/CMakeLists.txt
+9
-0
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
+2
-1
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
+3
-2
source/dnode/mgmt/mgmt_snode/CMakeLists.txt
source/dnode/mgmt/mgmt_snode/CMakeLists.txt
+9
-0
source/dnode/mgmt/mgmt_snode/inc/smInt.h
source/dnode/mgmt/mgmt_snode/inc/smInt.h
+2
-1
source/dnode/mgmt/mgmt_snode/src/smHandle.c
source/dnode/mgmt/mgmt_snode/src/smHandle.c
+3
-2
source/dnode/mgmt/mgmt_vnode/CMakeLists.txt
source/dnode/mgmt/mgmt_vnode/CMakeLists.txt
+9
-0
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
+3
-1
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
+1
-1
source/dnode/mgmt/test/CMakeLists.txt
source/dnode/mgmt/test/CMakeLists.txt
+9
-8
source/dnode/mgmt/test/bnode/CMakeLists.txt
source/dnode/mgmt/test/bnode/CMakeLists.txt
+3
-4
source/dnode/mgmt/test/mnode/CMakeLists.txt
source/dnode/mgmt/test/mnode/CMakeLists.txt
+3
-4
source/dnode/mgmt/test/qnode/CMakeLists.txt
source/dnode/mgmt/test/qnode/CMakeLists.txt
+2
-2
source/dnode/mgmt/test/snode/CMakeLists.txt
source/dnode/mgmt/test/snode/CMakeLists.txt
+2
-2
source/dnode/mgmt/test/sut/CMakeLists.txt
source/dnode/mgmt/test/sut/CMakeLists.txt
+6
-10
source/dnode/mgmt/test/vnode/CMakeLists.txt
source/dnode/mgmt/test/vnode/CMakeLists.txt
+2
-2
未找到文件。
source/dnode/mgmt/CMakeLists.txt
浏览文件 @
4df0c48f
add_subdirectory
(
exe
)
add_subdirectory
(
interface
)
aux_source_directory
(
implement/src DNODE_SRC
)
aux_source_directory
(
mgmt_bnode/src DNODE_SRC
)
aux_source_directory
(
mgmt_mnode/src DNODE_SRC
)
aux_source_directory
(
mgmt_qnode/src DNODE_SRC
)
aux_source_directory
(
mgmt_snode/src DNODE_SRC
)
aux_source_directory
(
mgmt_vnode/src DNODE_SRC
)
add_library
(
dnode STATIC
${
DNODE_SRC
}
)
target_link_libraries
(
dnode dnode_interface
)
target_include_directories
(
dnode
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/dnode/mgmt"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/implement/inc"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/mgmt_bnode/inc"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/mgmt_mnode/inc"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/mgmt_qnode/inc"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/mgmt_snode/inc"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/mgmt_vnode/inc"
)
aux_source_directory
(
exe EXEC_SRC
)
add_executable
(
taosd
${
EXEC_SRC
}
)
target_include_directories
(
taosd
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/implement/inc"
)
target_link_libraries
(
taosd dnode
)
if
(
${
BUILD_TEST
}
)
add_subdirectory
(
test
)
endif
(
${
BUILD_TEST
}
)
add_subdirectory
(
implement
)
add_subdirectory
(
mgmt_bnode
)
add_subdirectory
(
mgmt_mnode
)
add_subdirectory
(
mgmt_qnode
)
add_subdirectory
(
mgmt_snode
)
add_subdirectory
(
mgmt_vnode
)
add_subdirectory
(
test
)
source/dnode/mgmt/exe/CMakeLists.txt
0 → 100644
浏览文件 @
4df0c48f
aux_source_directory
(
. EXEC_SRC
)
add_executable
(
taosd
${
EXEC_SRC
}
)
target_include_directories
(
taosd
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../implement/inc"
)
target_link_libraries
(
taosd dnode
)
source/dnode/mgmt/implement/CMakeLists.txt
0 → 100644
浏览文件 @
4df0c48f
aux_source_directory
(
src IMPLEMENT_SRC
)
add_library
(
dnode STATIC
${
IMPLEMENT_SRC
}
)
target_link_libraries
(
dnode mgmt_bnode mgmt_mnode mgmt_qnode mgmt_snode mgmt_vnode
)
target_include_directories
(
dnode
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
\ No newline at end of file
source/dnode/mgmt/implement/inc/dndNode.h
浏览文件 @
4df0c48f
...
...
@@ -28,7 +28,6 @@ void dndCloseNode(SMgmtWrapper *pWrapper);
// dndTransport.c
int32_t
dndInitTrans
(
SDnode
*
pDnode
);
void
dndCleanupTrans
(
SDnode
*
pDnode
);
SMsgCb
dndCreateMsgcb
(
SMgmtWrapper
*
pWrapper
);
SProcCfg
dndGenProcCfg
(
SMgmtWrapper
*
pWrapper
);
int32_t
dndInitMsgHandle
(
SDnode
*
pDnode
);
void
dndSendRecv
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
,
SRpcMsg
*
pRsp
);
...
...
@@ -45,8 +44,7 @@ void dmGetMnodeEpSet(SDnodeData *pMgmt, SEpSet *pEpSet);
void
dmUpdateMnodeEpSet
(
SDnodeData
*
pMgmt
,
SEpSet
*
pEpSet
);
void
dmSendRedirectRsp
(
SDnodeData
*
pMgmt
,
const
SRpcMsg
*
pMsg
);
void
dmGetMonitorSysInfo
(
SMonSysInfo
*
pInfo
);
void
vmGetVnodeLoads
(
SMgmtWrapper
*
pWrapper
,
SMonVloadInfo
*
pInfo
);
void
vmGetVnodeLoads
(
SMgmtWrapper
*
pWrapper
,
SMonVloadInfo
*
pInfo
);
void
mmGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonMmInfo
*
mmInfo
);
void
vmGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonVmInfo
*
vmInfo
);
void
qmGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonQmInfo
*
qmInfo
);
...
...
source/dnode/mgmt/implement/src/dmMonitor.c
浏览文件 @
4df0c48f
...
...
@@ -37,7 +37,7 @@ static void dmGetMonitorDnodeInfo(SDnode *pDnode, SMonDnodeInfo *pInfo) {
static
void
dmGetMonitorInfo
(
SDnode
*
pDnode
,
SMonDmInfo
*
pInfo
)
{
dmGetMonitorBasicInfo
(
pDnode
,
&
pInfo
->
basic
);
d
m
GetMonitorSysInfo
(
&
pInfo
->
sys
);
d
nd
GetMonitorSysInfo
(
&
pInfo
->
sys
);
dmGetMonitorDnodeInfo
(
pDnode
,
&
pInfo
->
dnode
);
}
...
...
@@ -179,16 +179,3 @@ void dmGetVnodeLoads(SMgmtWrapper *pWrapper, SMonVloadInfo *pInfo) {
rpcFreeCont
(
rsp
.
pCont
);
}
}
void
dmGetMonitorSysInfo
(
SMonSysInfo
*
pInfo
)
{
taosGetCpuUsage
(
&
pInfo
->
cpu_engine
,
&
pInfo
->
cpu_system
);
taosGetCpuCores
(
&
pInfo
->
cpu_cores
);
taosGetProcMemory
(
&
pInfo
->
mem_engine
);
taosGetSysMemory
(
&
pInfo
->
mem_system
);
pInfo
->
mem_total
=
tsTotalMemoryKB
;
pInfo
->
disk_engine
=
0
;
pInfo
->
disk_used
=
tsDataSpace
.
size
.
used
;
pInfo
->
disk_total
=
tsDataSpace
.
size
.
total
;
taosGetCardInfoDelta
(
&
pInfo
->
net_in
,
&
pInfo
->
net_out
);
taosGetProcIODelta
(
&
pInfo
->
io_read
,
&
pInfo
->
io_write
,
&
pInfo
->
io_read_disk
,
&
pInfo
->
io_write_disk
);
}
source/dnode/mgmt/implement/src/dndTransport.c
浏览文件 @
4df0c48f
...
...
@@ -19,6 +19,10 @@
#define INTERNAL_USER "_dnd"
#define INTERNAL_CKEY "_key"
#define INTERNAL_SECRET "_pwd"
static
int32_t
dndSendReq
(
SMgmtWrapper
*
pWrapper
,
const
SEpSet
*
pEpSet
,
SRpcMsg
*
pReq
);
static
void
dndSendRsp
(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
);
static
void
dndRegisterBrokenLinkArg
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pMsg
);
static
void
dndReleaseHandle
(
SMgmtWrapper
*
pWrapper
,
void
*
handle
,
int8_t
type
);
static
void
dndUpdateMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
NODE_BEGIN
];
...
...
@@ -299,6 +303,15 @@ static void dndCleanupServer(SDnode *pDnode) {
int32_t
dndInitTrans
(
SDnode
*
pDnode
)
{
if
(
dndInitServer
(
pDnode
)
!=
0
)
return
-
1
;
if
(
dndInitClient
(
pDnode
)
!=
0
)
return
-
1
;
SMsgCb
msgCb
=
{
.
sendReqFp
=
dndSendReq
,
.
sendRspFp
=
dndSendRsp
,
.
registerBrokenLinkArgFp
=
dndRegisterBrokenLinkArg
,
.
releaseHandleFp
=
dndReleaseHandle
,
};
pDnode
->
data
.
msgCb
=
msgCb
;
return
0
;
}
...
...
@@ -412,17 +425,6 @@ static void dndReleaseHandle(SMgmtWrapper *pWrapper, void *handle, int8_t type)
}
}
SMsgCb
dndCreateMsgcb
(
SMgmtWrapper
*
pWrapper
)
{
SMsgCb
msgCb
=
{
.
pWrapper
=
pWrapper
,
.
sendReqFp
=
dndSendReq
,
.
sendRspFp
=
dndSendRsp
,
.
registerBrokenLinkArgFp
=
dndRegisterBrokenLinkArg
,
.
releaseHandleFp
=
dndReleaseHandle
,
};
return
msgCb
;
}
static
void
dndConsumeChildQueue
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
,
int16_t
msgLen
,
void
*
pCont
,
int32_t
contLen
,
ProcFuncType
ftype
)
{
SRpcMsg
*
pRpc
=
&
pMsg
->
rpcMsg
;
...
...
source/dnode/mgmt/interface/CMakeLists.txt
浏览文件 @
4df0c48f
...
...
@@ -6,5 +6,5 @@ target_include_directories(
PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
dnode_interface cjson mnode vnode qnode snode bnode wal sync taos tfs monitor
util
dnode_interface cjson mnode vnode qnode snode bnode wal sync taos tfs monitor
)
\ No newline at end of file
source/dnode/mgmt/interface/inc/dndInt.h
浏览文件 @
4df0c48f
...
...
@@ -36,6 +36,8 @@ void dndSetEvent(SDnode *pDnode, EDndEvent event);
void
dndSetMsgHandle
(
SMgmtWrapper
*
pWrapper
,
tmsg_t
msgType
,
NodeMsgFp
nodeMsgFp
,
int8_t
vgId
);
void
dndReportStartup
(
SDnode
*
pDnode
,
const
char
*
pName
,
const
char
*
pDesc
);
void
dndProcessStartupReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
void
dndGetMonitorSysInfo
(
SMonSysInfo
*
pInfo
);
SMsgCb
dndCreateMsgcb
(
SMgmtWrapper
*
pWrapper
);
// dndFile.c
int32_t
dndReadFile
(
SMgmtWrapper
*
pWrapper
,
bool
*
pDeployed
);
...
...
source/dnode/mgmt/interface/src/dndInt.c
浏览文件 @
4df0c48f
...
...
@@ -160,3 +160,22 @@ void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pReq) {
.
handle
=
pReq
->
handle
,
.
pCont
=
pStartup
,
.
contLen
=
sizeof
(
SStartupReq
),
.
ahandle
=
pReq
->
ahandle
};
rpcSendResponse
(
&
rpcRsp
);
}
void
dndGetMonitorSysInfo
(
SMonSysInfo
*
pInfo
)
{
taosGetCpuUsage
(
&
pInfo
->
cpu_engine
,
&
pInfo
->
cpu_system
);
taosGetCpuCores
(
&
pInfo
->
cpu_cores
);
taosGetProcMemory
(
&
pInfo
->
mem_engine
);
taosGetSysMemory
(
&
pInfo
->
mem_system
);
pInfo
->
mem_total
=
tsTotalMemoryKB
;
pInfo
->
disk_engine
=
0
;
pInfo
->
disk_used
=
tsDataSpace
.
size
.
used
;
pInfo
->
disk_total
=
tsDataSpace
.
size
.
total
;
taosGetCardInfoDelta
(
&
pInfo
->
net_in
,
&
pInfo
->
net_out
);
taosGetProcIODelta
(
&
pInfo
->
io_read
,
&
pInfo
->
io_write
,
&
pInfo
->
io_read_disk
,
&
pInfo
->
io_write_disk
);
}
SMsgCb
dndCreateMsgcb
(
SMgmtWrapper
*
pWrapper
)
{
SMsgCb
msgCb
=
pWrapper
->
pDnode
->
data
.
msgCb
;
msgCb
.
pWrapper
=
pWrapper
;
return
msgCb
;
}
\ No newline at end of file
source/dnode/mgmt/mgmt_bnode/CMakeLists.txt
0 → 100644
浏览文件 @
4df0c48f
aux_source_directory
(
src MGMT_BNODE
)
add_library
(
mgmt_bnode STATIC
${
MGMT_BNODE
}
)
target_include_directories
(
mgmt_bnode
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
mgmt_bnode dnode_interface
)
\ No newline at end of file
source/dnode/mgmt/mgmt_bnode/inc/bmInt.h
浏览文件 @
4df0c48f
...
...
@@ -16,7 +16,7 @@
#ifndef _TD_DND_BNODE_INT_H_
#define _TD_DND_BNODE_INT_H_
#include "dnd
Node
.h"
#include "dnd
Int
.h"
#include "bnode.h"
...
...
source/dnode/mgmt/mgmt_bnode/src/bmHandle.c
浏览文件 @
4df0c48f
...
...
@@ -21,7 +21,7 @@ void bmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonBmInfo *bmInfo) {}
int32_t
bmProcessGetMonBmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
)
{
SMonBmInfo
bmInfo
=
{
0
};
bmGetMonitorInfo
(
pWrapper
,
&
bmInfo
);
d
m
GetMonitorSysInfo
(
&
bmInfo
.
sys
);
d
nd
GetMonitorSysInfo
(
&
bmInfo
.
sys
);
monGetLogs
(
&
bmInfo
.
log
);
int32_t
rspLen
=
tSerializeSMonBmInfo
(
NULL
,
0
,
&
bmInfo
);
...
...
@@ -58,7 +58,8 @@ int32_t bmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
dError
(
"failed to create bnode since %s, input:%d cur:%d"
,
terrstr
(),
createReq
.
dnodeId
,
pDnode
->
data
.
dnodeId
);
return
-
1
;
}
else
{
return
dndOpenNode
(
pWrapper
);
// return dndOpenNode(pWrapper);
return
0
;
}
}
...
...
source/dnode/mgmt/mgmt_mnode/CMakeLists.txt
0 → 100644
浏览文件 @
4df0c48f
aux_source_directory
(
src MGMT_MNODE
)
add_library
(
mgmt_mnode STATIC
${
MGMT_MNODE
}
)
target_include_directories
(
mgmt_mnode
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
mgmt_mnode dnode_interface
)
\ No newline at end of file
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
浏览文件 @
4df0c48f
...
...
@@ -16,7 +16,8 @@
#ifndef _TD_DND_MNODE_INT_H_
#define _TD_DND_MNODE_INT_H_
#include "dndNode.h"
#include "dndInt.h"
#include "mnode.h"
#ifdef __cplusplus
...
...
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
浏览文件 @
4df0c48f
...
...
@@ -24,7 +24,7 @@ void mmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonMmInfo *mmInfo) {
int32_t
mmProcessGetMonMmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
)
{
SMonMmInfo
mmInfo
=
{
0
};
mmGetMonitorInfo
(
pWrapper
,
&
mmInfo
);
d
m
GetMonitorSysInfo
(
&
mmInfo
.
sys
);
d
nd
GetMonitorSysInfo
(
&
mmInfo
.
sys
);
monGetLogs
(
&
mmInfo
.
log
);
int32_t
rspLen
=
tSerializeSMonMmInfo
(
NULL
,
0
,
&
mmInfo
);
...
...
source/dnode/mgmt/mgmt_qnode/CMakeLists.txt
0 → 100644
浏览文件 @
4df0c48f
aux_source_directory
(
src MGMT_QNODE
)
add_library
(
mgmt_qnode STATIC
${
MGMT_QNODE
}
)
target_include_directories
(
mgmt_qnode
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
mgmt_qnode dnode_interface
)
\ No newline at end of file
source/dnode/mgmt/mgmt_qnode/inc/qmInt.h
浏览文件 @
4df0c48f
...
...
@@ -16,7 +16,8 @@
#ifndef _TD_DND_QNODE_INT_H_
#define _TD_DND_QNODE_INT_H_
#include "dndNode.h"
#include "dndInt.h"
#include "qnode.h"
#ifdef __cplusplus
...
...
source/dnode/mgmt/mgmt_qnode/src/qmHandle.c
浏览文件 @
4df0c48f
...
...
@@ -21,7 +21,7 @@ void qmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonQmInfo *qmInfo) {}
int32_t
qmProcessGetMonQmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
)
{
SMonQmInfo
qmInfo
=
{
0
};
qmGetMonitorInfo
(
pWrapper
,
&
qmInfo
);
d
m
GetMonitorSysInfo
(
&
qmInfo
.
sys
);
d
nd
GetMonitorSysInfo
(
&
qmInfo
.
sys
);
monGetLogs
(
&
qmInfo
.
log
);
int32_t
rspLen
=
tSerializeSMonQmInfo
(
NULL
,
0
,
&
qmInfo
);
...
...
@@ -58,7 +58,8 @@ int32_t qmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
dError
(
"failed to create qnode since %s"
,
terrstr
());
return
-
1
;
}
else
{
return
dndOpenNode
(
pWrapper
);
// return dndOpenNode(pWrapper);
return
0
;
}
}
...
...
source/dnode/mgmt/mgmt_snode/CMakeLists.txt
0 → 100644
浏览文件 @
4df0c48f
aux_source_directory
(
src MGMT_SNODE
)
add_library
(
mgmt_snode STATIC
${
MGMT_SNODE
}
)
target_include_directories
(
mgmt_snode
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
mgmt_snode dnode_interface
)
\ No newline at end of file
source/dnode/mgmt/mgmt_snode/inc/smInt.h
浏览文件 @
4df0c48f
...
...
@@ -16,7 +16,8 @@
#ifndef _TD_DND_SNODE_INT_H_
#define _TD_DND_SNODE_INT_H_
#include "dndNode.h"
#include "dndInt.h"
#include "snode.h"
#ifdef __cplusplus
...
...
source/dnode/mgmt/mgmt_snode/src/smHandle.c
浏览文件 @
4df0c48f
...
...
@@ -21,7 +21,7 @@ void smGetMonitorInfo(SMgmtWrapper *pWrapper, SMonSmInfo *smInfo) {}
int32_t
smProcessGetMonSmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
)
{
SMonSmInfo
smInfo
=
{
0
};
smGetMonitorInfo
(
pWrapper
,
&
smInfo
);
d
m
GetMonitorSysInfo
(
&
smInfo
.
sys
);
d
nd
GetMonitorSysInfo
(
&
smInfo
.
sys
);
monGetLogs
(
&
smInfo
.
log
);
int32_t
rspLen
=
tSerializeSMonSmInfo
(
NULL
,
0
,
&
smInfo
);
...
...
@@ -58,7 +58,8 @@ int32_t smProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
dError
(
"failed to create snode since %s"
,
terrstr
());
return
-
1
;
}
else
{
return
dndOpenNode
(
pWrapper
);
// return dndOpenNode(pWrapper);
return
0
;
}
}
...
...
source/dnode/mgmt/mgmt_vnode/CMakeLists.txt
0 → 100644
浏览文件 @
4df0c48f
aux_source_directory
(
src MGMT_VNODE
)
add_library
(
mgmt_vnode STATIC
${
MGMT_VNODE
}
)
target_include_directories
(
mgmt_vnode
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
mgmt_vnode dnode_interface
)
\ No newline at end of file
source/dnode/mgmt/mgmt_vnode/inc/vmInt.h
浏览文件 @
4df0c48f
...
...
@@ -16,8 +16,9 @@
#ifndef _TD_DND_VNODES_INT_H_
#define _TD_DND_VNODES_INT_H_
#include "dndInt.h"
#include "sync.h"
#include "dndNode.h"
#include "vnode.h"
#ifdef __cplusplus
...
...
@@ -95,6 +96,7 @@ int32_t vmProcessSyncVnodeReq(SVnodesMgmt *pMgmt, SNodeMsg *pReq);
int32_t
vmProcessCompactVnodeReq
(
SVnodesMgmt
*
pMgmt
,
SNodeMsg
*
pReq
);
int32_t
vmProcessGetMonVmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
);
int32_t
vmProcessGetVnodeLoadsReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
);
void
vmGetVnodeLoads
(
SMgmtWrapper
*
pWrapper
,
SMonVloadInfo
*
pInfo
);
// vmFile.c
int32_t
vmGetVnodesFromFile
(
SVnodesMgmt
*
pMgmt
,
SWrapperCfg
**
ppCfgs
,
int32_t
*
numOfVnodes
);
...
...
source/dnode/mgmt/mgmt_vnode/src/vmHandle.c
浏览文件 @
4df0c48f
...
...
@@ -36,7 +36,7 @@ void vmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonVmInfo *vmInfo) {
int32_t
vmProcessGetMonVmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
)
{
SMonVmInfo
vmInfo
=
{
0
};
vmGetMonitorInfo
(
pWrapper
,
&
vmInfo
);
d
m
GetMonitorSysInfo
(
&
vmInfo
.
sys
);
d
nd
GetMonitorSysInfo
(
&
vmInfo
.
sys
);
monGetLogs
(
&
vmInfo
.
log
);
int32_t
rspLen
=
tSerializeSMonVmInfo
(
NULL
,
0
,
&
vmInfo
);
...
...
source/dnode/mgmt/test/CMakeLists.txt
浏览文件 @
4df0c48f
enable_testing
()
add_subdirectory
(
qnode
)
add_subdirectory
(
bnode
)
add_subdirectory
(
snode
)
add_subdirectory
(
mnode
)
add_subdirectory
(
vnode
)
add_subdirectory
(
sut
)
if
(
${
BUILD_TEST
}
)
enable_testing
()
add_subdirectory
(
qnode
)
add_subdirectory
(
bnode
)
add_subdirectory
(
snode
)
add_subdirectory
(
mnode
)
add_subdirectory
(
vnode
)
add_subdirectory
(
sut
)
endif
(
${
BUILD_TEST
}
)
source/dnode/mgmt/test/bnode/CMakeLists.txt
浏览文件 @
4df0c48f
aux_source_directory
(
.
BQ
TEST_SRC
)
add_executable
(
dbnodeTest
${
BQ
TEST_SRC
}
)
aux_source_directory
(
.
DND_BNODE_
TEST_SRC
)
add_executable
(
dbnodeTest
${
DND_BNODE_
TEST_SRC
}
)
target_link_libraries
(
dbnodeTest
PUBLIC sut
dbnodeTest sut
)
add_test
(
...
...
source/dnode/mgmt/test/mnode/CMakeLists.txt
浏览文件 @
4df0c48f
aux_source_directory
(
. D
M
TEST_SRC
)
add_executable
(
dmnodeTest
${
D
M
TEST_SRC
}
)
aux_source_directory
(
. D
ND_MNODE_
TEST_SRC
)
add_executable
(
dmnodeTest
${
D
ND_MNODE_
TEST_SRC
}
)
target_link_libraries
(
dmnodeTest
PUBLIC sut
dmnodeTest sut
)
add_test
(
...
...
source/dnode/mgmt/test/qnode/CMakeLists.txt
浏览文件 @
4df0c48f
aux_source_directory
(
. D
Q
TEST_SRC
)
add_executable
(
dqnodeTest
${
D
Q
TEST_SRC
}
)
aux_source_directory
(
. D
ND_QNODE_
TEST_SRC
)
add_executable
(
dqnodeTest
${
D
ND_QNODE_
TEST_SRC
}
)
target_link_libraries
(
dqnodeTest
PUBLIC sut
...
...
source/dnode/mgmt/test/snode/CMakeLists.txt
浏览文件 @
4df0c48f
aux_source_directory
(
.
SQ
TEST_SRC
)
add_executable
(
dsnodeTest
${
SQ
TEST_SRC
}
)
aux_source_directory
(
.
DND_SNODE_
TEST_SRC
)
add_executable
(
dsnodeTest
${
DND_SNODE_
TEST_SRC
}
)
target_link_libraries
(
dsnodeTest
PUBLIC sut
...
...
source/dnode/mgmt/test/sut/CMakeLists.txt
浏览文件 @
4df0c48f
aux_source_directory
(
src SUT_SRC
)
add_library
(
sut STATIC STATIC
${
SUT_SRC
}
)
target_link_libraries
(
sut
PUBLIC dnode
PUBLIC util
PUBLIC os
PUBLIC gtest_main
)
aux_source_directory
(
src DND_SUT_SRC
)
add_library
(
sut STATIC STATIC
${
DND_SUT_SRC
}
)
target_include_directories
(
sut
PUBLIC
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
)
target_link_libraries
(
sut dnode gtest_main
)
source/dnode/mgmt/test/vnode/CMakeLists.txt
浏览文件 @
4df0c48f
aux_source_directory
(
.
VNODE
_SRC
)
add_executable
(
dvnodeTest
${
VNODE
_SRC
}
)
aux_source_directory
(
.
DND_VNODE_TEST
_SRC
)
add_executable
(
dvnodeTest
${
DND_VNODE_TEST
_SRC
}
)
target_link_libraries
(
dvnodeTest
PUBLIC sut
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录