提交 e278a4f4 编写于 作者: S Shengliang

refactor: node mgmt

上级 ffe27bc1
add_subdirectory(node_mgmt)
add_subdirectory(node_common)
add_subdirectory(node_util)
add_subdirectory(mgmt_bnode)
add_subdirectory(mgmt_mnode)
add_subdirectory(mgmt_qnode)
......
......@@ -5,5 +5,5 @@ target_include_directories(
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
target_link_libraries(
mgmt_bnode node_common
mgmt_bnode node_util
)
\ No newline at end of file
......@@ -16,7 +16,7 @@
#ifndef _TD_DND_BNODE_INT_H_
#define _TD_DND_BNODE_INT_H_
#include "dmInt.h"
#include "dmUtil.h"
#include "bnode.h"
......
......@@ -5,5 +5,5 @@ target_include_directories(
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
target_link_libraries(
mgmt_mnode node_common
mgmt_mnode node_util
)
\ No newline at end of file
......@@ -16,7 +16,7 @@
#ifndef _TD_DND_MNODE_INT_H_
#define _TD_DND_MNODE_INT_H_
#include "dmInt.h"
#include "dmUtil.h"
#include "mnode.h"
#ifdef __cplusplus
......
......@@ -5,5 +5,5 @@ target_include_directories(
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
target_link_libraries(
mgmt_qnode node_common
mgmt_qnode node_util
)
\ No newline at end of file
......@@ -16,7 +16,7 @@
#ifndef _TD_DND_QNODE_INT_H_
#define _TD_DND_QNODE_INT_H_
#include "dmInt.h"
#include "dmUtil.h"
#include "qnode.h"
......
......@@ -5,5 +5,5 @@ target_include_directories(
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
target_link_libraries(
mgmt_snode node_common
mgmt_snode node_util
)
\ No newline at end of file
......@@ -16,7 +16,7 @@
#ifndef _TD_DND_SNODE_INT_H_
#define _TD_DND_SNODE_INT_H_
#include "dmInt.h"
#include "dmUtil.h"
#include "snode.h"
......
......@@ -5,5 +5,5 @@ target_include_directories(
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
target_link_libraries(
mgmt_vnode node_common
mgmt_vnode node_util
)
\ No newline at end of file
......@@ -16,7 +16,7 @@
#ifndef _TD_DND_VNODES_INT_H_
#define _TD_DND_VNODES_INT_H_
#include "dmInt.h"
#include "dmUtil.h"
#include "sync.h"
#include "vnode.h"
......
aux_source_directory(src DNODE_INTERFACE)
add_library(node_common STATIC ${DNODE_INTERFACE})
aux_source_directory(src NODE_UTIL)
add_library(node_util STATIC ${NODE_UTIL})
target_include_directories(
node_common
node_util
PUBLIC "${TD_SOURCE_DIR}/include/dnode/mgmt"
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/inc"
)
target_link_libraries(
node_common cjson mnode vnode qnode snode bnode wal sync taos_static tfs monitor
node_util cjson mnode vnode qnode snode bnode wal sync taos_static tfs monitor
)
\ No newline at end of file
......@@ -133,6 +133,7 @@ typedef struct {
const char *dmStatStr(EDndRunStatus stype);
const char *dmNodeLogName(EDndNodeType ntype);
const char *dmNodeProcName(EDndNodeType ntype);
const char *dmNodeName(EDndNodeType ntype);
const char *dmEventStr(EDndEvent etype);
const char *dmProcStr(EDndProcType ptype);
void *dmSetMgmtHandle(SArray *pArray, tmsg_t msgType, void *nodeMsgFp, bool needCheckVgId);
......
......@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include "dmInt.h"
#include "dmUtil.h"
static int8_t once = DND_ENV_INIT;
......
......@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include "dmInt.h"
#include "dmUtil.h"
#define MAXLEN 1024
......
......@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include "dmInt.h"
#include "dmUtil.h"
const char *dmStatStr(EDndRunStatus stype) {
......@@ -64,6 +64,23 @@ const char *dmNodeProcName(EDndNodeType ntype) {
}
}
const char *dmNodeName(EDndNodeType ntype) {
switch (ntype) {
case VNODE:
return "vnode";
case QNODE:
return "qnode";
case SNODE:
return "snode";
case MNODE:
return "mnode";
case BNODE:
return "bnode";
default:
return "dnode";
}
}
const char *dmEventStr(EDndEvent ev) {
switch (ev) {
case DND_EVENT_START:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册