提交 89a19fdb 编写于 作者: S Shengliang Guan

fix compile errors

上级 0dddcdfb
...@@ -21,8 +21,8 @@ extern "C" { ...@@ -21,8 +21,8 @@ extern "C" {
#endif #endif
#include "dnodeInt.h" #include "dnodeInt.h"
int32_t dnodeInitMsg(); int32_t dnodeInitDnode();
void dnodeCleanupMsg(); void dnodeCleanupDnode();
void dnodeProcessStatusRsp(SRpcMsg *pMsg); void dnodeProcessStatusRsp(SRpcMsg *pMsg);
void dnodeProcessStartupReq(SRpcMsg *pMsg); void dnodeProcessStartupReq(SRpcMsg *pMsg);
void dnodeProcessConfigDnodeReq(SRpcMsg *pMsg); void dnodeProcessConfigDnodeReq(SRpcMsg *pMsg);
......
...@@ -21,8 +21,8 @@ extern "C" { ...@@ -21,8 +21,8 @@ extern "C" {
#endif #endif
#include "dnodeInt.h" #include "dnodeInt.h"
int32_t dnodeInitMsg(); int32_t dnodeInitDnode();
void dnodeCleanupMsg(); void dnodeCleanupDnode();
void dnodeProcessStatusRsp(SRpcMsg *pMsg); void dnodeProcessStatusRsp(SRpcMsg *pMsg);
void dnodeProcessStartupReq(SRpcMsg *pMsg); void dnodeProcessStartupReq(SRpcMsg *pMsg);
void dnodeProcessCreateMnodeReq(SRpcMsg *pMsg); void dnodeProcessCreateMnodeReq(SRpcMsg *pMsg);
......
...@@ -30,7 +30,7 @@ static struct { ...@@ -30,7 +30,7 @@ static struct {
pthread_mutex_t mutex; pthread_mutex_t mutex;
} tsConfig; } tsConfig;
vstaticoid dnodeGetEpSetForPeer(SRpcEpSet *epSet) { void dnodeGetEpSetForPeer(SRpcEpSet *epSet) {
pthread_mutex_lock(&tsConfig.mutex); pthread_mutex_lock(&tsConfig.mutex);
*epSet = tsConfig.mnodeEpSetForPeer; *epSet = tsConfig.mnodeEpSetForPeer;
pthread_mutex_unlock(&tsConfig.mutex); pthread_mutex_unlock(&tsConfig.mutex);
......
...@@ -25,7 +25,7 @@ static struct { ...@@ -25,7 +25,7 @@ static struct {
pthread_t *threadId; pthread_t *threadId;
bool stop; bool stop;
uint32_t rebootTime; uint32_t rebootTime;
} tsMsg; } tsDnode;
static void dnodeSendStatusMsg() { static void dnodeSendStatusMsg() {
int32_t contLen = sizeof(SStatusMsg) + TSDB_MAX_VNODES * sizeof(SVnodeLoad); int32_t contLen = sizeof(SStatusMsg) + TSDB_MAX_VNODES * sizeof(SVnodeLoad);
...@@ -39,7 +39,7 @@ static void dnodeSendStatusMsg() { ...@@ -39,7 +39,7 @@ static void dnodeSendStatusMsg() {
pStatus->dnodeId = htonl(dnodeGetDnodeId()); pStatus->dnodeId = htonl(dnodeGetDnodeId());
tstrncpy(pStatus->dnodeEp, tsLocalEp, TSDB_EP_LEN); tstrncpy(pStatus->dnodeEp, tsLocalEp, TSDB_EP_LEN);
pStatus->clusterId = htobe64(dnodeGetClusterId()); pStatus->clusterId = htobe64(dnodeGetClusterId());
pStatus->lastReboot = htonl(tsMsg.rebootTime); pStatus->lastReboot = htonl(tsDnode.rebootTime);
pStatus->numOfCores = htonl(tsNumOfCores); pStatus->numOfCores = htonl(tsNumOfCores);
pStatus->diskAvailable = tsAvailDataDirGB; pStatus->diskAvailable = tsAvailDataDirGB;
...@@ -93,17 +93,17 @@ void dnodeProcessStatusRsp(SRpcMsg *pMsg) { ...@@ -93,17 +93,17 @@ void dnodeProcessStatusRsp(SRpcMsg *pMsg) {
static void *dnodeThreadRoutine(void *param) { static void *dnodeThreadRoutine(void *param) {
int32_t ms = tsStatusInterval * 1000; int32_t ms = tsStatusInterval * 1000;
while (!tsMsg.stop) { while (!tsDnode.stop) {
taosMsleep(ms); taosMsleep(ms);
dnodeSendStatusMsg(); dnodeSendStatusMsg();
} }
} }
int32_t dnodeInitMsg() { int32_t dnodeInitDnode() {
tsMsg.stop = false; tsDnode.stop = false;
tsMsg.rebootTime = taosGetTimestampSec(); tsDnode.rebootTime = taosGetTimestampSec();
tsMsg.threadId = taosCreateThread(dnodeThreadRoutine, NULL); tsDnode.threadId = taosCreateThread(dnodeThreadRoutine, NULL);
if (tsMsg.threadId == NULL) { if (tsDnode.threadId == NULL) {
return -1; return -1;
} }
...@@ -111,11 +111,11 @@ int32_t dnodeInitMsg() { ...@@ -111,11 +111,11 @@ int32_t dnodeInitMsg() {
return 0; return 0;
} }
void dnodeCleanupMsg() { void dnodeCleanupDnode() {
if (tsMsg.threadId != NULL) { if (tsDnode.threadId != NULL) {
tsMsg.stop = true; tsDnode.stop = true;
taosDestoryThread(tsMsg.threadId); taosDestoryThread(tsDnode.threadId);
tsMsg.threadId = NULL; tsDnode.threadId = NULL;
} }
dInfo("dnode msg is cleanuped"); dInfo("dnode msg is cleanuped");
......
...@@ -31,27 +31,27 @@ static struct { ...@@ -31,27 +31,27 @@ static struct {
EDnStat runStatus; EDnStat runStatus;
SStartupStep startup; SStartupStep startup;
SSteps *steps; SSteps *steps;
} tsDnode; } tsInt;
EDnStat dnodeGetRunStat() { return tsDnode.runStatus; } EDnStat dnodeGetRunStat() { return tsInt.runStatus; }
void dnodeSetRunStat(EDnStat stat) { tsDnode.runStatus = stat; } void dnodeSetRunStat(EDnStat stat) { tsInt.runStatus = stat; }
void dnodeReportStartup(char *name, char *desc) { void dnodeReportStartup(char *name, char *desc) {
SStartupStep *startup = &tsDnode.startup; SStartupStep *startup = &tsInt.startup;
tstrncpy(startup->name, name, strlen(startup->name)); tstrncpy(startup->name, name, strlen(startup->name));
tstrncpy(startup->desc, desc, strlen(startup->desc)); tstrncpy(startup->desc, desc, strlen(startup->desc));
startup->finished = 0; startup->finished = 0;
} }
static void dnodeReportStartupFinished(char *name, char *desc) { static void dnodeReportStartupFinished(char *name, char *desc) {
SStartupStep *startup = &tsDnode.startup; SStartupStep *startup = &tsInt.startup;
tstrncpy(startup->name, name, strlen(startup->name)); tstrncpy(startup->name, name, strlen(startup->name));
tstrncpy(startup->desc, desc, strlen(startup->desc)); tstrncpy(startup->desc, desc, strlen(startup->desc));
startup->finished = 1; startup->finished = 1;
} }
void dnodeGetStartup(SStartupStep *pStep) { memcpy(pStep, &tsDnode.startup, sizeof(SStartupStep)); } void dnodeGetStartup(SStartupStep *pStep) { memcpy(pStep, &tsInt.startup, sizeof(SStartupStep)); }
static int32_t dnodeInitVnode() { static int32_t dnodeInitVnode() {
return vnodeInit(); return vnodeInit();
...@@ -72,7 +72,7 @@ static int32_t dnodeInitMnode() { ...@@ -72,7 +72,7 @@ static int32_t dnodeInitMnode() {
static int32_t dnodeInitTfs() {} static int32_t dnodeInitTfs() {}
static int32_t dnodeInitMain() { static int32_t dnodeInitMain() {
tsDnode.runStatus = DN_RUN_STAT_STOPPED; tsInt.runStatus = DN_RUN_STAT_STOPPED;
tscEmbedded = 1; tscEmbedded = 1;
taosIgnSIGPIPE(); taosIgnSIGPIPE();
taosBlockSIGPIPE(); taosBlockSIGPIPE();
...@@ -175,10 +175,10 @@ int32_t dnodeInit() { ...@@ -175,10 +175,10 @@ int32_t dnodeInit() {
taosStepAdd(steps, "dnode-vnode", dnodeInitVnode, vnodeCleanup); taosStepAdd(steps, "dnode-vnode", dnodeInitVnode, vnodeCleanup);
taosStepAdd(steps, "dnode-mnode", dnodeInitMnode, mnodeCleanup); taosStepAdd(steps, "dnode-mnode", dnodeInitMnode, mnodeCleanup);
taosStepAdd(steps, "dnode-trans", dnodeInitTrans, dnodeCleanupTrans); taosStepAdd(steps, "dnode-trans", dnodeInitTrans, dnodeCleanupTrans);
taosStepAdd(steps, "dnode-msg", dnodeInitMsg, dnodeCleanupMsg); taosStepAdd(steps, "dnode-msg", dnodeInitDnode, dnodeCleanupDnode);
tsDnode.steps = steps; tsInt.steps = steps;
taosStepExec(tsDnode.steps); taosStepExec(tsInt.steps);
dnodeSetRunStat(DN_RUN_STAT_RUNNING); dnodeSetRunStat(DN_RUN_STAT_RUNNING);
dnodeReportStartupFinished("TDengine", "initialized successfully"); dnodeReportStartupFinished("TDengine", "initialized successfully");
...@@ -190,8 +190,8 @@ int32_t dnodeInit() { ...@@ -190,8 +190,8 @@ int32_t dnodeInit() {
void dnodeCleanup() { void dnodeCleanup() {
if (dnodeGetRunStat() != DN_RUN_STAT_STOPPED) { if (dnodeGetRunStat() != DN_RUN_STAT_STOPPED) {
dnodeSetRunStat(DN_RUN_STAT_STOPPED); dnodeSetRunStat(DN_RUN_STAT_STOPPED);
taosStepCleanup(tsDnode.steps); taosStepCleanup(tsInt.steps);
tsDnode.steps = NULL; tsInt.steps = NULL;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册