Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
69728a99
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看板
提交
69728a99
编写于
5月 16, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: make more object global
上级
34fd89aa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
8 deletion
+11
-8
include/common/tglobal.h
include/common/tglobal.h
+1
-0
source/common/src/tglobal.c
source/common/src/tglobal.c
+3
-1
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
+3
-3
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
+4
-4
未找到文件。
include/common/tglobal.h
浏览文件 @
69728a99
...
@@ -32,6 +32,7 @@ extern char tsLocalEp[];
...
@@ -32,6 +32,7 @@ extern char tsLocalEp[];
extern
uint16_t
tsServerPort
;
extern
uint16_t
tsServerPort
;
extern
int32_t
tsVersion
;
extern
int32_t
tsVersion
;
extern
int32_t
tsStatusInterval
;
extern
int32_t
tsStatusInterval
;
extern
int32_t
tsNumOfSupportVnodes
;
// common
// common
extern
int32_t
tsMaxShellConns
;
extern
int32_t
tsMaxShellConns
;
...
...
source/common/src/tglobal.c
浏览文件 @
69728a99
...
@@ -30,6 +30,7 @@ char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port
...
@@ -30,6 +30,7 @@ char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port
uint16_t
tsServerPort
=
6030
;
uint16_t
tsServerPort
=
6030
;
int32_t
tsVersion
=
30000000
;
int32_t
tsVersion
=
30000000
;
int32_t
tsStatusInterval
=
1
;
// second
int32_t
tsStatusInterval
=
1
;
// second
int32_t
tsNumOfSupportVnodes
=
256
;
// common
// common
int32_t
tsMaxShellConns
=
50000
;
int32_t
tsMaxShellConns
=
50000
;
...
@@ -355,7 +356,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) {
...
@@ -355,7 +356,7 @@ static int32_t taosAddSystemCfg(SConfig *pCfg) {
static
int32_t
taosAddServerCfg
(
SConfig
*
pCfg
)
{
static
int32_t
taosAddServerCfg
(
SConfig
*
pCfg
)
{
if
(
cfgAddDir
(
pCfg
,
"dataDir"
,
tsDataDir
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddDir
(
pCfg
,
"dataDir"
,
tsDataDir
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"minimalDataDirGB"
,
2
.
0
f
,
0
.
001
f
,
10000000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddFloat
(
pCfg
,
"minimalDataDirGB"
,
2
.
0
f
,
0
.
001
f
,
10000000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"supportVnodes"
,
256
,
0
,
4096
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"supportVnodes"
,
tsNumOfSupportVnodes
,
0
,
4096
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxShellConns"
,
tsMaxShellConns
,
10
,
50000000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxShellConns"
,
tsMaxShellConns
,
10
,
50000000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"statusInterval"
,
tsStatusInterval
,
1
,
30
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"statusInterval"
,
tsStatusInterval
,
1
,
30
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"minSlidingTime"
,
tsMinSlidingTime
,
10
,
1000000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"minSlidingTime"
,
tsMinSlidingTime
,
10
,
1000000
,
0
)
!=
0
)
return
-
1
;
...
@@ -541,6 +542,7 @@ static void taosSetSystemCfg(SConfig *pCfg) {
...
@@ -541,6 +542,7 @@ static void taosSetSystemCfg(SConfig *pCfg) {
static
int32_t
taosSetServerCfg
(
SConfig
*
pCfg
)
{
static
int32_t
taosSetServerCfg
(
SConfig
*
pCfg
)
{
tsDataSpace
.
reserved
=
cfgGetItem
(
pCfg
,
"minimalDataDirGB"
)
->
fval
;
tsDataSpace
.
reserved
=
cfgGetItem
(
pCfg
,
"minimalDataDirGB"
)
->
fval
;
tsNumOfSupportVnodes
=
cfgGetItem
(
pCfg
,
"supportVnodes"
)
->
i32
;
tsMaxShellConns
=
cfgGetItem
(
pCfg
,
"maxShellConns"
)
->
i32
;
tsMaxShellConns
=
cfgGetItem
(
pCfg
,
"maxShellConns"
)
->
i32
;
tsStatusInterval
=
cfgGetItem
(
pCfg
,
"statusInterval"
)
->
i32
;
tsStatusInterval
=
cfgGetItem
(
pCfg
,
"statusInterval"
)
->
i32
;
tsMinSlidingTime
=
cfgGetItem
(
pCfg
,
"minSlidingTime"
)
->
i32
;
tsMinSlidingTime
=
cfgGetItem
(
pCfg
,
"minSlidingTime"
)
->
i32
;
...
...
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
浏览文件 @
69728a99
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
static
bool
mmDeployRequired
(
const
SMgmtInputOpt
*
pInput
)
{
static
bool
mmDeployRequired
(
const
SMgmtInputOpt
*
pInput
)
{
if
(
pInput
->
pData
->
dnodeId
>
0
)
return
false
;
if
(
pInput
->
pData
->
dnodeId
>
0
)
return
false
;
if
(
pInput
->
pData
->
clusterId
>
0
)
return
false
;
if
(
pInput
->
pData
->
clusterId
>
0
)
return
false
;
if
(
strcmp
(
pInput
->
pData
->
localEp
,
pInput
->
pData
->
firstEp
)
!=
0
)
return
false
;
if
(
strcmp
(
tsLocalEp
,
tsFirst
)
!=
0
)
return
false
;
return
true
;
return
true
;
}
}
...
@@ -44,8 +44,8 @@ static void mmBuildOptionForDeploy(SMnodeMgmt *pMgmt, const SMgmtInputOpt *pInpu
...
@@ -44,8 +44,8 @@ static void mmBuildOptionForDeploy(SMnodeMgmt *pMgmt, const SMgmtInputOpt *pInpu
pOption
->
selfIndex
=
0
;
pOption
->
selfIndex
=
0
;
SReplica
*
pReplica
=
&
pOption
->
replicas
[
0
];
SReplica
*
pReplica
=
&
pOption
->
replicas
[
0
];
pReplica
->
id
=
1
;
pReplica
->
id
=
1
;
pReplica
->
port
=
pInput
->
pData
->
s
erverPort
;
pReplica
->
port
=
tsS
erverPort
;
tstrncpy
(
pReplica
->
fqdn
,
pInput
->
pData
->
l
ocalFqdn
,
TSDB_FQDN_LEN
);
tstrncpy
(
pReplica
->
fqdn
,
tsL
ocalFqdn
,
TSDB_FQDN_LEN
);
pOption
->
deploy
=
true
;
pOption
->
deploy
=
true
;
pMgmt
->
selfIndex
=
pOption
->
selfIndex
;
pMgmt
->
selfIndex
=
pOption
->
selfIndex
;
...
...
source/dnode/mgmt/mgmt_vnode/src/vmInt.c
浏览文件 @
69728a99
...
@@ -262,11 +262,11 @@ static int32_t vmInit(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
...
@@ -262,11 +262,11 @@ static int32_t vmInit(SMgmtInputOpt *pInput, SMgmtOutputOpt *pOutput) {
taosInitRWLatch
(
&
pMgmt
->
latch
);
taosInitRWLatch
(
&
pMgmt
->
latch
);
SDiskCfg
dCfg
=
{
0
};
SDiskCfg
dCfg
=
{
0
};
tstrncpy
(
dCfg
.
dir
,
pInput
->
pData
->
d
ataDir
,
TSDB_FILENAME_LEN
);
tstrncpy
(
dCfg
.
dir
,
tsD
ataDir
,
TSDB_FILENAME_LEN
);
dCfg
.
level
=
0
;
dCfg
.
level
=
0
;
dCfg
.
primary
=
1
;
dCfg
.
primary
=
1
;
SDiskCfg
*
pDisks
=
pInput
->
pData
->
disks
;
SDiskCfg
*
pDisks
=
tsDiskCfg
;
int32_t
numOfDisks
=
pInput
->
pData
->
numOfDisks
;
int32_t
numOfDisks
=
tsDiskCfgNum
;
if
(
numOfDisks
<=
0
||
pDisks
==
NULL
)
{
if
(
numOfDisks
<=
0
||
pDisks
==
NULL
)
{
pDisks
=
&
dCfg
;
pDisks
=
&
dCfg
;
numOfDisks
=
1
;
numOfDisks
=
1
;
...
@@ -328,7 +328,7 @@ _OVER:
...
@@ -328,7 +328,7 @@ _OVER:
}
}
static
int32_t
vmRequire
(
const
SMgmtInputOpt
*
pInput
,
bool
*
required
)
{
static
int32_t
vmRequire
(
const
SMgmtInputOpt
*
pInput
,
bool
*
required
)
{
*
required
=
pInput
->
pData
->
s
upportVnodes
>
0
;
*
required
=
tsNumOfS
upportVnodes
>
0
;
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录