From 78001a2887f4eddf0712f6125aba38fec16ec0e9 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 25 Oct 2021 11:35:02 +0800 Subject: [PATCH] [TD-10430] rename some files --- source/server/dnode/inc/dnodeCheck.h | 1 - .../server/dnode/inc/{dnodeEps.h => dnodeDnodeEps.h} | 12 ++++++------ source/server/dnode/inc/dnodeMain.h | 4 ++-- .../server/dnode/src/{dnodeEps.c => dnodeDnodeEps.c} | 8 ++++---- source/server/dnode/src/dnodeInt.c | 4 ++-- source/server/dnode/src/dnodeMain.c | 6 +++--- source/server/dnode/src/dnodeMnodeEps.c | 2 +- source/server/dnode/src/dnodeStatus.c | 4 ++-- 8 files changed, 20 insertions(+), 21 deletions(-) rename source/server/dnode/inc/{dnodeEps.h => dnodeDnodeEps.h} (81%) rename source/server/dnode/src/{dnodeEps.c => dnodeDnodeEps.c} (98%) diff --git a/source/server/dnode/inc/dnodeCheck.h b/source/server/dnode/inc/dnodeCheck.h index b6fbf1eabd..97ac524b3f 100644 --- a/source/server/dnode/inc/dnodeCheck.h +++ b/source/server/dnode/inc/dnodeCheck.h @@ -21,7 +21,6 @@ extern "C" { #endif #include "dnodeInt.h" - int32_t dnodeInitCheck(); void dnodeCleanupCheck(); diff --git a/source/server/dnode/inc/dnodeEps.h b/source/server/dnode/inc/dnodeDnodeEps.h similarity index 81% rename from source/server/dnode/inc/dnodeEps.h rename to source/server/dnode/inc/dnodeDnodeEps.h index 4f25884021..01023da7fc 100644 --- a/source/server/dnode/inc/dnodeEps.h +++ b/source/server/dnode/inc/dnodeDnodeEps.h @@ -13,17 +13,17 @@ * along with this program. If not, see . */ -#ifndef _TD_DNODE_EPS_H_ -#define _TD_DNODE_EPS_H_ +#ifndef _TD_DNODE_DNODE_EPS_H_ +#define _TD_DNODE_DNODE_EPS_H_ #ifdef __cplusplus extern "C" { #endif #include "dnodeInt.h" -int32_t dnodeInitEps(); -void dnodeCleanupEps(); -void dnodeUpdateEps(SDnodeEps *data); +int32_t dnodeInitDnodeEps(); +void dnodeCleanupDnodeEps(); +void dnodeUpdateDnodeEps(SDnodeEps *data); bool dnodeIsDnodeEpChanged(int32_t dnodeId, char *epstr); void dnodeGetDnodeEp(int32_t dnodeId, char *epstr, char *fqdn, uint16_t *port); @@ -31,4 +31,4 @@ void dnodeGetDnodeEp(int32_t dnodeId, char *epstr, char *fqdn, uint16_t *port } #endif -#endif /*_TD_DNODE_EPS_H_*/ \ No newline at end of file +#endif /*_TD_DNODE_DNODE_EPS_H_*/ \ No newline at end of file diff --git a/source/server/dnode/inc/dnodeMain.h b/source/server/dnode/inc/dnodeMain.h index 325136caa6..b3aeeceb44 100644 --- a/source/server/dnode/inc/dnodeMain.h +++ b/source/server/dnode/inc/dnodeMain.h @@ -25,7 +25,7 @@ typedef enum { DN_RUN_STAT_INIT, DN_RUN_STAT_RUNNING, DN_RUN_STAT_STOPPED -} EDnRunStat; +} EDnStat; int32_t dnodeInitMain(); void dnodeCleanupMain(); @@ -36,7 +36,7 @@ void dnodeReportStartupFinished(char *name, char *desc); void dnodeProcessStartupReq(SRpcMsg *pMsg); void dnodeProcessCreateMnodeReq(SRpcMsg *pMsg); void dnodeProcessConfigDnodeReq(SRpcMsg *pMsg); -EDnRunStat dnodeGetRunStat(); +EDnStat dnodeGetRunStat(); void dnodeSetRunStat(); void* dnodeGetTimer(); diff --git a/source/server/dnode/src/dnodeEps.c b/source/server/dnode/src/dnodeDnodeEps.c similarity index 98% rename from source/server/dnode/src/dnodeEps.c rename to source/server/dnode/src/dnodeDnodeEps.c index d5bb77bde6..15c084439f 100644 --- a/source/server/dnode/src/dnodeEps.c +++ b/source/server/dnode/src/dnodeDnodeEps.c @@ -18,7 +18,7 @@ #include "cJSON.h" #include "thash.h" #include "tglobal.h" -#include "dnodeEps.h" +#include "dnodeDnodeEps.h" #include "dnodeCfg.h" static struct { @@ -192,7 +192,7 @@ static int32_t dnodeWriteEps() { return 0; } -int32_t dnodeInitEps() { +int32_t dnodeInitDnodeEps() { tsDeps.dnodeHash = taosHashInit(4, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK); if (tsDeps.dnodeHash == NULL) return -1; @@ -209,7 +209,7 @@ int32_t dnodeInitEps() { return ret; } -void dnodeCleanupEps() { +void dnodeCleanupDnodeEps() { pthread_mutex_lock(&tsDeps.mutex); if (tsDeps.dnodeList != NULL) { @@ -227,7 +227,7 @@ void dnodeCleanupEps() { pthread_mutex_destroy(&tsDeps.mutex); } -void dnodeUpdateEps(SDnodeEps *data) { +void dnodeUpdateDnodeEps(SDnodeEps *data) { if (data == NULL || data->dnodeNum <= 0) return; data->dnodeNum = htonl(data->dnodeNum); diff --git a/source/server/dnode/src/dnodeInt.c b/source/server/dnode/src/dnodeInt.c index 4dbf02a868..5f0dcc630b 100644 --- a/source/server/dnode/src/dnodeInt.c +++ b/source/server/dnode/src/dnodeInt.c @@ -24,7 +24,7 @@ #include "tstep.h" #include "dnodeCfg.h" #include "dnodeCheck.h" -#include "dnodeEps.h" +#include "dnodeDnodeEps.h" #include "dnodeMain.h" #include "dnodeMnodeEps.h" #include "dnodeStatus.h" @@ -64,7 +64,7 @@ int32_t dnodeInit() { taosStepAdd(tsSteps, "dnode-rpc", rpcInit, rpcCleanup); taosStepAdd(tsSteps, "dnode-check", dnodeInitCheck, dnodeCleanupCheck); taosStepAdd(tsSteps, "dnode-cfg", dnodeInitCfg, dnodeCleanupCfg); - taosStepAdd(tsSteps, "dnode-deps", dnodeInitEps, dnodeCleanupEps); + taosStepAdd(tsSteps, "dnode-deps", dnodeInitDnodeEps, dnodeCleanupDnodeEps); taosStepAdd(tsSteps, "dnode-meps", dnodeInitMnodeEps, dnodeCleanupMnodeEps); //taosStepAdd(tsSteps, "dnode-wal", walInit, walCleanUp); //taosStepAdd(tsSteps, "dnode-sync", syncInit, syncCleanUp); diff --git a/source/server/dnode/src/dnodeMain.c b/source/server/dnode/src/dnodeMain.c index 50702823f1..74309dda69 100644 --- a/source/server/dnode/src/dnodeMain.c +++ b/source/server/dnode/src/dnodeMain.c @@ -29,7 +29,7 @@ #include "mnode.h" static struct { - EDnRunStat runStatus; + EDnStat runStatus; void * dnodeTimer; SStartupStep startup; } tsDmain; @@ -260,8 +260,8 @@ void dnodeProcessConfigDnodeReq(SRpcMsg *pMsg) { rpcFreeCont(pMsg->pCont); } -EDnRunStat dnodeGetRunStat() { return tsDmain.runStatus; } +EDnStat dnodeGetRunStat() { return tsDmain.runStatus; } -void dnodeSetRunStat(EDnRunStat stat) { tsDmain.runStatus = stat; } +void dnodeSetRunStat(EDnStat stat) { tsDmain.runStatus = stat; } void* dnodeGetTimer() { return tsDmain.dnodeTimer; } \ No newline at end of file diff --git a/source/server/dnode/src/dnodeMnodeEps.c b/source/server/dnode/src/dnodeMnodeEps.c index 5646fd5363..f34ee48238 100644 --- a/source/server/dnode/src/dnodeMnodeEps.c +++ b/source/server/dnode/src/dnodeMnodeEps.c @@ -18,7 +18,7 @@ #include "cJSON.h" #include "tglobal.h" #include "dnodeCfg.h" -#include "dnodeEps.h" +#include "dnodeDnodeEps.h" #include "dnodeMnodeEps.h" #include "mnode.h" diff --git a/source/server/dnode/src/dnodeStatus.c b/source/server/dnode/src/dnodeStatus.c index 38b685c1fb..4edcc2e8c2 100644 --- a/source/server/dnode/src/dnodeStatus.c +++ b/source/server/dnode/src/dnodeStatus.c @@ -19,7 +19,7 @@ #include "ttimer.h" #include "tglobal.h" #include "dnodeCfg.h" -#include "dnodeEps.h" +#include "dnodeDnodeEps.h" #include "dnodeMnodeEps.h" #include "dnodeStatus.h" #include "dnodeMain.h" @@ -114,7 +114,7 @@ void dnodeProcessStatusRsp(SRpcMsg *pMsg) { vnodeSetAccess(pStatusRsp->vgAccess, pCfg->numOfVnodes); SDnodeEps *pEps = (SDnodeEps *)((char *)pStatusRsp->vgAccess + pCfg->numOfVnodes * sizeof(SVgroupAccess)); - dnodeUpdateEps(pEps); + dnodeUpdateDnodeEps(pEps); taosTmrReset(dnodeSendStatusMsg, tsStatusInterval * 1000, NULL, tsStatus.dnodeTimer, &tsStatus.statusTimer); } -- GitLab