提交 276eb847 编写于 作者: wafwerar's avatar wafwerar

feature(dnode): mul parameter start.

上级 f9662420
...@@ -123,9 +123,9 @@ extern SDiskCfg tsDiskCfg[]; ...@@ -123,9 +123,9 @@ extern SDiskCfg tsDiskCfg[];
#define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize) #define NEEDTO_COMPRESSS_MSG(size) (tsCompressMsgSize != -1 && (size) > tsCompressMsgSize)
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char **envCmd, const char *cfgDir, const char *envFile, int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd, const char *envFile,
char *apolloUrl, SArray *pArgs, bool tsc); char *apolloUrl, SArray *pArgs, bool tsc);
int32_t taosInitCfg(const char **envCmd, const char *cfgDir, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc); int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc);
void taosCleanupCfg(); void taosCleanupCfg();
void taosCfgDynamicOptions(const char *option, const char *value); void taosCfgDynamicOptions(const char *option, const char *value);
void taosAddDataDir(int32_t index, char *v1, int32_t level, int32_t primary); void taosAddDataDir(int32_t index, char *v1, int32_t level, int32_t primary);
......
...@@ -254,12 +254,12 @@ void taos_init_imp(void) { ...@@ -254,12 +254,12 @@ void taos_init_imp(void) {
deltaToUtcInitOnce(); deltaToUtcInitOnce();
if (taosCreateLog("taoslog", 10, NULL, configDir, NULL, NULL, NULL, 1) != 0) { if (taosCreateLog("taoslog", 10, configDir, NULL, NULL, NULL, NULL, 1) != 0) {
tscInitRes = -1; tscInitRes = -1;
return; return;
} }
if (taosInitCfg(NULL, configDir, NULL, NULL, NULL, 1) != 0) { if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1) != 0) {
tscInitRes = -1; tscInitRes = -1;
return; return;
} }
......
...@@ -579,7 +579,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { ...@@ -579,7 +579,7 @@ static int32_t taosSetServerCfg(SConfig *pCfg) {
return 0; return 0;
} }
int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char **envCmd, const char *cfgDir, const char *envFile, int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDir, const char **envCmd, const char *envFile,
char *apolloUrl, SArray *pArgs, bool tsc) { char *apolloUrl, SArray *pArgs, bool tsc) {
osDefaultInit(); osDefaultInit();
...@@ -632,7 +632,7 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char **envC ...@@ -632,7 +632,7 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char **envC
return 0; return 0;
} }
int32_t taosInitCfg(const char **envCmd, const char *cfgDir, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc) { int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile, char *apolloUrl, SArray *pArgs, bool tsc) {
if (tsCfg != NULL) return 0; if (tsCfg != NULL) return 0;
tsCfg = cfgInit(); tsCfg = cfgInit();
......
...@@ -136,7 +136,7 @@ static SDnodeOpt dmGetOpt() { ...@@ -136,7 +136,7 @@ static SDnodeOpt dmGetOpt() {
static int32_t dmInitLog() { static int32_t dmInitLog() {
char logName[12] = {0}; char logName[12] = {0};
snprintf(logName, sizeof(logName), "%slog", dmLogName(global.ntype)); snprintf(logName, sizeof(logName), "%slog", dmLogName(global.ntype));
return taosCreateLog(logName, 1, global.envCmd, configDir, global.envFile, global.apolloUrl, global.pArgs, 0); return taosCreateLog(logName, 1, configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0);
} }
static void dmSetProcInfo(int32_t argc, char **argv) { static void dmSetProcInfo(int32_t argc, char **argv) {
...@@ -209,7 +209,7 @@ int main(int argc, char const *argv[]) { ...@@ -209,7 +209,7 @@ int main(int argc, char const *argv[]) {
return -1; return -1;
} }
if (taosInitCfg(global.envCmd, configDir, global.envFile, global.apolloUrl, global.pArgs, 0) != 0) { if (taosInitCfg(configDir, global.envCmd, global.envFile, global.apolloUrl, global.pArgs, 0) != 0) {
dError("failed to start since read config error"); dError("failed to start since read config error");
taosCleanupArgs(); taosCleanupArgs();
return -1; return -1;
......
...@@ -548,7 +548,7 @@ static int32_t udfdParseArgs(int32_t argc, char *argv[]) { ...@@ -548,7 +548,7 @@ static int32_t udfdParseArgs(int32_t argc, char *argv[]) {
static int32_t udfdInitLog() { static int32_t udfdInitLog() {
char logName[12] = {0}; char logName[12] = {0};
snprintf(logName, sizeof(logName), "%slog", "udfd"); snprintf(logName, sizeof(logName), "%slog", "udfd");
return taosCreateLog(logName, 1, NULL, configDir, NULL, NULL, NULL, 0); return taosCreateLog(logName, 1, configDir, NULL, NULL, NULL, NULL, 0);
} }
void udfdCtrlAllocBufCb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) { void udfdCtrlAllocBufCb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) {
...@@ -656,7 +656,7 @@ int main(int argc, char *argv[]) { ...@@ -656,7 +656,7 @@ int main(int argc, char *argv[]) {
return -1; return -1;
} }
if (taosInitCfg(NULL, configDir, NULL, NULL, NULL, 0) != 0) { if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 0) != 0) {
fnError("failed to start since read config error"); fnError("failed to start since read config error");
return -1; return -1;
} }
......
...@@ -31,13 +31,13 @@ static int32_t parseArgs(int32_t argc, char *argv[]) { ...@@ -31,13 +31,13 @@ static int32_t parseArgs(int32_t argc, char *argv[]) {
static int32_t initLog() { static int32_t initLog() {
char logName[12] = {0}; char logName[12] = {0};
snprintf(logName, sizeof(logName), "%slog", "udfc"); snprintf(logName, sizeof(logName), "%slog", "udfc");
return taosCreateLog(logName, 1, NULL, configDir, NULL, NULL, NULL, 0); return taosCreateLog(logName, 1, configDir, NULL, NULL, NULL, NULL, 0);
} }
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
parseArgs(argc, argv); parseArgs(argc, argv);
initLog(); initLog();
if (taosInitCfg(NULL, configDir, NULL, NULL, NULL, 0) != 0) { if (taosInitCfg(configDir, NULL, NULL, NULL, NULL, 0) != 0) {
fnError("failed to start since read config error"); fnError("failed to start since read config error");
return -1; return -1;
} }
......
...@@ -28,8 +28,8 @@ char simScriptDir[PATH_MAX] = {0}; ...@@ -28,8 +28,8 @@ char simScriptDir[PATH_MAX] = {0};
extern bool simExecSuccess; extern bool simExecSuccess;
int32_t simInitCfg() { int32_t simInitCfg() {
taosCreateLog("simlog", 1, NULL, configDir, NULL, NULL, NULL, 1); taosCreateLog("simlog", 1, configDir, NULL, NULL, NULL, NULL, 1);
taosInitCfg(NULL, configDir, NULL, NULL, NULL, 1); taosInitCfg(configDir, NULL, NULL, NULL, NULL, 1);
SConfig *pCfg = taosGetCfg(); SConfig *pCfg = taosGetCfg();
simDebugFlag = cfgGetItem(pCfg, "simDebugFlag")->i32; simDebugFlag = cfgGetItem(pCfg, "simDebugFlag")->i32;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册