提交 21c69b8b 编写于 作者: S Shengliang Guan

minor changes

上级 0b6d32a3
......@@ -29,6 +29,7 @@ typedef struct SDnode SDnode;
typedef struct {
int32_t sver;
int32_t numOfCores;
int16_t numOfCommitThreads;
int8_t enableTelem;
char timezone[TSDB_TIMEZONE_LEN];
char locale[TSDB_LOCALE_LEN];
......@@ -53,7 +54,6 @@ void dndCleanup();
/* ------------------------ SDnode ----------------------- */
typedef struct {
int16_t numOfCommitThreads;
int32_t numOfSupportVnodes;
int32_t statusInterval;
float numOfThreadsPerCore;
......
......@@ -139,6 +139,7 @@ void dmnWaitSignal() {
void dnmInitEnvCfg(SDnodeEnvCfg *pCfg) {
pCfg->sver = 30000000; // 3.0.0.0
pCfg->numOfCores = tsNumOfCores;
pCfg->numOfCommitThreads = tsNumOfCommitThreads;
pCfg->enableTelem = 0;
tstrncpy(pCfg->timezone, tsTimezone, TSDB_TIMEZONE_LEN);
tstrncpy(pCfg->locale, tsLocale, TSDB_LOCALE_LEN);
......@@ -149,7 +150,6 @@ void dnmInitEnvCfg(SDnodeEnvCfg *pCfg) {
void dmnInitObjCfg(SDnodeObjCfg *pCfg) {
pCfg->numOfSupportVnodes = tsNumOfSupportVnodes;
pCfg->numOfCommitThreads = tsNumOfCommitThreads;
pCfg->statusInterval = tsStatusInterval;
pCfg->numOfThreadsPerCore = tsNumOfThreadsPerCore;
pCfg->ratioOfQueryCores = tsRatioOfQueryCores;
......
......@@ -183,20 +183,6 @@ SDnode *dndCreate(SDnodeObjCfg *pCfg) {
return NULL;
}
SVnodeOpt vnodeOpt = {
.sver = pDnode->env.sver,
.timezone = pDnode->env.timezone,
.locale = pDnode->env.locale,
.charset = pDnode->env.charset,
.nthreads = pDnode->cfg.numOfCommitThreads,
.putReqToVQueryQFp = dndPutReqToVQueryQ,
};
if (vnodeInit(&vnodeOpt) != 0) {
dError("failed to init vnode since %s", terrstr());
dndClose(pDnode);
return NULL;
}
if (dndInitMgmt(pDnode) != 0) {
dError("failed to init mgmt since %s", terrstr());
dndClose(pDnode);
......@@ -296,6 +282,21 @@ int32_t dndInit(const SDnodeEnvCfg *pCfg) {
return -1;
}
SVnodeOpt vnodeOpt = {
.sver = pCfg->sver,
.timezone = pCfg->timezone,
.locale = pCfg->locale,
.charset = pCfg->charset,
.nthreads = pCfg->numOfCommitThreads,
.putReqToVQueryQFp = dndPutReqToVQueryQ,
};
if (vnodeInit(&vnodeOpt) != 0) {
dError("failed to init vnode since %s", terrstr());
dndCleanup();
return NULL;
}
memcpy(&dndEnv.cfg, pCfg, sizeof(SDnodeEnvCfg));
dInfo("dnode env is initialized");
return 0;
......
......@@ -25,7 +25,6 @@ void* serverLoop(void* param) {
SDnodeObjCfg TestServer::BuildOption(const char* path, const char* fqdn, uint16_t port, const char* firstEp) {
SDnodeObjCfg cfg = {0};
cfg.numOfSupportVnodes = 16;
cfg.numOfCommitThreads = 1;
cfg.statusInterval = 1;
cfg.numOfThreadsPerCore = 1;
cfg.ratioOfQueryCores = 1;
......
......@@ -44,6 +44,7 @@ void Testbase::InitLog(const char* path) {
void Testbase::Init(const char* path, int16_t port) {
SDnodeEnvCfg cfg = {0};
cfg.numOfCommitThreads = 1;
dndInit(&cfg);
char fqdn[] = "localhost";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册