diff --git a/include/dnode/mnode/mnode.h b/include/dnode/mnode/mnode.h index 2ffbd395e86f4c0bf214976b7c80de2a07da7fc6..fa357fc81447adda04380b7180260b13a1966e2c 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 a45d865c03aa6ffb9329ad5ee35ceae54c23128c..e52739104c7f3d8d00cd8c53279cf65a89483f87 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 a759e0169e8c3972baecfa843de5d8c0cfd8a986..cba1682fa567d04ab3acc4da3efeccb3eec05aa5 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 84de9bcb32c282c4008924408cd21d3e97729ada..3ec572d32ef0bac6d901139e34435f9341d7cb7d 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 f9047e6e254fd0273764ef7bffc88a6d423a75fb..cb01a9e414e94097fe06e4f65e601203d5fb44ac 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 1ab4844873182a0d96e93aed68c40aad2b18b934..d694badb54573015888a6de20e553136e513aeda 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 ccdba13006bb6dc46eb8f33f5d56709a93e653f7..baed0b44e4bd753af91abb281584b7646dda8752 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 7b25061b95de30728b87c7546f015231592dd94b..5babb99a42b91c7d57ea7a809978506636d5f284 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 ff1ebde8b009bc3e33474f03c1b9078de633ec65..22ee7018f2d750e387e27874f862306790f0d469 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 17db21fe18c04b9b6095c91641e1d13eceed0af0..62f591a26e9f81d92adc8624bf1dff4cb1fd6e62 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 9e7f1766a6fd0cf3283f32ed093e8d880013421e..4c20cbf833c82039ab6c6de8e2f4bb21632a4022 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 4392422b23cd30369fb72cf369315c5d55fc63fb..7ab396a01957a90408f2e107407061e5fb7c1678 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 405a6f8dac64519596f0a17e00bbf087d6b30b34..d2b402227b3c0c5ea7a41680d1b865b92dadd0d3 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 5045fde1a85b51abf05547ca675cf152d57bb602..cc3bd55cf46f470895fb66dac8460418ee1daffc 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 f55d7737de867bc82121513794bdf9faba9ab5be..b2469aaaa88d6f45ba30b3f0437b637d1ea944cb 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 8877bc9c82ba2c0ea357bf1e98d8a5b7d35c1606..863aaccf0c4d0837f326ab353912835e9e2a97c3 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 bb2e6635b15553cae367d4edcd14030098086a08..f2a11a3d32d5f5680af46b7fd5adb747b78468b7 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 47fc32c634da2279ca65e15d4830aa6164aed380..adc7a0db134135a05b3506ad1cf38ef7dc36c69c 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 d6e5e00ba80225557506afeebe199ad1b65f97d1..18c2ea7ecfaf2dc21713bab02af81866609d97f5 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 0000000000000000000000000000000000000000..62f591a26e9f81d92adc8624bf1dff4cb1fd6e62 --- /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 0000000000000000000000000000000000000000..adc7a0db134135a05b3506ad1cf38ef7dc36c69c --- /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_*/