Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
225602af
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看板
提交
225602af
编写于
3月 18, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
a6e7e128
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
28 addition
and
31 deletion
+28
-31
source/dnode/mgmt/bnode/src/bmInt.c
source/dnode/mgmt/bnode/src/bmInt.c
+1
-9
source/dnode/mgmt/container/inc/dnd.h
source/dnode/mgmt/container/inc/dnd.h
+1
-1
source/dnode/mgmt/container/src/dndExec.c
source/dnode/mgmt/container/src/dndExec.c
+2
-1
source/dnode/mgmt/container/src/dndFile.c
source/dnode/mgmt/container/src/dndFile.c
+5
-5
source/dnode/mgmt/dnode/src/dmInt.c
source/dnode/mgmt/dnode/src/dmInt.c
+4
-1
source/dnode/mgmt/mnode/src/mmInt.c
source/dnode/mgmt/mnode/src/mmInt.c
+8
-7
source/dnode/mgmt/qnode/src/qmInt.c
source/dnode/mgmt/qnode/src/qmInt.c
+2
-2
source/dnode/mgmt/snode/src/smInt.c
source/dnode/mgmt/snode/src/smInt.c
+2
-3
source/dnode/mgmt/vnode/src/vmInt.c
source/dnode/mgmt/vnode/src/vmInt.c
+3
-2
未找到文件。
source/dnode/mgmt/bnode/src/bmInt.c
浏览文件 @
225602af
...
...
@@ -16,15 +16,7 @@
#define _DEFAULT_SOURCE
#include "bmInt.h"
static
bool
bmRequire
(
SMgmtWrapper
*
pWrapper
)
{
SBnodeMgmt
mgmt
=
{
0
};
mgmt
.
path
=
pWrapper
->
path
;
bool
deployed
=
false
;
(
void
)
dndReadFile
(
pWrapper
,
&
deployed
);
return
deployed
;
}
static
int32_t
bmRequire
(
SMgmtWrapper
*
pWrapper
,
bool
*
required
)
{
return
dndReadFile
(
pWrapper
,
required
);
}
static
void
bmInitOption
(
SBnodeMgmt
*
pMgmt
,
SBnodeOpt
*
pOption
)
{
SDnode
*
pDnode
=
pMgmt
->
pDnode
;
...
...
source/dnode/mgmt/container/inc/dnd.h
浏览文件 @
225602af
...
...
@@ -76,7 +76,7 @@ typedef int32_t (*OpenNodeFp)(SMgmtWrapper *pWrapper);
typedef
void
(
*
CloseNodeFp
)(
SMgmtWrapper
*
pWrapper
);
typedef
int32_t
(
*
CreateNodeFp
)(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
typedef
int32_t
(
*
DropNodeFp
)(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
typedef
bool
(
*
RequireNodeFp
)(
SMgmtWrapper
*
pWrapper
);
typedef
int32_t
(
*
RequireNodeFp
)(
SMgmtWrapper
*
pWrapper
,
bool
*
required
);
typedef
struct
{
EWorkerType
type
;
...
...
source/dnode/mgmt/container/src/dndExec.c
浏览文件 @
225602af
...
...
@@ -26,7 +26,8 @@ static void dndResetLog(SMgmtWrapper *pMgmt) {
}
static
bool
dndRequireNode
(
SMgmtWrapper
*
pWrapper
)
{
bool
required
=
(
*
pWrapper
->
fp
.
requiredFp
)(
pWrapper
);
bool
required
=
false
;
int32_t
code
=
(
*
pWrapper
->
fp
.
requiredFp
)(
pWrapper
,
&
required
);
if
(
!
required
)
{
dDebug
(
"node:%s, no need to start"
,
pWrapper
->
name
);
}
else
{
...
...
source/dnode/mgmt/container/src/dndFile.c
浏览文件 @
225602af
...
...
@@ -30,33 +30,33 @@ int32_t dndReadFile(SMgmtWrapper *pWrapper, bool *pDeployed) {
if
(
pFile
==
NULL
)
{
dDebug
(
"file %s not exist"
,
file
);
code
=
0
;
goto
PRASE_BNODE
_OVER
;
goto
_OVER
;
}
len
=
(
int32_t
)
taosReadFile
(
pFile
,
content
,
maxLen
);
if
(
len
<=
0
)
{
dError
(
"failed to read %s since content is null"
,
file
);
goto
PRASE_BNODE
_OVER
;
goto
_OVER
;
}
content
[
len
]
=
0
;
root
=
cJSON_Parse
(
content
);
if
(
root
==
NULL
)
{
dError
(
"failed to read %s since invalid json format"
,
file
);
goto
PRASE_BNODE
_OVER
;
goto
_OVER
;
}
cJSON
*
deployed
=
cJSON_GetObjectItem
(
root
,
"deployed"
);
if
(
!
deployed
||
deployed
->
type
!=
cJSON_Number
)
{
dError
(
"failed to read %s since deployed not found"
,
file
);
goto
PRASE_BNODE
_OVER
;
goto
_OVER
;
}
*
pDeployed
=
deployed
->
valueint
!=
0
;
code
=
0
;
dDebug
(
"succcessed to read file %s, deployed:%d"
,
file
,
*
pDeployed
);
PRASE_BNODE
_OVER:
_OVER:
if
(
content
!=
NULL
)
free
(
content
);
if
(
root
!=
NULL
)
cJSON_Delete
(
root
);
if
(
pFile
!=
NULL
)
taosCloseFile
(
&
pFile
);
...
...
source/dnode/mgmt/dnode/src/dmInt.c
浏览文件 @
225602af
...
...
@@ -136,7 +136,10 @@ void dmCleanup(SMgmtWrapper *pWrapper) {
dInfo
(
"dnode-mgmt is cleaned up"
);
}
bool
dmRequire
(
SMgmtWrapper
*
pWrapper
)
{
return
true
;
}
int32_t
dmRequire
(
SMgmtWrapper
*
pWrapper
,
bool
*
required
)
{
*
required
=
true
;
return
0
;
}
void
dmGetMgmtFp
(
SMgmtWrapper
*
pWrapper
)
{
SMgmtFp
mgmtFp
=
{
0
};
...
...
source/dnode/mgmt/mnode/src/mmInt.c
浏览文件 @
225602af
...
...
@@ -277,30 +277,31 @@ static bool mmDeployRequired(SDnode *pDnode) {
return
true
;
}
static
bool
mmRequire
(
SMgmtWrapper
*
pWrapper
)
{
static
int32_t
mmRequire
(
SMgmtWrapper
*
pWrapper
,
bool
*
required
)
{
SMnodeMgmt
mgmt
=
{
0
};
mgmt
.
path
=
pWrapper
->
path
;
if
(
mmReadFile
(
&
mgmt
)
!=
0
)
{
return
false
;
return
-
1
;
}
if
(
mgmt
.
dropped
)
{
dInfo
(
"mnode has been dropped and needs to be deleted"
);
mndDestroy
(
mgmt
.
path
);
return
false
;
return
-
1
;
}
if
(
mgmt
.
deployed
)
{
*
required
=
true
;
dInfo
(
"mnode has been deployed"
);
return
true
;
return
0
;
}
bool
required
=
mmDeployRequired
(
pWrapper
->
pDnode
);
if
(
required
)
{
*
required
=
mmDeployRequired
(
pWrapper
->
pDnode
);
if
(
*
required
)
{
dInfo
(
"mnode need to be deployed"
);
}
return
required
;
return
0
;
}
void
mmGetMgmtFp
(
SMgmtWrapper
*
pWrapper
)
{
...
...
source/dnode/mgmt/qnode/src/qmInt.c
浏览文件 @
225602af
...
...
@@ -16,13 +16,13 @@
#define _DEFAULT_SOURCE
#include "qmInt.h"
bool
qmRequireNode
(
SMgmtWrapper
*
pWrapper
)
{
return
false
;
}
static
int32_t
qmRequire
(
SMgmtWrapper
*
pWrapper
,
bool
*
required
)
{
return
dndReadFile
(
pWrapper
,
required
)
;
}
void
qmGetMgmtFp
(
SMgmtWrapper
*
pWrapper
)
{
SMgmtFp
mgmtFp
=
{
0
};
mgmtFp
.
openFp
=
NULL
;
mgmtFp
.
closeFp
=
NULL
;
mgmtFp
.
requiredFp
=
qmRequire
Node
;
mgmtFp
.
requiredFp
=
qmRequire
;
// qmInitMsgHandles(pWrapper);
pWrapper
->
name
=
"qnode"
;
...
...
source/dnode/mgmt/snode/src/smInt.c
浏览文件 @
225602af
...
...
@@ -16,14 +16,13 @@
#define _DEFAULT_SOURCE
#include "smInt.h"
bool
smRequireNode
(
SMgmtWrapper
*
pWrapper
)
{
return
false
;
}
static
int32_t
smRequire
(
SMgmtWrapper
*
pWrapper
,
bool
*
required
)
{
return
dndReadFile
(
pWrapper
,
required
);
}
void
smGetMgmtFp
(
SMgmtWrapper
*
pWrapper
)
{
SMgmtFp
mgmtFp
=
{
0
};
mgmtFp
.
openFp
=
NULL
;
mgmtFp
.
closeFp
=
NULL
;
mgmtFp
.
requiredFp
=
smRequire
Node
;
mgmtFp
.
requiredFp
=
smRequire
;
// smInitMsgHandles(pWrapper);
pWrapper
->
name
=
"snode"
;
...
...
source/dnode/mgmt/vnode/src/vmInt.c
浏览文件 @
225602af
...
...
@@ -324,9 +324,10 @@ _OVER:
return
0
;
}
static
bool
vmRequire
(
SMgmtWrapper
*
pWrapper
)
{
static
int32_t
vmRequire
(
SMgmtWrapper
*
pWrapper
,
bool
*
required
)
{
SDnode
*
pDnode
=
pWrapper
->
pDnode
;
return
pDnode
->
numOfSupportVnodes
>
0
;
*
required
=
pDnode
->
numOfSupportVnodes
>
0
;
return
0
;
}
void
vmGetMgmtFp
(
SMgmtWrapper
*
pWrapper
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录