From 23a1204a28ac445c15e0fc48bcd09242649d820b Mon Sep 17 00:00:00 2001 From: Liu Jicong Date: Fri, 24 Dec 2021 14:37:06 +0800 Subject: [PATCH] fix topic init --- source/dnode/mnode/impl/inc/mndTopic.h | 8 ++++---- source/dnode/mnode/impl/src/mnode.c | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/dnode/mnode/impl/inc/mndTopic.h b/source/dnode/mnode/impl/inc/mndTopic.h index aa431a36c9..62d213b8a2 100644 --- a/source/dnode/mnode/impl/inc/mndTopic.h +++ b/source/dnode/mnode/impl/inc/mndTopic.h @@ -13,8 +13,8 @@ * along with this program. If not, see . */ -#ifndef _TD_MND_STB_H_ -#define _TD_MND_STB_H_ +#ifndef _TD_MND_TOPIC_H_ +#define _TD_MND_TOPIC_H_ #include "mndInt.h" @@ -25,11 +25,11 @@ extern "C" { int32_t mndInitTopic(SMnode *pMnode); void mndCleanupTopic(SMnode *pMnode); -SStbObj *mndAcquireTopic(SMnode *pMnode, char *topicName); +STopicObj *mndAcquireTopic(SMnode *pMnode, char *topicName); void mndReleaseTopic(SMnode *pMnode, STopicObj *pTopic); #ifdef __cplusplus } #endif -#endif /*_TD_MND_STB_H_*/ +#endif /*_TD_MND_TOPIC_H_*/ diff --git a/source/dnode/mnode/impl/src/mnode.c b/source/dnode/mnode/impl/src/mnode.c index a62a0a9296..b334936a44 100644 --- a/source/dnode/mnode/impl/src/mnode.c +++ b/source/dnode/mnode/impl/src/mnode.c @@ -27,6 +27,7 @@ #include "mndStb.h" #include "mndSync.h" #include "mndTelem.h" +#include "mndTopic.h" #include "mndTrans.h" #include "mndUser.h" #include "mndVgroup.h" @@ -132,6 +133,7 @@ static int32_t mndInitSteps(SMnode *pMnode) { if (mndAllocStep(pMnode, "mnode-db", mndInitDb, mndCleanupDb) != 0) return -1; if (mndAllocStep(pMnode, "mnode-vgroup", mndInitVgroup, mndCleanupVgroup) != 0) return -1; if (mndAllocStep(pMnode, "mnode-stb", mndInitStb, mndCleanupStb) != 0) return -1; + if (mndAllocStep(pMnode, "mnode-topic", mndInitTopic, mndCleanupTopic) != 0) return -1; if (mndAllocStep(pMnode, "mnode-func", mndInitFunc, mndCleanupFunc) != 0) return -1; if (pMnode->clusterId <= 0) { if (mndAllocStep(pMnode, "mnode-sdb-deploy", mndDeploySdb, NULL) != 0) return -1; @@ -227,7 +229,7 @@ static int32_t mndSetOptions(SMnode *pMnode, const SMnodeOpt *pOption) { } return 0; -} +} SMnode *mndOpen(const char *path, const SMnodeOpt *pOption) { mDebug("start to open mnode in %s", path); @@ -442,4 +444,4 @@ uint64_t mndGenerateUid(char *name, int32_t len) { int32_t hashval = MurmurHash3_32(name, len); uint64_t x = (us & 0x000000FFFFFFFFFF) << 24; return x + ((hashval & ((1ul << 16) - 1ul)) << 8) + (taosRand() & ((1ul << 8) - 1ul)); -} \ No newline at end of file +}