Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4e573e41
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4e573e41
编写于
2月 23, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sim config
上级
42c100df
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
40 addition
and
76 deletion
+40
-76
include/os/osEnv.h
include/os/osEnv.h
+0
-2
include/util/tlog.h
include/util/tlog.h
+12
-15
source/client/src/clientCfg.c
source/client/src/clientCfg.c
+4
-7
source/common/src/tglobal.c
source/common/src/tglobal.c
+0
-9
source/dnode/mgmt/daemon/src/dmnCfg.c
source/dnode/mgmt/daemon/src/dmnCfg.c
+1
-1
source/libs/config/src/config.c
source/libs/config/src/config.c
+23
-39
source/os/src/osEnv.c
source/os/src/osEnv.c
+0
-3
未找到文件。
include/os/osEnv.h
浏览文件 @
4e573e41
...
...
@@ -22,8 +22,6 @@ extern "C" {
extern
char
tsOsName
[];
extern
char
tsDataDir
[];
extern
char
tsLogDir
[];
extern
char
tsScriptDir
[];
extern
char
configDir
[];
#ifdef __cplusplus
...
...
include/util/tlog.h
浏览文件 @
4e573e41
...
...
@@ -22,7 +22,8 @@
extern
"C"
{
#endif
// log
extern
char
tsLogDir
[];
extern
bool
tsLogInited
;
extern
bool
tsAsyncLog
;
extern
int32_t
tsNumOfLogLines
;
extern
int32_t
tsLogKeepDays
;
...
...
@@ -41,20 +42,21 @@ extern int32_t tsdbDebugFlag;
extern
int32_t
tqDebugFlag
;
extern
int32_t
fsDebugFlag
;
#define DEBUG_FATAL 1U
#define DEBUG_ERROR DEBUG_FATAL
#define DEBUG_WARN 2U
#define DEBUG_INFO DEBUG_WARN
#define DEBUG_DEBUG 4U
#define DEBUG_TRACE 8U
#define DEBUG_DUMP 16U
#define DEBUG_FATAL 1U
#define DEBUG_ERROR DEBUG_FATAL
#define DEBUG_WARN 2U
#define DEBUG_INFO DEBUG_WARN
#define DEBUG_DEBUG 4U
#define DEBUG_TRACE 8U
#define DEBUG_DUMP 16U
#define DEBUG_SCREEN 64U
#define DEBUG_FILE 128U
#define DEBUG_FILE
128U
int32_t
taosInitLog
(
const
char
*
logName
,
int32_t
maxFiles
);
void
taosCloseLog
();
void
taosResetLog
();
void
taosSetAllDebugFlag
(
int32_t
flag
);
void
taosDumpData
(
unsigned
char
*
msg
,
int32_t
len
);
void
taosPrintLog
(
const
char
*
flags
,
int32_t
dflag
,
const
char
*
format
,
...)
#ifdef __GNUC__
...
...
@@ -68,11 +70,6 @@ void taosPrintLongString(const char *flags, int32_t dflag, const char *format, .
#endif
;
void
taosDumpData
(
unsigned
char
*
msg
,
int32_t
len
);
void
taosSetAllDebugFlag
(
int32_t
flag
);
#ifdef __cplusplus
}
#endif
...
...
source/client/src/clientCfg.c
浏览文件 @
4e573e41
...
...
@@ -83,6 +83,8 @@ static int32_t tscSetLogCfg(SConfig *pCfg) {
}
int32_t
tscInitLog
(
const
char
*
cfgDir
,
const
char
*
envFile
,
const
char
*
apolloUrl
)
{
if
(
tsLogInited
)
return
0
;
SConfig
*
pCfg
=
cfgInit
();
if
(
pCfg
==
NULL
)
return
-
1
;
...
...
@@ -111,6 +113,7 @@ int32_t tscInitLog(const char *cfgDir, const char *envFile, const char *apolloUr
return
-
1
;
}
cfgDumpCfg
(
pCfg
);
cfgCleanup
(
pCfg
);
return
0
;
}
...
...
@@ -151,7 +154,7 @@ static int32_t tscAddCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"numOfCores"
,
1
,
1
,
100000
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"numOfCommitThreads"
,
4
,
1
,
1000
)
!=
0
)
return
-
1
;
// if (cfgAddBool(pCfg, "telemetryReporting", 0) != 0) return -1;
//
if (cfgAddBool(pCfg, "enableCoreFile", 0) != 0) return -1;
if
(
cfgAddBool
(
pCfg
,
"enableCoreFile"
,
0
)
!=
0
)
return
-
1
;
// if (cfgAddInt32(pCfg, "supportVnodes", 256, 0, 65536) != 0) return -1;
if
(
cfgAddInt32
(
pCfg
,
"statusInterval"
,
1
,
1
,
30
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"numOfThreadsPerCore"
,
1
,
0
,
10
)
!=
0
)
return
-
1
;
...
...
@@ -174,12 +177,6 @@ SConfig *tscInitCfgImp(const char *cfgDir, const char *envFile, const char *apol
SConfig
*
pCfg
=
cfgInit
();
if
(
pCfg
==
NULL
)
return
NULL
;
if
(
tscAddLogCfg
(
pCfg
)
!=
0
)
{
uError
(
"failed to add log cfg since %s"
,
terrstr
());
cfgCleanup
(
pCfg
);
return
NULL
;
}
if
(
tscAddCfg
(
pCfg
)
!=
0
)
{
uError
(
"failed to init tsc cfg since %s"
,
terrstr
());
cfgCleanup
(
pCfg
);
...
...
source/common/src/tglobal.c
浏览文件 @
4e573e41
...
...
@@ -280,15 +280,6 @@ static void doInitGlobalConfig(void) {
#if 0
SGlobalCfg cfg = {0};
cfg.option = "scriptDir";
cfg.ptr = tsScriptDir;
cfg.valType = TAOS_CFG_VTYPE_DIRECTORY;
cfg.cfgType = TSDB_CFG_CTYPE_B_CONFIG | TSDB_CFG_CTYPE_B_CLIENT;
cfg.minValue = 0;
cfg.maxValue = 0;
cfg.ptrLength = TSDB_FILENAME_LEN;
cfg.unitType = TAOS_CFG_UTYPE_NONE;
taosAddConfigOption(cfg);
cfg.option = "dataDir";
cfg.ptr = tsDataDir;
...
...
source/dnode/mgmt/daemon/src/dmnCfg.c
浏览文件 @
4e573e41
...
...
@@ -202,7 +202,7 @@ SDnodeObjCfg dmnGetObjCfg(SConfig *pCfg) {
tstrncpy
(
objCfg
.
firstEp
,
cfgGetItem
(
pCfg
,
"firstEp"
)
->
str
,
sizeof
(
objCfg
.
firstEp
));
tstrncpy
(
objCfg
.
secondEp
,
cfgGetItem
(
pCfg
,
"secondEp"
)
->
str
,
sizeof
(
objCfg
.
firstEp
));
objCfg
.
serverPort
=
(
uint16_t
)
cfgGetItem
(
pCfg
,
"serverPort"
)
->
i32
;
tstrncpy
(
objCfg
.
localFqdn
,
cfgGetItem
(
pCfg
,
"fqdn"
)
->
str
,
sizeof
(
objCfg
.
localFqdn
,
cfgGetItem
));
tstrncpy
(
objCfg
.
localFqdn
,
cfgGetItem
(
pCfg
,
"fqdn"
)
->
str
,
sizeof
(
objCfg
.
localFqdn
));
snprintf
(
objCfg
.
localEp
,
sizeof
(
objCfg
.
localEp
),
"%s:%u"
,
objCfg
.
localFqdn
,
objCfg
.
serverPort
);
return
objCfg
;
}
\ No newline at end of file
source/libs/config/src/config.c
浏览文件 @
4e573e41
...
...
@@ -15,11 +15,14 @@
#define _DEFAULT_SOURCE
#include "cfgInt.h"
#include "tmsg.h"
#include "tep.h"
#include "tlocale.h"
#include "tmsg.h"
#include "ttimezone.h"
#define CFG_NAME_PRINT_LEN 22
#define CFG_SRC_PRINT_LEN 12
SConfig
*
cfgInit
()
{
SConfig
*
pCfg
=
calloc
(
1
,
sizeof
(
SConfig
));
if
(
pCfg
==
NULL
)
{
...
...
@@ -505,56 +508,37 @@ const char *cfgDtypeStr(ECfgDataType type) {
}
}
void
cfgPrintCfg
(
SConfig
*
pCfg
)
{
uInfo
(
"taos global config"
);
uInfo
(
"=================================="
);
void
cfgDumpCfg
(
SConfig
*
pCfg
)
{
uInfo
(
" global config"
);
uInfo
(
"================================================================="
);
char
src
[
CFG_SRC_PRINT_LEN
+
1
]
=
{
0
};
char
name
[
CFG_NAME_PRINT_LEN
+
1
]
=
{
0
};
SConfigItem
*
pItem
=
cfgIterate
(
pCfg
,
NULL
);
while
(
pItem
!=
NULL
)
{
switch
(
pItem
->
dtype
)
{
case
CFG_DTYPE_BOOL
:
uInfo
(
"cfg:%s, value:%u src:%s"
,
pItem
->
name
,
pItem
->
bval
,
cfgStypeStr
(
pItem
->
stype
));
break
;
case
CFG_DTYPE_INT32
:
uInfo
(
"cfg:%s, value:%d src:%s"
,
pItem
->
name
,
pItem
->
i32
,
cfgStypeStr
(
pItem
->
stype
));
break
;
case
CFG_DTYPE_INT64
:
uInfo
(
"cfg:%s, value:%"
PRId64
" src:%s"
,
pItem
->
name
,
pItem
->
i64
,
cfgStypeStr
(
pItem
->
stype
));
break
;
case
CFG_DTYPE_FLOAT
:
uInfo
(
"cfg:%s, value:%f src:%s"
,
pItem
->
name
,
pItem
->
fval
,
cfgStypeStr
(
pItem
->
stype
));
break
;
case
CFG_DTYPE_STRING
:
case
CFG_DTYPE_IPSTR
:
case
CFG_DTYPE_DIR
:
case
CFG_DTYPE_LOCALE
:
case
CFG_DTYPE_CHARSET
:
case
CFG_DTYPE_TIMEZONE
:
uInfo
(
"cfg:%s, value:%s src:%s"
,
pItem
->
name
,
pItem
->
str
,
cfgStypeStr
(
pItem
->
stype
));
break
;
tstrncpy
(
src
,
cfgStypeStr
(
pItem
->
stype
),
CFG_SRC_PRINT_LEN
);
for
(
int32_t
i
=
0
;
i
<
CFG_SRC_PRINT_LEN
;
++
i
)
{
if
(
src
[
i
]
==
0
)
src
[
i
]
=
' '
;
}
pItem
=
cfgIterate
(
pCfg
,
pItem
);
}
}
void
cfgDumpCfg
(
SConfig
*
pCfg
)
{
uInfo
(
"global config"
);
uInfo
(
"=================================="
);
tstrncpy
(
name
,
pItem
->
name
,
CFG_NAME_PRINT_LEN
);
for
(
int32_t
i
=
0
;
i
<
CFG_NAME_PRINT_LEN
;
++
i
)
{
if
(
name
[
i
]
==
0
)
name
[
i
]
=
' '
;
}
SConfigItem
*
pItem
=
cfgIterate
(
pCfg
,
NULL
);
while
(
pItem
!=
NULL
)
{
switch
(
pItem
->
dtype
)
{
case
CFG_DTYPE_BOOL
:
uInfo
(
"
cfg:%s, value:%u src:%s"
,
pItem
->
name
,
pItem
->
bval
,
cfgStypeStr
(
pItem
->
stype
)
);
uInfo
(
"
%s %s %u"
,
src
,
name
,
pItem
->
bval
);
break
;
case
CFG_DTYPE_INT32
:
uInfo
(
"
cfg:%s, value:%d src:%s"
,
pItem
->
name
,
pItem
->
i32
,
cfgStypeStr
(
pItem
->
stype
)
);
uInfo
(
"
%s %s %d"
,
src
,
name
,
pItem
->
i32
);
break
;
case
CFG_DTYPE_INT64
:
uInfo
(
"
cfg:%s, value:%"
PRId64
" src:%s"
,
pItem
->
name
,
pItem
->
i64
,
cfgStypeStr
(
pItem
->
stype
)
);
uInfo
(
"
%s %s %"
PRId64
,
src
,
name
,
pItem
->
i64
);
break
;
case
CFG_DTYPE_FLOAT
:
uInfo
(
"
cfg:%s, value:%f src:%s"
,
pItem
->
name
,
pItem
->
fval
,
cfgStypeStr
(
pItem
->
stype
)
);
uInfo
(
"
%s %s %f"
,
src
,
name
,
pItem
->
fval
);
break
;
case
CFG_DTYPE_STRING
:
case
CFG_DTYPE_IPSTR
:
...
...
@@ -562,13 +546,13 @@ void cfgDumpCfg(SConfig *pCfg) {
case
CFG_DTYPE_LOCALE
:
case
CFG_DTYPE_CHARSET
:
case
CFG_DTYPE_TIMEZONE
:
uInfo
(
"
cfg:%s, value:%s src:%s"
,
pItem
->
name
,
pItem
->
str
,
cfgStypeStr
(
pItem
->
stype
)
);
uInfo
(
"
%s %s %s"
,
src
,
name
,
pItem
->
str
);
break
;
}
pItem
=
cfgIterate
(
pCfg
,
pItem
);
}
uInfo
(
"=================================="
);
uInfo
(
"==================================
===============================
"
);
}
#if 0
// int32_t cfgCheck(SConfig *pCfg) {
...
...
source/os/src/osEnv.c
浏览文件 @
4e573e41
...
...
@@ -23,7 +23,6 @@ char tsOsName[10] = "Windows";
char
configDir
[
PATH_MAX
]
=
"C:/TDengine/cfg"
;
char
tsDataDir
[
PATH_MAX
]
=
"C:/TDengine/data"
;
char
tsLogDir
[
PATH_MAX
]
=
"C:/TDengine/log"
;
char
tsScriptDir
[
PATH_MAX
]
=
"C:/TDengine/script"
;
char
tsTempDir
[
PATH_MAX
]
=
"C:
\\
Windows
\\
Temp"
;
extern
taosWinSocketInit
();
...
...
@@ -47,7 +46,6 @@ char tsOsName[10] = "Darwin";
char
configDir
[
PATH_MAX
]
=
"/usr/local/etc/taos"
;
char
tsDataDir
[
PATH_MAX
]
=
"/usr/local/var/lib/taos"
;
char
tsLogDir
[
PATH_MAX
]
=
"/usr/local/var/log/taos"
;
char
tsScriptDir
[
PATH_MAX
]
=
"/usr/local/etc/taos"
;
char
tsTempDir
[
PATH_MAX
]
=
"/tmp/taosd"
;
void
osInit
()
{}
...
...
@@ -58,7 +56,6 @@ char tsOsName[10] = "Linux";
char
configDir
[
PATH_MAX
]
=
"/etc/taos"
;
char
tsDataDir
[
PATH_MAX
]
=
"/var/lib/taos"
;
char
tsLogDir
[
PATH_MAX
]
=
"/var/log/taos"
;
char
tsScriptDir
[
PATH_MAX
]
=
"/etc/taos"
;
char
tsTempDir
[
PATH_MAX
]
=
"/tmp/"
;
void
osInit
()
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录