diff --git a/source/dnode/mgmt/CMakeLists.txt b/source/dnode/mgmt/CMakeLists.txt index bdc9f1741d442003986df23109f9a1decb120409..d38f185409f3e0c4a09af853f362035d639dbefa 100644 --- a/source/dnode/mgmt/CMakeLists.txt +++ b/source/dnode/mgmt/CMakeLists.txt @@ -1,5 +1,5 @@ add_subdirectory(node_mgmt) -add_subdirectory(node_common) +add_subdirectory(node_util) add_subdirectory(mgmt_bnode) add_subdirectory(mgmt_mnode) add_subdirectory(mgmt_qnode) diff --git a/source/dnode/mgmt/mgmt_bnode/CMakeLists.txt b/source/dnode/mgmt/mgmt_bnode/CMakeLists.txt index 4c35a4ade6133a74d08ce8efc973fccecd88a9af..0a6cf52fb86dfd7ac24332631f2b9a1ee6c2c572 100644 --- a/source/dnode/mgmt/mgmt_bnode/CMakeLists.txt +++ b/source/dnode/mgmt/mgmt_bnode/CMakeLists.txt @@ -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 diff --git a/source/dnode/mgmt/mgmt_bnode/inc/bmInt.h b/source/dnode/mgmt/mgmt_bnode/inc/bmInt.h index dccf5790e437ba8005957275431f28caf2d71cb3..0ae0e7ef70f41c275aa6dc25640a57fc60413661 100644 --- a/source/dnode/mgmt/mgmt_bnode/inc/bmInt.h +++ b/source/dnode/mgmt/mgmt_bnode/inc/bmInt.h @@ -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" diff --git a/source/dnode/mgmt/mgmt_mnode/CMakeLists.txt b/source/dnode/mgmt/mgmt_mnode/CMakeLists.txt index 54171a2daf34bb2e84447598a46bbc3f6c523946..04118590a2ef0fce1f1a6d38e3862a41a0f9ae32 100644 --- a/source/dnode/mgmt/mgmt_mnode/CMakeLists.txt +++ b/source/dnode/mgmt/mgmt_mnode/CMakeLists.txt @@ -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 diff --git a/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h b/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h index 125325b16c611369b20886f42503e436c6fe4753..4b34406b7796d585ebca8dab576e9a9e2db3793c 100644 --- a/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h +++ b/source/dnode/mgmt/mgmt_mnode/inc/mmInt.h @@ -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 diff --git a/source/dnode/mgmt/mgmt_qnode/CMakeLists.txt b/source/dnode/mgmt/mgmt_qnode/CMakeLists.txt index 56c136db3dc0330ad423fdebadb301bb0c52a474..64f8a45ac428dff21cf241feda0669f87f9b8686 100644 --- a/source/dnode/mgmt/mgmt_qnode/CMakeLists.txt +++ b/source/dnode/mgmt/mgmt_qnode/CMakeLists.txt @@ -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 diff --git a/source/dnode/mgmt/mgmt_qnode/inc/qmInt.h b/source/dnode/mgmt/mgmt_qnode/inc/qmInt.h index 46b7552e38ac66b7961fbaa597d3243c497aa1fb..0213cdb61e0cc78d75e46db4adf012f070660b9f 100644 --- a/source/dnode/mgmt/mgmt_qnode/inc/qmInt.h +++ b/source/dnode/mgmt/mgmt_qnode/inc/qmInt.h @@ -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" diff --git a/source/dnode/mgmt/mgmt_snode/CMakeLists.txt b/source/dnode/mgmt/mgmt_snode/CMakeLists.txt index 0fb5e90666d197a730bb7020819d9d78d09c52f9..62dc41a0aec602f826ccdf5ea00f55691da62483 100644 --- a/source/dnode/mgmt/mgmt_snode/CMakeLists.txt +++ b/source/dnode/mgmt/mgmt_snode/CMakeLists.txt @@ -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 diff --git a/source/dnode/mgmt/mgmt_snode/inc/smInt.h b/source/dnode/mgmt/mgmt_snode/inc/smInt.h index 3a2a4486336e4bb17feeec981ae044db5201ed38..ca1865c48433fb3be8d9956aa8079303c5a26e66 100644 --- a/source/dnode/mgmt/mgmt_snode/inc/smInt.h +++ b/source/dnode/mgmt/mgmt_snode/inc/smInt.h @@ -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" diff --git a/source/dnode/mgmt/mgmt_vnode/CMakeLists.txt b/source/dnode/mgmt/mgmt_vnode/CMakeLists.txt index d6dc3ee9487f38ae7515d0c4c42622473369cbfe..15b822ad92e5367bcf15196f927e77d49a63f1bd 100644 --- a/source/dnode/mgmt/mgmt_vnode/CMakeLists.txt +++ b/source/dnode/mgmt/mgmt_vnode/CMakeLists.txt @@ -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 diff --git a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h index 2ade6c129b88f1eb777dd58d29f74d02c78ded6c..8b79c4221aa98e753537e2eee1af0c9ff55bbf4e 100644 --- a/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h +++ b/source/dnode/mgmt/mgmt_vnode/inc/vmInt.h @@ -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" diff --git a/source/dnode/mgmt/node_common/CMakeLists.txt b/source/dnode/mgmt/node_common/CMakeLists.txt deleted file mode 100644 index 524f5f76d81e4fd2a21696ed8c50c768a6d3e485..0000000000000000000000000000000000000000 --- a/source/dnode/mgmt/node_common/CMakeLists.txt +++ /dev/null @@ -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 -) \ No newline at end of file diff --git a/source/dnode/mgmt/node_util/CMakeLists.txt b/source/dnode/mgmt/node_util/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..5d879fdbcf356f6cefcfdc8046696fa4010cd1b4 --- /dev/null +++ b/source/dnode/mgmt/node_util/CMakeLists.txt @@ -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 +) \ No newline at end of file diff --git a/source/dnode/mgmt/node_common/inc/dmInt.h b/source/dnode/mgmt/node_util/inc/dmUtil.h similarity index 98% rename from source/dnode/mgmt/node_common/inc/dmInt.h rename to source/dnode/mgmt/node_util/inc/dmUtil.h index b45359503035b3720c97804ed10345f00211a7fe..f43787989a4fd5c4cb069ad8bc8a7334dbfb155f 100644 --- a/source/dnode/mgmt/node_common/inc/dmInt.h +++ b/source/dnode/mgmt/node_util/inc/dmUtil.h @@ -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); diff --git a/source/dnode/mgmt/node_common/src/dmEnv.c b/source/dnode/mgmt/node_util/src/dmEnv.c similarity index 98% rename from source/dnode/mgmt/node_common/src/dmEnv.c rename to source/dnode/mgmt/node_util/src/dmEnv.c index 4bc618bca8f11d391dc10c79f154def532161c62..e9a7d5645050a6809093a40c2d781b5d106f38b8 100644 --- a/source/dnode/mgmt/node_common/src/dmEnv.c +++ b/source/dnode/mgmt/node_util/src/dmEnv.c @@ -14,7 +14,7 @@ */ #define _DEFAULT_SOURCE -#include "dmInt.h" +#include "dmUtil.h" static int8_t once = DND_ENV_INIT; diff --git a/source/dnode/mgmt/node_common/src/dmFile.c b/source/dnode/mgmt/node_util/src/dmFile.c similarity index 99% rename from source/dnode/mgmt/node_common/src/dmFile.c rename to source/dnode/mgmt/node_util/src/dmFile.c index a49d4ae9e7286d5fd6b03c8c82313df59437cac1..1eea9ad2345f99745f69da537961d4139cdc05af 100644 --- a/source/dnode/mgmt/node_common/src/dmFile.c +++ b/source/dnode/mgmt/node_util/src/dmFile.c @@ -14,7 +14,7 @@ */ #define _DEFAULT_SOURCE -#include "dmInt.h" +#include "dmUtil.h" #define MAXLEN 1024 diff --git a/source/dnode/mgmt/node_common/src/dmUtil.c b/source/dnode/mgmt/node_util/src/dmUtil.c similarity index 90% rename from source/dnode/mgmt/node_common/src/dmUtil.c rename to source/dnode/mgmt/node_util/src/dmUtil.c index 157272611c07cf1a03fd38335c63ee805f65dd63..8a3893b93c1bd1d55f049f2c6fa55c77b53768f6 100644 --- a/source/dnode/mgmt/node_common/src/dmUtil.c +++ b/source/dnode/mgmt/node_util/src/dmUtil.c @@ -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: