diff --git a/source/dnode/mgmt/bnode/inc/bmInt.h b/source/dnode/mgmt/bnode/inc/bmInt.h
index d19b7f5387..504356279c 100644
--- a/source/dnode/mgmt/bnode/inc/bmInt.h
+++ b/source/dnode/mgmt/bnode/inc/bmInt.h
@@ -16,7 +16,7 @@
#ifndef _TD_DND_BNODE_INT_H_
#define _TD_DND_BNODE_INT_H_
-#include "dndInt.h"
+#include "dnd.h"
#ifdef __cplusplus
extern "C" {
diff --git a/source/dnode/mgmt/container/inc/dnd.h b/source/dnode/mgmt/container/inc/dnd.h
index 66dbad8f88..ac2ad2ac8f 100644
--- a/source/dnode/mgmt/container/inc/dnd.h
+++ b/source/dnode/mgmt/container/inc/dnd.h
@@ -13,8 +13,8 @@
* along with this program. If not, see .
*/
-#ifndef _TD_DND_INT_H_
-#define _TD_DND_INT_H_
+#ifndef _TD_DND_H_
+#define _TD_DND_H_
#include "os.h"
@@ -142,35 +142,17 @@ typedef struct SDnode {
SMgmtWrapper wrappers[NODE_MAX];
} SDnode;
-// dndInt.h
-int32_t dndInit();
-void dndCleanup();
EDndStatus dndGetStatus(SDnode *pDnode);
void dndSetStatus(SDnode *pDnode, EDndStatus stat);
-const char *dndStatStr(EDndStatus stat);
-void dndReportStartup(SDnode *pDnode, char *pName, char *pDesc);
-void dndGetStartup(SDnode *pDnode, SStartupReq *pStartup);
-TdFilePtr dndCheckRunning(char *dataDir);
SMgmtWrapper *dndGetWrapper(SDnode *pDnode, ENodeType nodeType);
void dndSetMsgHandle(SMgmtWrapper *pWrapper, int32_t msgType, NodeMsgFp nodeMsgFp);
-void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pMsg);
+void dndReportStartup(SDnode *pDnode, char *pName, char *pDesc);
-// dndMonitor.h
-void dndSendMonitorReport(SDnode *pDnode);
-
-// dndNode.h
-SDnode *dndCreate(const SDnodeOpt *pOption);
-void dndClose(SDnode *pDnode);
-int32_t dndRun(SDnode *pDnode);
-void dndHandleEvent(SDnode *pDnode, EDndEvent event);
+void dndSendMonitorReport(SDnode *pDnode);
+int32_t dndSendReqToMnode(void *wrapper, SRpcMsg *pMsg);
+int32_t dndSendReqToDnode(void *wrapper, SEpSet *pEpSet, SRpcMsg *pMsg);
void dndSendRsp(SMgmtWrapper *pWrapper, SRpcMsg *pRsp);
-void dndSendRedirectRsp(SMgmtWrapper *pWrapper, SRpcMsg *pRsp);
-// dndTransport.h
-int32_t dndSendReqToMnode(void *pWrapper, SRpcMsg *pMsg);
-int32_t dndSendReqToDnode(void *pWrapper, SEpSet *pEpSet, SRpcMsg *pMsg);
-
-// dndWorker.h
int32_t dndInitWorker(void *param, SDnodeWorker *pWorker, EWorkerType type, const char *name, int32_t minNum,
int32_t maxNum, void *queueFp);
void dndCleanupWorker(SDnodeWorker *pWorker);
@@ -180,4 +162,4 @@ int32_t dndWriteMsgToWorker(SDnodeWorker *pWorker, void *pCont, int32_t contLen)
}
#endif
-#endif /*_TD_DND_INT_H_*/
\ No newline at end of file
+#endif /*_TD_DND_H_*/
\ No newline at end of file
diff --git a/source/dnode/mgmt/container/inc/dndNode.h b/source/dnode/mgmt/container/inc/dndInt.h
similarity index 61%
rename from source/dnode/mgmt/container/inc/dndNode.h
rename to source/dnode/mgmt/container/inc/dndInt.h
index a32541bf77..dba1822b76 100644
--- a/source/dnode/mgmt/container/inc/dndNode.h
+++ b/source/dnode/mgmt/container/inc/dndInt.h
@@ -13,24 +13,39 @@
* along with this program. If not, see .
*/
-#ifndef _TD_DND_MAIN_H_
-#define _TD_DND_MAIN_H_
+#ifndef _TD_DND_INT_H_
+#define _TD_DND_INT_H_
-#include "dndInt.h"
+#include "dnd.h"
#ifdef __cplusplus
extern "C" {
#endif
+// dndInt.h
+int32_t dndInit();
+void dndCleanup();
+const char *dndStatStr(EDndStatus stat);
+void dndGetStartup(SDnode *pDnode, SStartupReq *pStartup);
+TdFilePtr dndCheckRunning(char *dataDir);
+void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pMsg);
+
+// dndNode.h
SDnode *dndCreate(const SDnodeOpt *pOption);
void dndClose(SDnode *pDnode);
int32_t dndRun(SDnode *pDnode);
void dndHandleEvent(SDnode *pDnode, EDndEvent event);
void dndProcessRpcMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg, SEpSet *pEpSet);
-void dndSendRsp(SMgmtWrapper *pWrapper, SRpcMsg *pRsp);
+
+// dndTransport.h
+int32_t dndInitServer(SDnode *pDnode);
+void dndCleanupServer(SDnode *pDnode);
+int32_t dndInitClient(SDnode *pDnode);
+void dndCleanupClient(SDnode *pDnode);
+int32_t dndInitMsgHandle(SDnode *pDnode);
#ifdef __cplusplus
}
#endif
-#endif /*_TD_DND_MAIN_H_*/
\ No newline at end of file
+#endif /*_TD_DND_INT_H_*/
\ No newline at end of file
diff --git a/source/dnode/mgmt/container/inc/dndMonitor.h b/source/dnode/mgmt/container/inc/dndMonitor.h
deleted file mode 100644
index 12b9d347a6..0000000000
--- a/source/dnode/mgmt/container/inc/dndMonitor.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2019 TAOS Data, Inc.
- *
- * This program is free software: you can use, redistribute, and/or modify
- * it under the terms of the GNU Affero General Public License, version 3
- * or later ("AGPL"), as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-#ifndef _TD_DND_MONITOR_H_
-#define _TD_DND_MONITOR_H_
-
-#include "dndInt.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void dndSendMonitorReport(SDnode *pDnode);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*_TD_DND_MONITOR_H_*/
\ No newline at end of file
diff --git a/source/dnode/mgmt/container/inc/dndTransport.h b/source/dnode/mgmt/container/inc/dndTransport.h
deleted file mode 100644
index b6998c674e..0000000000
--- a/source/dnode/mgmt/container/inc/dndTransport.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2019 TAOS Data, Inc.
- *
- * This program is free software: you can use, redistribute, and/or modify
- * it under the terms of the GNU Affero General Public License, version 3
- * or later ("AGPL"), as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-#ifndef _TD_DND_TRANSPORT_H_
-#define _TD_DND_TRANSPORT_H_
-
-#include "dndInt.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int32_t dndInitServer(SDnode *pDnode);
-void dndCleanupServer(SDnode *pDnode);
-int32_t dndInitClient(SDnode *pDnode);
-void dndCleanupClient(SDnode *pDnode);
-int32_t dndInitMsgHandle(SDnode *pDnode);
-
-int32_t dndSendReqToMnode(void *wrapper, SRpcMsg *pMsg);
-int32_t dndSendReqToDnode(void *wrapper, SEpSet *pEpSet, SRpcMsg *pMsg);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*_TD_DND_TRANSPORT_H_*/
diff --git a/source/dnode/mgmt/container/inc/dndWorker.h b/source/dnode/mgmt/container/inc/dndWorker.h
deleted file mode 100644
index 918bf67599..0000000000
--- a/source/dnode/mgmt/container/inc/dndWorker.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2019 TAOS Data, Inc.
- *
- * This program is free software: you can use, redistribute, and/or modify
- * it under the terms of the GNU Affero General Public License, version 3
- * or later ("AGPL"), as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- */
-
-#ifndef _TD_DND_WORKER_H_
-#define _TD_DND_WORKER_H_
-
-#include "dndInt.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int32_t dndInitWorker(void *param, SDnodeWorker *pWorker, EWorkerType type, const char *name, int32_t minNum,
- int32_t maxNum, void *queueFp);
-void dndCleanupWorker(SDnodeWorker *pWorker);
-int32_t dndWriteMsgToWorker(SDnodeWorker *pWorker, void *pCont, int32_t contLen);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*_TD_DND_WORKER_H_*/
\ No newline at end of file
diff --git a/source/dnode/mgmt/container/src/dndMonitor.c b/source/dnode/mgmt/container/src/dndMonitor.c
index e92fa80745..9b4e270766 100644
--- a/source/dnode/mgmt/container/src/dndMonitor.c
+++ b/source/dnode/mgmt/container/src/dndMonitor.c
@@ -14,7 +14,8 @@
*/
#define _DEFAULT_SOURCE
-#include "dndMonitor.h"
+#include "dndInt.h"
+
#include "dmInt.h"
#include "mmInt.h"
#include "vmInt.h"
diff --git a/source/dnode/mgmt/container/src/dndNode.c b/source/dnode/mgmt/container/src/dndNode.c
index 6dc3397082..f22c08a6b9 100644
--- a/source/dnode/mgmt/container/src/dndNode.c
+++ b/source/dnode/mgmt/container/src/dndNode.c
@@ -14,8 +14,7 @@
*/
#define _DEFAULT_SOURCE
-#include "dndNode.h"
-#include "dndTransport.h"
+#include "dndInt.h"
#include "bmInt.h"
#include "dmInt.h"
diff --git a/source/dnode/mgmt/container/src/dndTransport.c b/source/dnode/mgmt/container/src/dndTransport.c
index 0621468c8b..049aacd875 100644
--- a/source/dnode/mgmt/container/src/dndTransport.c
+++ b/source/dnode/mgmt/container/src/dndTransport.c
@@ -14,8 +14,8 @@
*/
#define _DEFAULT_SOURCE
-#include "dndTransport.h"
-#include "dndNode.h"
+#include "dndInt.h"
+
#include "dmInt.h"
#include "mmInt.h"
diff --git a/source/dnode/mgmt/container/src/dndWorker.c b/source/dnode/mgmt/container/src/dndWorker.c
index c06c86db39..2c2158a060 100644
--- a/source/dnode/mgmt/container/src/dndWorker.c
+++ b/source/dnode/mgmt/container/src/dndWorker.c
@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
-#include "dndWorker.h"
+#include "dndInt.h"
int32_t dndInitWorker(void *param, SDnodeWorker *pWorker, EWorkerType type, const char *name, int32_t minNum,
int32_t maxNum, void *queueFp) {
diff --git a/source/dnode/mgmt/dnode/inc/dm.h b/source/dnode/mgmt/dnode/inc/dm.h
index 0336ae91d1..d4f48f0796 100644
--- a/source/dnode/mgmt/dnode/inc/dm.h
+++ b/source/dnode/mgmt/dnode/inc/dm.h
@@ -16,7 +16,7 @@
#ifndef _TD_DND_DNODE_H_
#define _TD_DND_DNODE_H_
-#include "dndInt.h"
+#include "dnd.h"
#ifdef __cplusplus
extern "C" {
diff --git a/source/dnode/mgmt/mnode/inc/mmInt.h b/source/dnode/mgmt/mnode/inc/mmInt.h
index 7ceec45ae0..3b43a34b52 100644
--- a/source/dnode/mgmt/mnode/inc/mmInt.h
+++ b/source/dnode/mgmt/mnode/inc/mmInt.h
@@ -16,7 +16,7 @@
#ifndef _TD_DND_MNODE_INT_H_
#define _TD_DND_MNODE_INT_H_
-#include "dndInt.h"
+#include "dnd.h"
#ifdef __cplusplus
extern "C" {
diff --git a/source/dnode/mgmt/mnode/src/mmWorker.c b/source/dnode/mgmt/mnode/src/mmWorker.c
index 3a195d9301..e86024b688 100644
--- a/source/dnode/mgmt/mnode/src/mmWorker.c
+++ b/source/dnode/mgmt/mnode/src/mmWorker.c
@@ -17,8 +17,6 @@
#include "mmInt.h"
#include "dmInt.h"
-#include "dndTransport.h"
-#include "dndWorker.h"
static void mmProcessQueue(SMnodeMgmt *pMgmt, SNodeMsg *pMsg) {
dTrace("msg:%p, will be processed", pMsg);
diff --git a/source/dnode/mgmt/qnode/inc/qmInt.h b/source/dnode/mgmt/qnode/inc/qmInt.h
index 2eccdd8dcf..f616e11f9c 100644
--- a/source/dnode/mgmt/qnode/inc/qmInt.h
+++ b/source/dnode/mgmt/qnode/inc/qmInt.h
@@ -16,7 +16,7 @@
#ifndef _TD_DND_QNODE_INT_H_
#define _TD_DND_QNODE_INT_H_
-#include "dndInt.h"
+#include "dnd.h"
#ifdef __cplusplus
extern "C" {
diff --git a/source/dnode/mgmt/snode/inc/smInt.h b/source/dnode/mgmt/snode/inc/smInt.h
index 75dd9bcc55..437aac6f30 100644
--- a/source/dnode/mgmt/snode/inc/smInt.h
+++ b/source/dnode/mgmt/snode/inc/smInt.h
@@ -16,7 +16,7 @@
#ifndef _TD_DND_SNODE_INT_H_
#define _TD_DND_SNODE_INT_H_
-#include "dndInt.h"
+#include "dnd.h"
#ifdef __cplusplus
extern "C" {
diff --git a/source/dnode/mgmt/vnode/inc/vmInt.h b/source/dnode/mgmt/vnode/inc/vmInt.h
index c91b243ed7..bd4a604f3e 100644
--- a/source/dnode/mgmt/vnode/inc/vmInt.h
+++ b/source/dnode/mgmt/vnode/inc/vmInt.h
@@ -16,7 +16,7 @@
#ifndef _TD_DND_VNODES_INT_H_
#define _TD_DND_VNODES_INT_H_
-#include "dndInt.h"
+#include "dnd.h"
#ifdef __cplusplus
extern "C" {