diff --git a/source/dnode/mgmt/bnode/inc/bmHandle.h b/source/dnode/mgmt/bnode/inc/bmHandle.h index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a24884849c36359d82d1d88b947ec1a48239e6da 100644 --- a/source/dnode/mgmt/bnode/inc/bmHandle.h +++ b/source/dnode/mgmt/bnode/inc/bmHandle.h @@ -0,0 +1,32 @@ +/* + * 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_BNODE_HANDLE_H_ +#define _TD_DND_BNODE_HANDLE_H_ + +#include "mmInt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void bmInitMsgHandles(SMgmtWrapper *pWrapper); +SMsgHandle bmGetMsgHandle(SMgmtWrapper *pWrapper, int32_t msgIndex); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_DND_BNODE_HANDLE_H_*/ \ No newline at end of file diff --git a/source/dnode/mgmt/bnode/src/bmHandle.c b/source/dnode/mgmt/bnode/src/bmHandle.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fd90e0c915a87771bd68de934907ca3da9473e4f 100644 --- a/source/dnode/mgmt/bnode/src/bmHandle.c +++ b/source/dnode/mgmt/bnode/src/bmHandle.c @@ -0,0 +1,26 @@ +/* + * 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 . + */ + +#define _DEFAULT_SOURCE +#include "bmHandle.h" +#include "bmWorker.h" + +void bmInitMsgHandles(SMgmtWrapper *pWrapper) { +} + +SMsgHandle bmGetMsgHandle(SMgmtWrapper *pWrapper, int32_t msgIndex) { + SBnodeMgmt *pMgmt = pWrapper->pMgmt; + return pMgmt->msgHandles[msgIndex]; +} diff --git a/source/dnode/mgmt/bnode/src/bmInt.c b/source/dnode/mgmt/bnode/src/bmInt.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9147c4f8b8ca814e24dcce732efb139d388c5c1a 100644 --- a/source/dnode/mgmt/bnode/src/bmInt.c +++ b/source/dnode/mgmt/bnode/src/bmInt.c @@ -0,0 +1,24 @@ +/* + * 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 . + */ + +#define _DEFAULT_SOURCE +#include "bmInt.h" +#include "bmHandle.h" + +SMgmtFp bmGetMgmtFp() { + SMgmtFp mgmtFp = {0}; + mgmtFp.getMsgHandleFp = bmGetMsgHandle; + return mgmtFp; +} diff --git a/source/dnode/mgmt/dnode/inc/dndInt.h b/source/dnode/mgmt/dnode/inc/dndInt.h index 1eb3ae556f39b01599c176a84ceb64e9558cc065..3473c9b339792616339c549111a3a83d8b459c5f 100644 --- a/source/dnode/mgmt/dnode/inc/dndInt.h +++ b/source/dnode/mgmt/dnode/inc/dndInt.h @@ -254,6 +254,8 @@ SMgmtWrapper *dndGetWrapper(SDnode *pDnode, ENodeType nodeType) ; void dndProcessRpcMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SRpcMsg *pMsg, SEpSet *pEpSet); +SMgmtFp dndGetMgmtFp(); + #ifdef __cplusplus } #endif diff --git a/source/dnode/mgmt/dnode/inc/dndMgmt.h b/source/dnode/mgmt/dnode/inc/dndMgmt.h index af29ff3d25f1938be897533b7385b145b1a6f3ff..f7d7b32ab59ccee509c5454e72ec827576fd5037 100644 --- a/source/dnode/mgmt/dnode/inc/dndMgmt.h +++ b/source/dnode/mgmt/dnode/inc/dndMgmt.h @@ -33,9 +33,9 @@ void dndGetMnodeEpSet(SDnode *pDnode, SEpSet *pEpSet); void dndSendRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg); void dndSendStatusReq(SDnode *pDnode); -void dndProcessMgmtMsg(SDnode *pDnode, SRpcMsg *pRpcMsg, SEpSet *pEpSet); void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pMsg); +void dndProcessMgmtMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg) ; #ifdef __cplusplus } #endif diff --git a/source/dnode/mgmt/dnode/src/dndHandle.c b/source/dnode/mgmt/dnode/src/dndHandle.c index cf4549615d32b81084a20e4a5f5c2c5614e59e03..988fb86ae3a3f289727e78b003aada0c5454aa84 100644 --- a/source/dnode/mgmt/dnode/src/dndHandle.c +++ b/source/dnode/mgmt/dnode/src/dndHandle.c @@ -16,6 +16,7 @@ #define _DEFAULT_SOURCE #include "dndHandle.h" #include "dndWorker.h" +#include "dndMgmt.h" static void dndSetMsgHandle(SMgmtWrapper *pWrapper, int32_t msgType, NodeMsgFp nodeMsgFp) { SDnodeMgmt *pMgmt = pWrapper->pMgmt; diff --git a/source/dnode/mgmt/dnode/src/dndInt.c b/source/dnode/mgmt/dnode/src/dndInt.c index a23cfbbfe1c33d8c2f6f7583511c163f881f803f..e61f49a8201dfe9a3d417d7900da85dd42fc25ba 100644 --- a/source/dnode/mgmt/dnode/src/dndInt.c +++ b/source/dnode/mgmt/dnode/src/dndInt.c @@ -15,6 +15,7 @@ #define _DEFAULT_SOURCE #include "dndInt.h" +#include "dndHandle.h" static int8_t once = DND_ENV_INIT; @@ -140,4 +141,10 @@ void dndeHandleEvent(SDnode *pDnode, EDndEvent event) { SMgmtWrapper *dndGetWrapper(SDnode *pDnode, ENodeType nodeType) { return &pDnode->mgmts[nodeType]; -} \ No newline at end of file +} + +SMgmtFp dndGetMgmtFp() { + SMgmtFp mgmtFp = {0}; + mgmtFp.getMsgHandleFp = dndGetMsgHandle; + return mgmtFp; +} diff --git a/source/dnode/mgmt/dnode/src/dndMain.c b/source/dnode/mgmt/dnode/src/dndMain.c index 20e3bfffb752bc8c05671bd882b47a271b843c58..06be5b9d826148448a918ef67dc720bc47f27ef8 100644 --- a/source/dnode/mgmt/dnode/src/dndMain.c +++ b/source/dnode/mgmt/dnode/src/dndMain.c @@ -120,6 +120,7 @@ SDnode *dndCreate(SDndCfg *pCfg) { goto _OVER; } + pDnode->mgmts[DNODE].fp = dndGetMgmtFp(); pDnode->mgmts[MNODE].fp = mmGetMgmtFp(); pDnode->mgmts[VNODES].fp = vmGetMgmtFp(); pDnode->mgmts[QNODE].fp = qmGetMgmtFp(); diff --git a/source/dnode/mgmt/dnode/src/dndMgmt.c b/source/dnode/mgmt/dnode/src/dndMgmt.c index 4822c91d20f452dab92e6790e273710ee2b857df..8f71e866cc790511cdbf3654242e9fbdd881f2b4 100644 --- a/source/dnode/mgmt/dnode/src/dndMgmt.c +++ b/source/dnode/mgmt/dnode/src/dndMgmt.c @@ -425,4 +425,21 @@ static void dndProcessMgmtQueue(SDnode *pDnode, SRpcMsg *pMsg) { taosFreeQitem(pMsg); } -#endif \ No newline at end of file +#endif + + + +int32_t dndInitMgmt(SDnode *pDnode) {return 0;} +void dndStopMgmt(SDnode *pDnode) {} + +void dndCleanupMgmt(SDnode *pDnode){} + + +void dndSendStatusReq(SDnode *pDnode){} + + +void dndGetMnodeEpSet(SDnode *pDnode, SEpSet *pEpSet) {} + + +void dndProcessStartupReq(SDnode *pDnode, SRpcMsg *pReq){} +void dndProcessMgmtMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg){} \ No newline at end of file diff --git a/source/dnode/mgmt/mnode/src/mmInt.c b/source/dnode/mgmt/mnode/src/mmInt.c index 9c0d9ade845e97095f656a407b11deeb1499e31c..58957211a092a4c0e57a791129a472313cbb1e29 100644 --- a/source/dnode/mgmt/mnode/src/mmInt.c +++ b/source/dnode/mgmt/mnode/src/mmInt.c @@ -20,6 +20,7 @@ SMgmtFp mmGetMgmtFp() { SMgmtFp mgmtFp = {0}; mgmtFp.getMsgHandleFp = mmGetMsgHandle; + return mgmtFp; } diff --git a/source/dnode/mgmt/mnode/src/mmWorker.c b/source/dnode/mgmt/mnode/src/mmWorker.c index c0150e4dca413ea74ca1fdfd36f9258cee81023c..f5b6c58fe57fd35aa40c305d4556def7f292eb4b 100644 --- a/source/dnode/mgmt/mnode/src/mmWorker.c +++ b/source/dnode/mgmt/mnode/src/mmWorker.c @@ -266,4 +266,8 @@ static void mmConsumeMsgQueue(SDnode *pDnode, SMndMsg *pMsg) { taosFreeQitem(pMsg); } -#endif \ No newline at end of file +#endif + +void mmProcessWriteMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {} +void mmProcessSyncMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {} +void mmProcessReadMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {} \ No newline at end of file diff --git a/source/dnode/mgmt/qnode/inc/qmHandle.h b/source/dnode/mgmt/qnode/inc/qmHandle.h index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7dd761e917ea6d22e55cb05e2861ee71511d0c3f 100644 --- a/source/dnode/mgmt/qnode/inc/qmHandle.h +++ b/source/dnode/mgmt/qnode/inc/qmHandle.h @@ -0,0 +1,32 @@ +/* + * 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_QNODE_HANDLE_H_ +#define _TD_DND_QNODE_HANDLE_H_ + +#include "qmInt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void qmInitMsgHandles(SMgmtWrapper *pWrapper); +SMsgHandle qmGetMsgHandle(SMgmtWrapper *pWrapper, int32_t msgIndex); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_DND_QNODE_HANDLE_H_*/ \ No newline at end of file diff --git a/source/dnode/mgmt/qnode/src/qmHandle.c b/source/dnode/mgmt/qnode/src/qmHandle.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d7e55e1fa524be6a82782423c333d0b6380027a7 100644 --- a/source/dnode/mgmt/qnode/src/qmHandle.c +++ b/source/dnode/mgmt/qnode/src/qmHandle.c @@ -0,0 +1,26 @@ +/* + * 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 . + */ + +#define _DEFAULT_SOURCE +#include "qmHandle.h" +#include "qmWorker.h" + +void qmInitMsgHandles(SMgmtWrapper *pWrapper) { +} + +SMsgHandle qmGetMsgHandle(SMgmtWrapper *pWrapper, int32_t msgIndex) { + SQnodeMgmt *pMgmt = pWrapper->pMgmt; + return pMgmt->msgHandles[msgIndex]; +} diff --git a/source/dnode/mgmt/qnode/src/qmInt.c b/source/dnode/mgmt/qnode/src/qmInt.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ba172a9a72cb01015d97dee984804bc51f9b71f7 100644 --- a/source/dnode/mgmt/qnode/src/qmInt.c +++ b/source/dnode/mgmt/qnode/src/qmInt.c @@ -0,0 +1,24 @@ +/* + * 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 . + */ + +#define _DEFAULT_SOURCE +#include "qmInt.h" +#include "qmHandle.h" + +SMgmtFp qmGetMgmtFp() { + SMgmtFp mgmtFp = {0}; + mgmtFp.getMsgHandleFp = qmGetMsgHandle; + return mgmtFp; +} diff --git a/source/dnode/mgmt/snode/inc/smHandle.h b/source/dnode/mgmt/snode/inc/smHandle.h index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3df6060bd34ec355dca512a4c2f255c865e83705 100644 --- a/source/dnode/mgmt/snode/inc/smHandle.h +++ b/source/dnode/mgmt/snode/inc/smHandle.h @@ -0,0 +1,32 @@ +/* + * 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_SNODE_HANDLE_H_ +#define _TD_DND_SNODE_HANDLE_H_ + +#include "mmInt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void smInitMsgHandles(SMgmtWrapper *pWrapper); +SMsgHandle smGetMsgHandle(SMgmtWrapper *pWrapper, int32_t msgIndex); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_DND_SNODE_HANDLE_H_*/ \ No newline at end of file diff --git a/source/dnode/mgmt/snode/src/smHandle.c b/source/dnode/mgmt/snode/src/smHandle.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..80ab34f62c271c009e6a48f01f29903b5c454e73 100644 --- a/source/dnode/mgmt/snode/src/smHandle.c +++ b/source/dnode/mgmt/snode/src/smHandle.c @@ -0,0 +1,26 @@ +/* + * 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 . + */ + +#define _DEFAULT_SOURCE +#include "smHandle.h" +#include "smWorker.h" + +void smInitMsgHandles(SMgmtWrapper *pWrapper) { +} + +SMsgHandle smGetMsgHandle(SMgmtWrapper *pWrapper, int32_t msgIndex) { + SBnodeMgmt *pMgmt = pWrapper->pMgmt; + return pMgmt->msgHandles[msgIndex]; +} diff --git a/source/dnode/mgmt/snode/src/smInt.c b/source/dnode/mgmt/snode/src/smInt.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..840315364b9d05898b7fa6712dc68fd9de0807ff 100644 --- a/source/dnode/mgmt/snode/src/smInt.c +++ b/source/dnode/mgmt/snode/src/smInt.c @@ -0,0 +1,24 @@ +/* + * 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 . + */ + +#define _DEFAULT_SOURCE +#include "smInt.h" +#include "smHandle.h" + +SMgmtFp smGetMgmtFp() { + SMgmtFp mgmtFp = {0}; + mgmtFp.getMsgHandleFp = smGetMsgHandle; + return mgmtFp; +} diff --git a/source/dnode/mgmt/vnode/src/vmInt.c b/source/dnode/mgmt/vnode/src/vmInt.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..44bc6df3687d3a344ce4a85fa5c2fdb39f549366 100644 --- a/source/dnode/mgmt/vnode/src/vmInt.c +++ b/source/dnode/mgmt/vnode/src/vmInt.c @@ -0,0 +1,24 @@ +/* + * 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 . + */ + +#define _DEFAULT_SOURCE +#include "vmInt.h" +#include "vmHandle.h" + +SMgmtFp vmGetMgmtFp() { + SMgmtFp mgmtFp = {0}; + mgmtFp.getMsgHandleFp = vmGetMsgHandle; + return mgmtFp; +} diff --git a/source/dnode/mgmt/vnode/src/vmWorker.c b/source/dnode/mgmt/vnode/src/vmWorker.c index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..4518d98487cc945090e67920bf9e77c803b74e0a 100644 --- a/source/dnode/mgmt/vnode/src/vmWorker.c +++ b/source/dnode/mgmt/vnode/src/vmWorker.c @@ -0,0 +1,22 @@ +/* + * 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 . + */ + +#define _DEFAULT_SOURCE +#include "vmWorker.h" + +void vmProcessWriteMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg){} +void vmProcessSyncMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg){} +void vmProcessQueryMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg){} +void vmProcessFetchMsg(SDnode *pDnode, SMgmtWrapper *pWrapper, SNodeMsg *pMsg){} \ No newline at end of file