Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
36086393
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
36086393
编写于
3月 14, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
c8a4d491
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
60 addition
and
41 deletion
+60
-41
source/dnode/mgmt/dnode/inc/dmInt.h
source/dnode/mgmt/dnode/inc/dmInt.h
+6
-6
source/dnode/mgmt/dnode/inc/dmMgmt.h
source/dnode/mgmt/dnode/inc/dmMgmt.h
+3
-5
source/dnode/mgmt/dnode/src/dmInt.c
source/dnode/mgmt/dnode/src/dmInt.c
+48
-0
source/dnode/mgmt/dnode/src/dmMgmt.c
source/dnode/mgmt/dnode/src/dmMgmt.c
+3
-30
未找到文件。
source/dnode/mgmt/dnode/inc/dmInt.h
浏览文件 @
36086393
...
...
@@ -41,17 +41,17 @@ typedef struct SDnodeMgmt {
SDnode
*
pDnode
;
}
SDnodeMgmt
;
// dmFile.h
void
dmGetMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
);
// dmHandle.h
void
dmProcessStartupReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
// dmInt.h
SMgmtFp
dmGetMgmtFp
();
int32_t
dmGetDnodeId
(
SDnode
*
pDnode
);
int64_t
dmGetClusterId
(
SDnode
*
pDnode
);
// dmMgmt.h
void
dmGetMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
);
// dmHandle.h
void
dmProcessStartupReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pMsg
);
#ifdef __cplusplus
}
#endif
...
...
source/dnode/mgmt/dnode/inc/dmMgmt.h
浏览文件 @
36086393
...
...
@@ -22,12 +22,10 @@
extern
"C"
{
#endif
int32_t
dmInit
Mgmt
(
SDnode
*
pDnode
);
void
dm
StopMgmt
(
SDnode
*
pDnode
);
void
dmCleanupMgmt
(
SDnode
*
pDnode
);
int32_t
dmInit
(
SMgmtWrapper
*
pWrapper
);
void
dm
Cleanup
(
SMgmtWrapper
*
pWrapper
);
bool
dmRequire
(
SMgmtWrapper
*
pWrapper
);
int32_t
dmGetDnodeId
(
SDnode
*
pDnode
);
int64_t
dmGetClusterId
(
SDnode
*
pDnode
);
void
dmGetDnodeEp
(
SDnode
*
pDnode
,
int32_t
dnodeId
,
char
*
pEp
,
char
*
pFqdn
,
uint16_t
*
pPort
);
void
dmGetMnodeEpSet
(
SDnode
*
pDnode
,
SEpSet
*
pEpSet
);
...
...
source/dnode/mgmt/dnode/src/dmInt.c
浏览文件 @
36086393
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http:www.gnu.org/licenses/>.
*/
#define _DEFAULT_SOURCE
#include "dmInt.h"
#include "dmHandle.h"
#include "dmMgmt.h"
int32_t
dmGetDnodeId
(
SDnode
*
pDnode
)
{
SMgmtWrapper
*
pWrapper
=
dndGetWrapper
(
pDnode
,
DNODE
);
SDnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
taosRLockLatch
(
&
pMgmt
->
latch
);
int32_t
dnodeId
=
pMgmt
->
dnodeId
;
taosRUnLockLatch
(
&
pMgmt
->
latch
);
return
dnodeId
;
}
int64_t
dmGetClusterId
(
SDnode
*
pDnode
)
{
SMgmtWrapper
*
pWrapper
=
dndGetWrapper
(
pDnode
,
DNODE
);
SDnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
taosRLockLatch
(
&
pMgmt
->
latch
);
int64_t
clusterId
=
pMgmt
->
clusterId
;
taosRUnLockLatch
(
&
pMgmt
->
latch
);
return
clusterId
;
}
SMgmtFp
dmGetMgmtFp
()
{
SMgmtFp
mgmtFp
=
{
0
};
mgmtFp
.
openFp
=
dmInit
;
mgmtFp
.
closeFp
=
dmCleanup
;
mgmtFp
.
requiredFp
=
dmRequire
;
mgmtFp
.
getMsgHandleFp
=
dmGetMsgHandle
;
return
mgmtFp
;
}
source/dnode/mgmt/dnode/src/dmMgmt.c
浏览文件 @
36086393
...
...
@@ -38,22 +38,6 @@ static void dndProcessStatusRsp(SDnode *pDnode, SRpcMsg *pRsp);
static void dndProcessAuthRsp(SDnode *pDnode, SRpcMsg *pRsp);
static void dndProcessGrantRsp(SDnode *pDnode, SRpcMsg *pRsp);
int32_t dmGetDnodeId(SDnode *pDnode) {
SDnodeMgmt *pMgmt = &pDnode->dmgmt;
taosRLockLatch(&pMgmt->latch);
int32_t dnodeId = pMgmt->dnodeId;
taosRUnLockLatch(&pMgmt->latch);
return dnodeId;
}
int64_t dmGetClusterId(SDnode *pDnode) {
SDnodeMgmt *pMgmt = &pDnode->dmgmt;
taosRLockLatch(&pMgmt->latch);
int64_t clusterId = pMgmt->clusterId;
taosRUnLockLatch(&pMgmt->latch);
return clusterId;
}
void dmGetDnodeEp(SDnode *pDnode, int32_t dnodeId, char *pEp, char *pFqdn, uint16_t *pPort) {
SDnodeMgmt *pMgmt = &pDnode->dmgmt;
taosRLockLatch(&pMgmt->latch);
...
...
@@ -289,7 +273,7 @@ void dmGetMnodeEpSet(SDnode *pDnode, SEpSet *pEpSet) {}
void
dmProcessStartupReq
(
SDnode
*
pDnode
,
SRpcMsg
*
pReq
){}
void
dmProcessMgmtMsg
(
SDnode
*
pDnode
,
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
){}
static
int32_t
dmInit
(
SMgmtWrapper
*
pWrapper
)
{
int32_t
dmInit
(
SMgmtWrapper
*
pWrapper
)
{
SDnodeMgmt
*
pMgmt
=
calloc
(
1
,
sizeof
(
SDnodeMgmt
));
pMgmt
->
dnodeId
=
0
;
...
...
@@ -352,17 +336,6 @@ static int32_t dmInit(SMgmtWrapper *pWrapper) {
#endif
}
static
void
dmCleanup
(
SMgmtWrapper
*
pWrapper
){
void
dmCleanup
(
SMgmtWrapper
*
pWrapper
)
{}
}
static
bool
dmRequire
(
SMgmtWrapper
*
pWrapper
)
{
return
true
;
}
SMgmtFp
dmGetMgmtFp
()
{
SMgmtFp
mgmtFp
=
{
0
};
mgmtFp
.
openFp
=
dmInit
;
mgmtFp
.
closeFp
=
dmCleanup
;
mgmtFp
.
requiredFp
=
dmRequire
;
mgmtFp
.
getMsgHandleFp
=
dmGetMsgHandle
;
return
mgmtFp
;
}
bool
dmRequire
(
SMgmtWrapper
*
pWrapper
)
{
return
true
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录