diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 712ccbffbfba1a23b347a38008b1b381dc248698..d29213298a1de4bae3e50830d6fffad563d4dfa8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,7 +6,7 @@ ADD_SUBDIRECTORY(util) ADD_SUBDIRECTORY(rpc) ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(kit) -ADD_SUBDIRECTORY(modules) +ADD_SUBDIRECTORY(plugins) ADD_SUBDIRECTORY(sdb) ADD_SUBDIRECTORY(mnode) ADD_SUBDIRECTORY(dnode) diff --git a/src/dnode/inc/dnodeMgmt.h b/src/dnode/inc/dnodeMgmt.h index 5db16258f796c26288b1d96aa6cf6dcd2957daf5..4aff10026d56dfb8ee24692a0d992723896ef26e 100644 --- a/src/dnode/inc/dnodeMgmt.h +++ b/src/dnode/inc/dnodeMgmt.h @@ -22,14 +22,8 @@ extern "C" { #include #include -#include "tsched.h" -#include "dnode.h" - void dnodeProcessMsgFromMgmt(int8_t *pCont, int32_t contLen, int32_t msgType, void *pConn); - -extern void *tsDnodeMgmtQhandle; - void dnodeSendVpeerCfgMsg(int32_t vnode); void dnodeSendMeterCfgMsg(int32_t vnode, int32_t sid); diff --git a/src/dnode/inc/dnodeSystem.h b/src/dnode/inc/dnodeSystem.h index 7e94a642e78aa34305952164b2d24948d29e9408..345375ef3c73bb06589f12e40cc4604b9ab02747 100644 --- a/src/dnode/inc/dnodeSystem.h +++ b/src/dnode/inc/dnodeSystem.h @@ -39,6 +39,8 @@ extern void (*dnodeParseParameterK)(); extern int32_t tsMaxQueues; extern void ** tsRpcQhandle; extern void *tsQueryQhandle; +extern void *tsDnodeMgmtQhandle; + int32_t dnodeInitSystem(); void dnodeCleanUpSystem(); diff --git a/src/dnode/src/dnodeMgmt.c b/src/dnode/src/dnodeMgmt.c index 282ff8e756bbd139f354a2c0a8b8d791c7e4837e..d1dcc487947bc219614c46684e9b29dc191c93ca 100644 --- a/src/dnode/src/dnodeMgmt.c +++ b/src/dnode/src/dnodeMgmt.c @@ -83,7 +83,7 @@ void dnodeProcessMsgFromMgmt(int8_t *pCont, int32_t contLen, int32_t msgType, vo dError("invalid msg type:%d", msgType); } else { if (dnodeProcessShellMsgFp[msgType]) { - (*dnodeProcessShellMsgFp[msgType])(pConn, contLen, pConn); + (*dnodeProcessShellMsgFp[msgType])(pCont, contLen, pConn); } else { dError("%s is not processed", taosMsg[msgType]); } @@ -190,7 +190,7 @@ void dnodeSendVpeerCfgMsg(int32_t vnode) { } cfg->vnode = htonl(vnode); - dnodeSendMsgToMnode(cfg, sizeof(SMeterCfgMsg)); + dnodeSendMsgToMnode(cfg, sizeof(SVpeerCfgMsg), TSDB_MSG_TYPE_VNODE_CFG); } void dnodeSendMeterCfgMsg(int32_t vnode, int32_t sid) { @@ -200,7 +200,7 @@ void dnodeSendMeterCfgMsg(int32_t vnode, int32_t sid) { } cfg->vnode = htonl(vnode); - dnodeSendMsgToMnode(cfg, sizeof(SMeterCfgMsg)); + dnodeSendMsgToMnode(cfg, sizeof(SMeterCfgMsg), TSDB_MSG_TYPE_TABLE_CFG); } void dnodeInitProcessShellMsg() { diff --git a/src/inc/http.h b/src/inc/http.h index 9ef36560e13e91e8d8652a9233ef160c6ede72c2..aaab27301a9d6dc1733df5aeab822b4ecebf8c4c 100644 --- a/src/inc/http.h +++ b/src/inc/http.h @@ -23,28 +23,6 @@ extern "C" { #include "tglobalcfg.h" #include "tlog.h" -#define httpError(...) \ - if (httpDebugFlag & DEBUG_ERROR) { \ - tprintf("ERROR HTP ", 255, __VA_ARGS__); \ - } -#define httpWarn(...) \ - if (httpDebugFlag & DEBUG_WARN) { \ - tprintf("WARN HTP ", httpDebugFlag, __VA_ARGS__); \ - } -#define httpTrace(...) \ - if (httpDebugFlag & DEBUG_TRACE) { \ - tprintf("HTP ", httpDebugFlag, __VA_ARGS__); \ - } -#define httpDump(...) \ - if (httpDebugFlag & DEBUG_TRACE) { \ - taosPrintLongString("HTP ", httpDebugFlag, __VA_ARGS__); \ - } -#define httpPrint(...) \ - { tprintf("HTP ", 255, __VA_ARGS__); } - -#define httpLError(...) taosLogError(__VA_ARGS__) httpError(__VA_ARGS__) -#define httpLWarn(...) taosLogWarn(__VA_ARGS__) httpWarn(__VA_ARGS__) -#define httpLPrint(...) taosLogPrint(__VA_ARGS__) httpPrint(__VA_ARGS__) int32_t httpGetReqCount(); diff --git a/src/inc/mnode.h b/src/inc/mnode.h index 37d4bca28a82b145dd39ba55030c46d98b1355f6..6b7596b575487c2657cac9ed67dfafce661c74f0 100644 --- a/src/inc/mnode.h +++ b/src/inc/mnode.h @@ -335,8 +335,18 @@ typedef struct { char payload[]; /* payload for wildcard match in show tables */ } SShowObj; + +extern int32_t (*mgmtInitSystem)(); +extern void (*mgmtStopSystem)(); + +int32_t mgmtStartSystem(); +void mgmtCleanUpSystem(); void mgmtProcessMsgFromDnode(int8_t *pCont, int32_t contLen, int32_t msgType, void *pConn); + +extern void (*mgmtCleanUpRedirect)(); + + #ifdef __cplusplus } #endif diff --git a/src/inc/monitor.h b/src/inc/monitor.h new file mode 100644 index 0000000000000000000000000000000000000000..ee7ff61986c3dbf64c86dae8f14dcc04eaf46d02 --- /dev/null +++ b/src/inc/monitor.h @@ -0,0 +1,23 @@ +/* + * 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 __MONITOR_H__ +#define __MONITOR_H__ + +#include "tglobalcfg.h" +#include "tlog.h" + + +#endif \ No newline at end of file diff --git a/src/mnode/src/mgmtSystem.c b/src/mnode/src/mgmtSystem.c index 5148975c95971e8a7a7c997e259c058ece8498f5..74cf029055da9b067e036dd2609b18162c8aba1d 100644 --- a/src/mnode/src/mgmtSystem.c +++ b/src/mnode/src/mgmtSystem.c @@ -162,7 +162,10 @@ int mgmtStartSystem() { return 0; } -int32_t mgmtInitSystemImp() { return mgmtStartSystem(); } +int32_t mgmtInitSystemImp() { + return mgmtStartSystem(); +} + int32_t (*mgmtInitSystem)() = mgmtInitSystemImp; int32_t mgmtCheckMgmtRunningImp() { return 0; } @@ -177,6 +180,7 @@ void mgmtStartMgmtTimerImp() { void (*mgmtStartMgmtTimer)() = mgmtStartMgmtTimerImp; void mgmtStopSystemImp() {} + void (*mgmtStopSystem)() = mgmtStopSystemImp; void mgmtCleanUpRedirectImp() {} diff --git a/src/modules/monitor/inc/monitor.h b/src/modules/monitor/inc/monitor.h deleted file mode 100644 index 954f4898b195cb90fcb28fb4290af7e24c1a6fbd..0000000000000000000000000000000000000000 --- a/src/modules/monitor/inc/monitor.h +++ /dev/null @@ -1,41 +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 __MONITOR_H__ -#define __MONITOR_H__ - -#include "tglobalcfg.h" -#include "tlog.h" - -#define monitorError(...) \ - if (monitorDebugFlag & DEBUG_ERROR) { \ - tprintf("ERROR MON ", 255, __VA_ARGS__); \ - } -#define monitorWarn(...) \ - if (monitorDebugFlag & DEBUG_WARN) { \ - tprintf("WARN MON ", monitorDebugFlag, __VA_ARGS__); \ - } -#define monitorTrace(...) \ - if (monitorDebugFlag & DEBUG_TRACE) { \ - tprintf("MON ", monitorDebugFlag, __VA_ARGS__); \ - } -#define monitorPrint(...) \ - { tprintf("MON ", 255, __VA_ARGS__); } - -#define monitorLError(...) taosLogError(__VA_ARGS__) monitorError(__VA_ARGS__) -#define monitorLWarn(...) taosLogWarn(__VA_ARGS__) monitorWarn(__VA_ARGS__) -#define monitorLPrint(...) taosLogPrint(__VA_ARGS__) monitorPrint(__VA_ARGS__) - -#endif \ No newline at end of file diff --git a/src/modules/CMakeLists.txt b/src/plugins/CMakeLists.txt similarity index 100% rename from src/modules/CMakeLists.txt rename to src/plugins/CMakeLists.txt diff --git a/src/modules/http/CMakeLists.txt b/src/plugins/http/CMakeLists.txt similarity index 100% rename from src/modules/http/CMakeLists.txt rename to src/plugins/http/CMakeLists.txt diff --git a/src/modules/http/inc/cJSON.h b/src/plugins/http/inc/cJSON.h similarity index 100% rename from src/modules/http/inc/cJSON.h rename to src/plugins/http/inc/cJSON.h diff --git a/src/modules/http/inc/gcHandle.h b/src/plugins/http/inc/gcHandle.h similarity index 100% rename from src/modules/http/inc/gcHandle.h rename to src/plugins/http/inc/gcHandle.h diff --git a/src/modules/http/inc/gcJson.h b/src/plugins/http/inc/gcJson.h similarity index 100% rename from src/modules/http/inc/gcJson.h rename to src/plugins/http/inc/gcJson.h diff --git a/src/modules/http/inc/httpCode.h b/src/plugins/http/inc/httpCode.h similarity index 100% rename from src/modules/http/inc/httpCode.h rename to src/plugins/http/inc/httpCode.h diff --git a/src/modules/http/inc/httpHandle.h b/src/plugins/http/inc/httpHandle.h similarity index 100% rename from src/modules/http/inc/httpHandle.h rename to src/plugins/http/inc/httpHandle.h diff --git a/src/modules/http/inc/httpJson.h b/src/plugins/http/inc/httpJson.h similarity index 100% rename from src/modules/http/inc/httpJson.h rename to src/plugins/http/inc/httpJson.h diff --git a/src/modules/http/inc/httpResp.h b/src/plugins/http/inc/httpResp.h similarity index 100% rename from src/modules/http/inc/httpResp.h rename to src/plugins/http/inc/httpResp.h diff --git a/src/modules/http/inc/httpSystem.h b/src/plugins/http/inc/httpSystem.h similarity index 100% rename from src/modules/http/inc/httpSystem.h rename to src/plugins/http/inc/httpSystem.h diff --git a/src/modules/http/inc/restHandle.h b/src/plugins/http/inc/restHandle.h similarity index 100% rename from src/modules/http/inc/restHandle.h rename to src/plugins/http/inc/restHandle.h diff --git a/src/modules/http/inc/restJson.h b/src/plugins/http/inc/restJson.h similarity index 100% rename from src/modules/http/inc/restJson.h rename to src/plugins/http/inc/restJson.h diff --git a/src/modules/http/inc/tgHandle.h b/src/plugins/http/inc/tgHandle.h similarity index 100% rename from src/modules/http/inc/tgHandle.h rename to src/plugins/http/inc/tgHandle.h diff --git a/src/modules/http/inc/tgJson.h b/src/plugins/http/inc/tgJson.h similarity index 100% rename from src/modules/http/inc/tgJson.h rename to src/plugins/http/inc/tgJson.h diff --git a/src/modules/http/src/cJSON.c b/src/plugins/http/src/cJSON.c similarity index 100% rename from src/modules/http/src/cJSON.c rename to src/plugins/http/src/cJSON.c diff --git a/src/modules/http/src/gcHandle.c b/src/plugins/http/src/gcHandle.c similarity index 100% rename from src/modules/http/src/gcHandle.c rename to src/plugins/http/src/gcHandle.c diff --git a/src/modules/http/src/gcJson.c b/src/plugins/http/src/gcJson.c similarity index 100% rename from src/modules/http/src/gcJson.c rename to src/plugins/http/src/gcJson.c diff --git a/src/modules/http/src/httpAuth.c b/src/plugins/http/src/httpAuth.c similarity index 100% rename from src/modules/http/src/httpAuth.c rename to src/plugins/http/src/httpAuth.c diff --git a/src/modules/http/src/httpCode.c b/src/plugins/http/src/httpCode.c similarity index 100% rename from src/modules/http/src/httpCode.c rename to src/plugins/http/src/httpCode.c diff --git a/src/modules/http/src/httpHandle.c b/src/plugins/http/src/httpHandle.c similarity index 100% rename from src/modules/http/src/httpHandle.c rename to src/plugins/http/src/httpHandle.c diff --git a/src/modules/http/src/httpJson.c b/src/plugins/http/src/httpJson.c similarity index 100% rename from src/modules/http/src/httpJson.c rename to src/plugins/http/src/httpJson.c diff --git a/src/modules/http/src/httpResp.c b/src/plugins/http/src/httpResp.c similarity index 100% rename from src/modules/http/src/httpResp.c rename to src/plugins/http/src/httpResp.c diff --git a/src/modules/http/src/httpServer.c b/src/plugins/http/src/httpServer.c similarity index 100% rename from src/modules/http/src/httpServer.c rename to src/plugins/http/src/httpServer.c diff --git a/src/modules/http/src/httpSession.c b/src/plugins/http/src/httpSession.c similarity index 100% rename from src/modules/http/src/httpSession.c rename to src/plugins/http/src/httpSession.c diff --git a/src/modules/http/src/httpSql.c b/src/plugins/http/src/httpSql.c similarity index 100% rename from src/modules/http/src/httpSql.c rename to src/plugins/http/src/httpSql.c diff --git a/src/modules/http/src/httpSystem.c b/src/plugins/http/src/httpSystem.c similarity index 100% rename from src/modules/http/src/httpSystem.c rename to src/plugins/http/src/httpSystem.c diff --git a/src/modules/http/src/httpUtil.c b/src/plugins/http/src/httpUtil.c similarity index 100% rename from src/modules/http/src/httpUtil.c rename to src/plugins/http/src/httpUtil.c diff --git a/src/modules/http/src/restHandle.c b/src/plugins/http/src/restHandle.c similarity index 100% rename from src/modules/http/src/restHandle.c rename to src/plugins/http/src/restHandle.c diff --git a/src/modules/http/src/restJson.c b/src/plugins/http/src/restJson.c similarity index 100% rename from src/modules/http/src/restJson.c rename to src/plugins/http/src/restJson.c diff --git a/src/modules/http/src/tgHandle.c b/src/plugins/http/src/tgHandle.c similarity index 100% rename from src/modules/http/src/tgHandle.c rename to src/plugins/http/src/tgHandle.c diff --git a/src/modules/http/src/tgJson.c b/src/plugins/http/src/tgJson.c similarity index 100% rename from src/modules/http/src/tgJson.c rename to src/plugins/http/src/tgJson.c diff --git a/src/modules/monitor/CMakeLists.txt b/src/plugins/monitor/CMakeLists.txt similarity index 100% rename from src/modules/monitor/CMakeLists.txt rename to src/plugins/monitor/CMakeLists.txt diff --git a/src/modules/monitor/inc/monitorSystem.h b/src/plugins/monitor/inc/monitorSystem.h similarity index 100% rename from src/modules/monitor/inc/monitorSystem.h rename to src/plugins/monitor/inc/monitorSystem.h diff --git a/src/modules/monitor/src/monitorSystem.c b/src/plugins/monitor/src/monitorSystem.c similarity index 100% rename from src/modules/monitor/src/monitorSystem.c rename to src/plugins/monitor/src/monitorSystem.c diff --git a/src/util/inc/tlog.h b/src/util/inc/tlog.h index 7556cc50a1ff23d24ef8eafdcd677f65577c8713..8bd4333f16c619b83e9aaba7cd52fa029213bb22 100644 --- a/src/util/inc/tlog.h +++ b/src/util/inc/tlog.h @@ -197,6 +197,48 @@ extern uint32_t cdebugFlag; #define mLWarn(...) taosLogWarn(__VA_ARGS__) mWarn(__VA_ARGS__) #define mLPrint(...) taosLogPrint(__VA_ARGS__) mPrint(__VA_ARGS__) +#define httpError(...) \ + if (httpDebugFlag & DEBUG_ERROR) { \ + tprintf("ERROR HTP ", 255, __VA_ARGS__); \ + } +#define httpWarn(...) \ + if (httpDebugFlag & DEBUG_WARN) { \ + tprintf("WARN HTP ", httpDebugFlag, __VA_ARGS__); \ + } +#define httpTrace(...) \ + if (httpDebugFlag & DEBUG_TRACE) { \ + tprintf("HTP ", httpDebugFlag, __VA_ARGS__); \ + } +#define httpDump(...) \ + if (httpDebugFlag & DEBUG_TRACE) { \ + taosPrintLongString("HTP ", httpDebugFlag, __VA_ARGS__); \ + } +#define httpPrint(...) \ + { tprintf("HTP ", 255, __VA_ARGS__); } + +#define httpLError(...) taosLogError(__VA_ARGS__) httpError(__VA_ARGS__) +#define httpLWarn(...) taosLogWarn(__VA_ARGS__) httpWarn(__VA_ARGS__) +#define httpLPrint(...) taosLogPrint(__VA_ARGS__) httpPrint(__VA_ARGS__) + +#define monitorError(...) \ + if (monitorDebugFlag & DEBUG_ERROR) { \ + tprintf("ERROR MON ", 255, __VA_ARGS__); \ + } +#define monitorWarn(...) \ + if (monitorDebugFlag & DEBUG_WARN) { \ + tprintf("WARN MON ", monitorDebugFlag, __VA_ARGS__); \ + } +#define monitorTrace(...) \ + if (monitorDebugFlag & DEBUG_TRACE) { \ + tprintf("MON ", monitorDebugFlag, __VA_ARGS__); \ + } +#define monitorPrint(...) \ + { tprintf("MON ", 255, __VA_ARGS__); } + +#define monitorLError(...) taosLogError(__VA_ARGS__) monitorError(__VA_ARGS__) +#define monitorLWarn(...) taosLogWarn(__VA_ARGS__) monitorWarn(__VA_ARGS__) +#define monitorLPrint(...) taosLogPrint(__VA_ARGS__) monitorPrint(__VA_ARGS__) + #ifdef __cplusplus } #endif