From a17d9811795303e77c0ec5d2b0e12a04b0f258e5 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Sat, 27 Nov 2021 23:02:20 +0800 Subject: [PATCH] rename some defs --- include/dnode/mnode/mnode.h | 6 +- source/dnode/mnode/impl/inc/mndAcct.h | 6 +- source/dnode/mnode/impl/inc/mndAuth.h | 6 +- source/dnode/mnode/impl/inc/mndBalance.h | 6 +- source/dnode/mnode/impl/inc/mndCluster.h | 6 +- source/dnode/mnode/impl/inc/mndDb.h | 6 +- source/dnode/mnode/impl/inc/mndDef.h | 6 +- source/dnode/mnode/impl/inc/mndDnode.h | 6 +- source/dnode/mnode/impl/inc/mndFunc.h | 6 +- source/dnode/mnode/impl/inc/mndInt.h | 6 +- source/dnode/mnode/impl/inc/mndMnode.h | 6 +- source/dnode/mnode/impl/inc/mndOper.h | 6 +- source/dnode/mnode/impl/inc/mndProfile.h | 6 +- source/dnode/mnode/impl/inc/mndShow.h | 6 +- source/dnode/mnode/impl/inc/mndStable.h | 6 +- source/dnode/mnode/impl/inc/mndSync.h | 6 +- source/dnode/mnode/impl/inc/mndTelem.h | 6 +- source/dnode/mnode/impl/inc/mndUser.h | 6 +- source/dnode/mnode/impl/inc/mndVgroup.h | 6 +- source/dnode/mnode/impl/inc/mnodeInt.h | 70 ++++++++++++++++++++++++ source/dnode/mnode/impl/inc/mnodeUser.h | 32 +++++++++++ 21 files changed, 159 insertions(+), 57 deletions(-) create mode 100644 source/dnode/mnode/impl/inc/mnodeInt.h create mode 100644 source/dnode/mnode/impl/inc/mnodeUser.h diff --git a/include/dnode/mnode/mnode.h b/include/dnode/mnode/mnode.h index 2ffbd395e8..fa357fc814 100644 --- a/include/dnode/mnode/mnode.h +++ b/include/dnode/mnode/mnode.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_H_ -#define _TD_MNODE_H_ +#ifndef _TD_MND_H_ +#define _TD_MND_H_ #ifdef __cplusplus extern "C" { @@ -170,4 +170,4 @@ void mnodeProcessApplyMsg(SMnodeMsg *pMsg); } #endif -#endif /*_TD_MNODE_H_*/ +#endif /*_TD_MND_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndAcct.h b/source/dnode/mnode/impl/inc/mndAcct.h index a45d865c03..e52739104c 100644 --- a/source/dnode/mnode/impl/inc/mndAcct.h +++ b/source/dnode/mnode/impl/inc/mndAcct.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_ACCT_H_ -#define _TD_MNODE_ACCT_H_ +#ifndef _TD_MND_ACCT_H_ +#define _TD_MND_ACCT_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupAcct(); } #endif -#endif /*_TD_MNODE_ACCT_H_*/ +#endif /*_TD_MND_ACCT_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndAuth.h b/source/dnode/mnode/impl/inc/mndAuth.h index a759e0169e..cba1682fa5 100644 --- a/source/dnode/mnode/impl/inc/mndAuth.h +++ b/source/dnode/mnode/impl/inc/mndAuth.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_AUTH_H_ -#define _TD_MNODE_AUTH_H_ +#ifndef _TD_MND_AUTH_H_ +#define _TD_MND_AUTH_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupAuth(); } #endif -#endif /*_TD_MNODE_AUTH_H_*/ +#endif /*_TD_MND_AUTH_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndBalance.h b/source/dnode/mnode/impl/inc/mndBalance.h index 84de9bcb32..3ec572d32e 100644 --- a/source/dnode/mnode/impl/inc/mndBalance.h +++ b/source/dnode/mnode/impl/inc/mndBalance.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_BALANCE_H_ -#define _TD_MNODE_BALANCE_H_ +#ifndef _TD_MND_BALANCE_H_ +#define _TD_MND_BALANCE_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupBalance(); } #endif -#endif /*_TD_MNODE_BALANCE_H_*/ +#endif /*_TD_MND_BALANCE_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndCluster.h b/source/dnode/mnode/impl/inc/mndCluster.h index f9047e6e25..cb01a9e414 100644 --- a/source/dnode/mnode/impl/inc/mndCluster.h +++ b/source/dnode/mnode/impl/inc/mndCluster.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_CLUSTER_H_ -#define _TD_MNODE_CLUSTER_H_ +#ifndef _TD_MND_CLUSTER_H_ +#define _TD_MND_CLUSTER_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupCluster(); } #endif -#endif /*_TD_MNODE_CLUSTER_H_*/ +#endif /*_TD_MND_CLUSTER_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndDb.h b/source/dnode/mnode/impl/inc/mndDb.h index 1ab4844873..d694badb54 100644 --- a/source/dnode/mnode/impl/inc/mndDb.h +++ b/source/dnode/mnode/impl/inc/mndDb.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_DATABASE_H_ -#define _TD_MNODE_DATABASE_H_ +#ifndef _TD_MND_DATABASE_H_ +#define _TD_MND_DATABASE_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupDb(); } #endif -#endif /*_TD_MNODE_DATABASE_H_*/ +#endif /*_TD_MND_DATABASE_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndDef.h b/source/dnode/mnode/impl/inc/mndDef.h index ccdba13006..baed0b44e4 100644 --- a/source/dnode/mnode/impl/inc/mndDef.h +++ b/source/dnode/mnode/impl/inc/mndDef.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_DEF_H_ -#define _TD_MNODE_DEF_H_ +#ifndef _TD_MND_DEF_H_ +#define _TD_MND_DEF_H_ #include "os.h" #include "taosmsg.h" @@ -305,4 +305,4 @@ typedef struct SMnodeMsg { } #endif -#endif /*_TD_MNODE_DEF_H_*/ +#endif /*_TD_MND_DEF_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndDnode.h b/source/dnode/mnode/impl/inc/mndDnode.h index 7b25061b95..5babb99a42 100644 --- a/source/dnode/mnode/impl/inc/mndDnode.h +++ b/source/dnode/mnode/impl/inc/mndDnode.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_DNODE_H_ -#define _TD_MNODE_DNODE_H_ +#ifndef _TD_MND_DNODE_H_ +#define _TD_MND_DNODE_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupDnode(); } #endif -#endif /*_TD_MNODE_DNODE_H_*/ +#endif /*_TD_MND_DNODE_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndFunc.h b/source/dnode/mnode/impl/inc/mndFunc.h index ff1ebde8b0..22ee7018f2 100644 --- a/source/dnode/mnode/impl/inc/mndFunc.h +++ b/source/dnode/mnode/impl/inc/mndFunc.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_FUNC_H_ -#define _TD_MNODE_FUNC_H_ +#ifndef _TD_MND_FUNC_H_ +#define _TD_MND_FUNC_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupFunc(); } #endif -#endif /*_TD_MNODE_FUNC_H_*/ +#endif /*_TD_MND_FUNC_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndInt.h b/source/dnode/mnode/impl/inc/mndInt.h index 17db21fe18..62f591a26e 100644 --- a/source/dnode/mnode/impl/inc/mndInt.h +++ b/source/dnode/mnode/impl/inc/mndInt.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_INT_H_ -#define _TD_MNODE_INT_H_ +#ifndef _TD_MND_INT_H_ +#define _TD_MND_INT_H_ #include "mndDef.h" #include "sdb.h" @@ -67,4 +67,4 @@ void mnodeSetMsgHandle(SMnode *pMnode, int32_t msgType, MndMsgFp fp); } #endif -#endif /*_TD_MNODE_INT_H_*/ +#endif /*_TD_MND_INT_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndMnode.h b/source/dnode/mnode/impl/inc/mndMnode.h index 9e7f1766a6..4c20cbf833 100644 --- a/source/dnode/mnode/impl/inc/mndMnode.h +++ b/source/dnode/mnode/impl/inc/mndMnode.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_MNODE_H_ -#define _TD_MNODE_MNODE_H_ +#ifndef _TD_MND_MNODE_H_ +#define _TD_MND_MNODE_H_ #include "mndInt.h" @@ -31,4 +31,4 @@ void mnodeGetMnodeEpSetForShell(SEpSet *epSet, bool redirect); } #endif -#endif /*_TD_MNODE_MNODE_H_*/ +#endif /*_TD_MND_MNODE_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndOper.h b/source/dnode/mnode/impl/inc/mndOper.h index 4392422b23..7ab396a019 100644 --- a/source/dnode/mnode/impl/inc/mndOper.h +++ b/source/dnode/mnode/impl/inc/mndOper.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_OPER_H_ -#define _TD_MNODE_OPER_H_ +#ifndef _TD_MND_OPER_H_ +#define _TD_MND_OPER_H_ #ifdef __cplusplus extern "C" { @@ -27,4 +27,4 @@ void mnodeCleanupOper(); } #endif -#endif /*_TD_MNODE_OPER_H_*/ +#endif /*_TD_MND_OPER_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndProfile.h b/source/dnode/mnode/impl/inc/mndProfile.h index 405a6f8dac..d2b402227b 100644 --- a/source/dnode/mnode/impl/inc/mndProfile.h +++ b/source/dnode/mnode/impl/inc/mndProfile.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_PROFILE_H_ -#define _TD_MNODE_PROFILE_H_ +#ifndef _TD_MND_PROFILE_H_ +#define _TD_MND_PROFILE_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupProfile(); } #endif -#endif /*_TD_MNODE_PROFILE_H_*/ +#endif /*_TD_MND_PROFILE_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndShow.h b/source/dnode/mnode/impl/inc/mndShow.h index 5045fde1a8..cc3bd55cf4 100644 --- a/source/dnode/mnode/impl/inc/mndShow.h +++ b/source/dnode/mnode/impl/inc/mndShow.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_SHOW_H_ -#define _TD_MNODE_SHOW_H_ +#ifndef _TD_MND_SHOW_H_ +#define _TD_MND_SHOW_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanUpShow(); } #endif -#endif /*_TD_MNODE_SHOW_H_*/ +#endif /*_TD_MND_SHOW_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndStable.h b/source/dnode/mnode/impl/inc/mndStable.h index f55d7737de..b2469aaaa8 100644 --- a/source/dnode/mnode/impl/inc/mndStable.h +++ b/source/dnode/mnode/impl/inc/mndStable.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_STABLE_H_ -#define _TD_MNODE_STABLE_H_ +#ifndef _TD_MND_STABLE_H_ +#define _TD_MND_STABLE_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupStable(); } #endif -#endif /*_TD_MNODE_STABLE_H_*/ +#endif /*_TD_MND_STABLE_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndSync.h b/source/dnode/mnode/impl/inc/mndSync.h index 8877bc9c82..863aaccf0c 100644 --- a/source/dnode/mnode/impl/inc/mndSync.h +++ b/source/dnode/mnode/impl/inc/mndSync.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_SYNC_H_ -#define _TD_MNODE_SYNC_H_ +#ifndef _TD_MND_SYNC_H_ +#define _TD_MND_SYNC_H_ #include "mndInt.h" @@ -32,4 +32,4 @@ bool mnodeIsMaster(); } #endif -#endif /*_TD_MNODE_SYNC_H_*/ +#endif /*_TD_MND_SYNC_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndTelem.h b/source/dnode/mnode/impl/inc/mndTelem.h index bb2e6635b1..f2a11a3d32 100644 --- a/source/dnode/mnode/impl/inc/mndTelem.h +++ b/source/dnode/mnode/impl/inc/mndTelem.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_TELEMETRY_H_ -#define _TD_MNODE_TELEMETRY_H_ +#ifndef _TD_MND_TELEMETRY_H_ +#define _TD_MND_TELEMETRY_H_ #ifdef __cplusplus extern "C" { @@ -28,4 +28,4 @@ void mnodeCleanupTelem(); } #endif -#endif /*_TD_MNODE_TELEMETRY_H_*/ +#endif /*_TD_MND_TELEMETRY_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndUser.h b/source/dnode/mnode/impl/inc/mndUser.h index 47fc32c634..adc7a0db13 100644 --- a/source/dnode/mnode/impl/inc/mndUser.h +++ b/source/dnode/mnode/impl/inc/mndUser.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_USER_H_ -#define _TD_MNODE_USER_H_ +#ifndef _TD_MND_USER_H_ +#define _TD_MND_USER_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupUser(); } #endif -#endif /*_TD_MNODE_USER_H_*/ +#endif /*_TD_MND_USER_H_*/ diff --git a/source/dnode/mnode/impl/inc/mndVgroup.h b/source/dnode/mnode/impl/inc/mndVgroup.h index d6e5e00ba8..18c2ea7ecf 100644 --- a/source/dnode/mnode/impl/inc/mndVgroup.h +++ b/source/dnode/mnode/impl/inc/mndVgroup.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MNODE_VGROUP_H_ -#define _TD_MNODE_VGROUP_H_ +#ifndef _TD_MND_VGROUP_H_ +#define _TD_MND_VGROUP_H_ #include "mndInt.h" @@ -29,4 +29,4 @@ void mnodeCleanupVgroup(); } #endif -#endif /*_TD_MNODE_VGROUP_H_*/ +#endif /*_TD_MND_VGROUP_H_*/ diff --git a/source/dnode/mnode/impl/inc/mnodeInt.h b/source/dnode/mnode/impl/inc/mnodeInt.h new file mode 100644 index 0000000000..62f591a26e --- /dev/null +++ b/source/dnode/mnode/impl/inc/mnodeInt.h @@ -0,0 +1,70 @@ +/* + * 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_MND_INT_H_ +#define _TD_MND_INT_H_ + +#include "mndDef.h" +#include "sdb.h" +#include "tstep.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef int32_t (*MndMsgFp)(SMnode *pMnode, SMnodeMsg *pMsg); + +typedef struct SMnodeBak { + int32_t dnodeId; + int64_t clusterId; + tmr_h timer; + SSteps *pInitSteps; + SSteps *pStartSteps; + SMnodeOpt para; + MndMsgFp msgFp[TSDB_MSG_TYPE_MAX]; +} SMnodeBak; + +typedef struct SMnode { + int32_t dnodeId; + int64_t clusterId; + int8_t replica; + int8_t selfIndex; + SReplica replicas[TSDB_MAX_REPLICA]; + tmr_h timer; + SSteps *pInitSteps; + SSteps *pStartSteps; + struct SSdb *pSdb; + struct SDnode *pServer; + MndMsgFp msgFp[TSDB_MSG_TYPE_MAX]; + PutMsgToMnodeQFp putMsgToApplyMsgFp; + SendMsgToDnodeFp sendMsgToDnodeFp; + SendMsgToMnodeFp sendMsgToMnodeFp; + SendRedirectMsgFp sendRedirectMsgFp; +} SMnode; + +tmr_h mnodeGetTimer(); +int32_t mnodeGetDnodeId(); +int64_t mnodeGetClusterId(); + +void mnodeSendMsgToDnode(SMnode *pMnode, struct SEpSet *epSet, struct SRpcMsg *rpcMsg); +void mnodeSendMsgToMnode(SMnode *pMnode, struct SRpcMsg *rpcMsg); +void mnodeSendRedirectMsg(SMnode *pMnode, struct SRpcMsg *rpcMsg, bool forShell); +void mnodeSetMsgHandle(SMnode *pMnode, int32_t msgType, MndMsgFp fp); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_MND_INT_H_*/ diff --git a/source/dnode/mnode/impl/inc/mnodeUser.h b/source/dnode/mnode/impl/inc/mnodeUser.h new file mode 100644 index 0000000000..adc7a0db13 --- /dev/null +++ b/source/dnode/mnode/impl/inc/mnodeUser.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_MND_USER_H_ +#define _TD_MND_USER_H_ + +#include "mndInt.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int32_t mnodeInitUser(); +void mnodeCleanupUser(); + +#ifdef __cplusplus +} +#endif + +#endif /*_TD_MND_USER_H_*/ -- GitLab