From edccd79561cb09b2de9609cf502f99062a5ec0cc Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 14 Mar 2022 13:24:15 +0800 Subject: [PATCH] shm --- source/dnode/mgmt/bnode/inc/bmHandle.h | 32 +++++++++++++++++++++++++ source/dnode/mgmt/bnode/src/bmHandle.c | 26 ++++++++++++++++++++ source/dnode/mgmt/bnode/src/bmInt.c | 24 +++++++++++++++++++ source/dnode/mgmt/dnode/inc/dndInt.h | 2 ++ source/dnode/mgmt/dnode/inc/dndMgmt.h | 2 +- source/dnode/mgmt/dnode/src/dndHandle.c | 1 + source/dnode/mgmt/dnode/src/dndInt.c | 9 ++++++- source/dnode/mgmt/dnode/src/dndMain.c | 1 + source/dnode/mgmt/dnode/src/dndMgmt.c | 19 ++++++++++++++- source/dnode/mgmt/mnode/src/mmInt.c | 1 + source/dnode/mgmt/mnode/src/mmWorker.c | 6 ++++- source/dnode/mgmt/qnode/inc/qmHandle.h | 32 +++++++++++++++++++++++++ source/dnode/mgmt/qnode/src/qmHandle.c | 26 ++++++++++++++++++++ source/dnode/mgmt/qnode/src/qmInt.c | 24 +++++++++++++++++++ source/dnode/mgmt/snode/inc/smHandle.h | 32 +++++++++++++++++++++++++ source/dnode/mgmt/snode/src/smHandle.c | 26 ++++++++++++++++++++ source/dnode/mgmt/snode/src/smInt.c | 24 +++++++++++++++++++ source/dnode/mgmt/vnode/src/vmInt.c | 24 +++++++++++++++++++ source/dnode/mgmt/vnode/src/vmWorker.c | 22 +++++++++++++++++ 19 files changed, 329 insertions(+), 4 deletions(-) diff --git a/source/dnode/mgmt/bnode/inc/bmHandle.h b/source/dnode/mgmt/bnode/inc/bmHandle.h index e69de29bb2..a24884849c 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 e69de29bb2..fd90e0c915 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 e69de29bb2..9147c4f8b8 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 1eb3ae556f..3473c9b339 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 af29ff3d25..f7d7b32ab5 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 cf4549615d..988fb86ae3 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 a23cfbbfe1..e61f49a820 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 20e3bfffb7..06be5b9d82 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 4822c91d20..8f71e866cc 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 9c0d9ade84..58957211a0 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 c0150e4dca..f5b6c58fe5 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 e69de29bb2..7dd761e917 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 e69de29bb2..d7e55e1fa5 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 e69de29bb2..ba172a9a72 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 e69de29bb2..3df6060bd3 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 e69de29bb2..80ab34f62c 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 e69de29bb2..840315364b 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 e69de29bb2..44bc6df368 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 e69de29bb2..4518d98487 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 -- GitLab