refactor: node mgmt
This commit is contained in:
parent
ffe27bc181
commit
e278a4f434
|
@ -1,5 +1,5 @@
|
||||||
add_subdirectory(node_mgmt)
|
add_subdirectory(node_mgmt)
|
||||||
add_subdirectory(node_common)
|
add_subdirectory(node_util)
|
||||||
add_subdirectory(mgmt_bnode)
|
add_subdirectory(mgmt_bnode)
|
||||||
add_subdirectory(mgmt_mnode)
|
add_subdirectory(mgmt_mnode)
|
||||||
add_subdirectory(mgmt_qnode)
|
add_subdirectory(mgmt_qnode)
|
||||||
|
|
|
@ -5,5 +5,5 @@ target_include_directories(
|
||||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||||
)
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
mgmt_bnode node_common
|
mgmt_bnode node_util
|
||||||
)
|
)
|
|
@ -16,7 +16,7 @@
|
||||||
#ifndef _TD_DND_BNODE_INT_H_
|
#ifndef _TD_DND_BNODE_INT_H_
|
||||||
#define _TD_DND_BNODE_INT_H_
|
#define _TD_DND_BNODE_INT_H_
|
||||||
|
|
||||||
#include "dmInt.h"
|
#include "dmUtil.h"
|
||||||
|
|
||||||
#include "bnode.h"
|
#include "bnode.h"
|
||||||
|
|
||||||
|
|
|
@ -5,5 +5,5 @@ target_include_directories(
|
||||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||||
)
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
mgmt_mnode node_common
|
mgmt_mnode node_util
|
||||||
)
|
)
|
|
@ -16,7 +16,7 @@
|
||||||
#ifndef _TD_DND_MNODE_INT_H_
|
#ifndef _TD_DND_MNODE_INT_H_
|
||||||
#define _TD_DND_MNODE_INT_H_
|
#define _TD_DND_MNODE_INT_H_
|
||||||
|
|
||||||
#include "dmInt.h"
|
#include "dmUtil.h"
|
||||||
#include "mnode.h"
|
#include "mnode.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -5,5 +5,5 @@ target_include_directories(
|
||||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||||
)
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
mgmt_qnode node_common
|
mgmt_qnode node_util
|
||||||
)
|
)
|
|
@ -16,7 +16,7 @@
|
||||||
#ifndef _TD_DND_QNODE_INT_H_
|
#ifndef _TD_DND_QNODE_INT_H_
|
||||||
#define _TD_DND_QNODE_INT_H_
|
#define _TD_DND_QNODE_INT_H_
|
||||||
|
|
||||||
#include "dmInt.h"
|
#include "dmUtil.h"
|
||||||
|
|
||||||
#include "qnode.h"
|
#include "qnode.h"
|
||||||
|
|
||||||
|
|
|
@ -5,5 +5,5 @@ target_include_directories(
|
||||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||||
)
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
mgmt_snode node_common
|
mgmt_snode node_util
|
||||||
)
|
)
|
|
@ -16,7 +16,7 @@
|
||||||
#ifndef _TD_DND_SNODE_INT_H_
|
#ifndef _TD_DND_SNODE_INT_H_
|
||||||
#define _TD_DND_SNODE_INT_H_
|
#define _TD_DND_SNODE_INT_H_
|
||||||
|
|
||||||
#include "dmInt.h"
|
#include "dmUtil.h"
|
||||||
|
|
||||||
#include "snode.h"
|
#include "snode.h"
|
||||||
|
|
||||||
|
|
|
@ -5,5 +5,5 @@ target_include_directories(
|
||||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||||
)
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
mgmt_vnode node_common
|
mgmt_vnode node_util
|
||||||
)
|
)
|
|
@ -16,7 +16,7 @@
|
||||||
#ifndef _TD_DND_VNODES_INT_H_
|
#ifndef _TD_DND_VNODES_INT_H_
|
||||||
#define _TD_DND_VNODES_INT_H_
|
#define _TD_DND_VNODES_INT_H_
|
||||||
|
|
||||||
#include "dmInt.h"
|
#include "dmUtil.h"
|
||||||
|
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
#include "vnode.h"
|
#include "vnode.h"
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
aux_source_directory(src DNODE_INTERFACE)
|
|
||||||
add_library(node_common STATIC ${DNODE_INTERFACE})
|
|
||||||
target_include_directories(
|
|
||||||
node_common
|
|
||||||
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
|
|
||||||
)
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
aux_source_directory(src NODE_UTIL)
|
||||||
|
add_library(node_util STATIC ${NODE_UTIL})
|
||||||
|
target_include_directories(
|
||||||
|
node_util
|
||||||
|
PUBLIC "${TD_SOURCE_DIR}/include/dnode/mgmt"
|
||||||
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||||
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
node_util cjson mnode vnode qnode snode bnode wal sync taos_static tfs monitor
|
||||||
|
)
|
|
@ -133,6 +133,7 @@ typedef struct {
|
||||||
const char *dmStatStr(EDndRunStatus stype);
|
const char *dmStatStr(EDndRunStatus stype);
|
||||||
const char *dmNodeLogName(EDndNodeType ntype);
|
const char *dmNodeLogName(EDndNodeType ntype);
|
||||||
const char *dmNodeProcName(EDndNodeType ntype);
|
const char *dmNodeProcName(EDndNodeType ntype);
|
||||||
|
const char *dmNodeName(EDndNodeType ntype);
|
||||||
const char *dmEventStr(EDndEvent etype);
|
const char *dmEventStr(EDndEvent etype);
|
||||||
const char *dmProcStr(EDndProcType ptype);
|
const char *dmProcStr(EDndProcType ptype);
|
||||||
void *dmSetMgmtHandle(SArray *pArray, tmsg_t msgType, void *nodeMsgFp, bool needCheckVgId);
|
void *dmSetMgmtHandle(SArray *pArray, tmsg_t msgType, void *nodeMsgFp, bool needCheckVgId);
|
|
@ -14,7 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "dmInt.h"
|
#include "dmUtil.h"
|
||||||
|
|
||||||
static int8_t once = DND_ENV_INIT;
|
static int8_t once = DND_ENV_INIT;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "dmInt.h"
|
#include "dmUtil.h"
|
||||||
|
|
||||||
#define MAXLEN 1024
|
#define MAXLEN 1024
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "dmInt.h"
|
#include "dmUtil.h"
|
||||||
|
|
||||||
|
|
||||||
const char *dmStatStr(EDndRunStatus stype) {
|
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) {
|
const char *dmEventStr(EDndEvent ev) {
|
||||||
switch (ev) {
|
switch (ev) {
|
||||||
case DND_EVENT_START:
|
case DND_EVENT_START:
|
Loading…
Reference in New Issue