Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3aef011d
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看板
提交
3aef011d
编写于
2月 18, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dnodeMgmt.h
上级
10f78bb5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
74 addition
and
102 deletion
+74
-102
src/dnode/inc/dnodeMgmt.h
src/dnode/inc/dnodeMgmt.h
+1
-1
src/dnode/src/dnodeMgmt.c
src/dnode/src/dnodeMgmt.c
+24
-36
src/inc/dnode.h
src/inc/dnode.h
+5
-6
src/inc/trpc.h
src/inc/trpc.h
+3
-0
src/mnode/inc/mgmtDnodeInt.h
src/mnode/inc/mgmtDnodeInt.h
+2
-5
src/mnode/src/mgmtDnodeInt.c
src/mnode/src/mgmtDnodeInt.c
+39
-54
未找到文件。
src/dnode/inc/dnodeMgmt.h
浏览文件 @
3aef011d
...
@@ -26,7 +26,7 @@ extern "C" {
...
@@ -26,7 +26,7 @@ extern "C" {
#include "dnode.h"
#include "dnode.h"
void
dnode
Distribute
MsgFromMgmt
(
int8_t
*
pCont
,
int32_t
contLen
,
int32_t
msgType
,
void
*
pConn
);
void
dnode
Process
MsgFromMgmt
(
int8_t
*
pCont
,
int32_t
contLen
,
int32_t
msgType
,
void
*
pConn
);
extern
void
*
tsDnodeMgmtQhandle
;
extern
void
*
tsDnodeMgmtQhandle
;
...
...
src/dnode/src/dnodeMgmt.c
浏览文件 @
3aef011d
...
@@ -31,43 +31,41 @@
...
@@ -31,43 +31,41 @@
static
int
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
int8_t
*
pCont
,
int32_t
contLen
,
void
*
pConn
);
static
int
(
*
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_MAX
])(
int8_t
*
pCont
,
int32_t
contLen
,
void
*
pConn
);
static
void
dnodeInitProcessShellMsg
();
static
void
dnodeInitProcessShellMsg
();
void
taosSendMsgToMnodeImpFp
(
SSchedMsg
*
sched
)
{
void
dnodeSendMsgToMnodeImpFp
(
SSchedMsg
*
sched
)
{
char
msgType
=
*
sched
->
msg
;
int8_t
msgType
=
*
(
sched
->
msg
-
1
);
char
*
content
=
sched
->
msg
+
sizeof
(
int32_t
);
int8_t
*
pCont
=
sched
->
msg
;
int32_t
contLen
=
(
int32_t
)
sched
->
ahandle
;
void
*
pConn
=
NULL
;
mgmtProcessMsgFromDnode
(
content
,
0
,
msgType
,
NULL
);
mgmtProcessMsgFromDnode
(
pCont
,
contLen
,
msgType
,
pConn
);
rpcFreeCont
(
sched
->
msg
);
rpcFreeCont
(
sched
->
msg
);
}
}
int32_t
taosSendMsgToMnodeImp
(
int8_t
*
msg
,
int32_t
msgLen
)
{
int32_t
dnodeSendMsgToMnodeImp
(
int8_t
*
pCont
,
int32_t
contLen
,
int8_t
msgType
)
{
dTrace
(
"msg:%s is sent to mnode"
,
taosMsg
[(
int32_t
)(
*
(
msg
-
sizeof
(
int32_t
)))]);
dTrace
(
"msg:%s is sent to mnode"
,
taosMsg
[
msgType
]);
*
(
pCont
-
1
)
=
msgType
;
/*
* Lite version has no message header, so minus one
*/
SSchedMsg
schedMsg
;
SSchedMsg
schedMsg
;
schedMsg
.
fp
=
taos
SendMsgToMnodeImpFp
;
schedMsg
.
fp
=
dnode
SendMsgToMnodeImpFp
;
schedMsg
.
msg
=
msg
-
sizeof
(
int32_t
)
;
schedMsg
.
msg
=
pCont
;
schedMsg
.
ahandle
=
NULL
;
schedMsg
.
ahandle
=
(
void
*
)
contLen
;
schedMsg
.
thandle
=
NULL
;
schedMsg
.
thandle
=
NULL
;
taosScheduleTask
(
tsDnodeMgmtQhandle
,
&
schedMsg
);
taosScheduleTask
(
tsDnodeMgmtQhandle
,
&
schedMsg
);
return
0
;
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
(
*
taosSendMsgToMnode
)(
char
*
msg
,
int32_t
msgLen
)
=
taosSendMsgToMnodeImp
;
int32_t
taosSendSimpleRspToMnodeImp
(
int32_t
rsptype
,
int32_t
code
)
{
int32_t
(
*
dnodeSendMsgToMnode
)(
int8_t
*
pCont
,
int32_t
contLen
,
int8_t
msgType
)
=
dnodeSendMsgToMnodeImp
;
char
*
pStart
=
taosBuildRspMsgToMnode
(
0
,
rsptype
);
if
(
pStart
==
NULL
)
{
return
0
;
}
*
pStart
=
code
;
int32_t
dnodeSendSimpleRspToMnodeImp
(
int32_t
msgType
,
int32_t
code
)
{
taosSendMsgToMnode
(
0
,
pStart
,
code
);
int8_t
*
pCont
=
rpcMallocCont
(
sizeof
(
int32_t
));
*
(
int32_t
*
)
pCont
=
code
;
return
0
;
dnodeSendMsgToMnodeImp
(
pCont
,
sizeof
(
int32_t
),
msgType
);
return
TSDB_CODE_SUCCESS
;
}
}
int
(
*
taosSendSimpleRspToMnode
)(
int32_t
rsptype
,
int32_t
code
)
=
taosSendSimpleRspToMnodeImp
;
int32_t
(
*
dnodeSendSimpleRspToMnode
)(
int32_t
msgType
,
int32_t
code
)
=
dnodeSendSimpleRspToMnodeImp
;
int32_t
dnodeInitMgmtImp
()
{
int32_t
dnodeInitMgmtImp
()
{
dnodeInitProcessShellMsg
();
dnodeInitProcessShellMsg
();
...
@@ -80,17 +78,7 @@ void dnodeInitMgmtIpImp() {}
...
@@ -80,17 +78,7 @@ void dnodeInitMgmtIpImp() {}
void
(
*
dnodeInitMgmtIp
)()
=
dnodeInitMgmtIpImp
;
void
(
*
dnodeInitMgmtIp
)()
=
dnodeInitMgmtIpImp
;
void
dnodeProcessMsgFromMgmtImp
(
SSchedMsg
*
sched
)
{
void
dnodeProcessMsgFromMgmt
(
int8_t
*
pCont
,
int32_t
contLen
,
int32_t
msgType
,
void
*
pConn
)
{
int32_t
msgType
=
*
(
int32_t
*
)(
sched
->
msg
);
int8_t
*
content
=
sched
->
msg
+
sizeof
(
int32_t
);
dTrace
(
"msg:%s is received from mnode"
,
taosMsg
[
msgType
]);
dnodeDistributeMsgFromMgmt
(
content
,
0
,
msgType
,
NULL
);
free
(
sched
->
msg
);
}
void
dnodeDistributeMsgFromMgmt
(
int8_t
*
pCont
,
int32_t
contLen
,
int32_t
msgType
,
void
*
pConn
)
{
if
(
msgType
<
0
||
msgType
>=
TSDB_MSG_TYPE_MAX
)
{
if
(
msgType
<
0
||
msgType
>=
TSDB_MSG_TYPE_MAX
)
{
dError
(
"invalid msg type:%d"
,
msgType
);
dError
(
"invalid msg type:%d"
,
msgType
);
}
else
{
}
else
{
...
@@ -202,7 +190,7 @@ void dnodeSendVpeerCfgMsg(int32_t vnode) {
...
@@ -202,7 +190,7 @@ void dnodeSendVpeerCfgMsg(int32_t vnode) {
}
}
cfg
->
vnode
=
htonl
(
vnode
);
cfg
->
vnode
=
htonl
(
vnode
);
taos
SendMsgToMnode
(
cfg
,
sizeof
(
SMeterCfgMsg
));
dnode
SendMsgToMnode
(
cfg
,
sizeof
(
SMeterCfgMsg
));
}
}
void
dnodeSendMeterCfgMsg
(
int32_t
vnode
,
int32_t
sid
)
{
void
dnodeSendMeterCfgMsg
(
int32_t
vnode
,
int32_t
sid
)
{
...
@@ -212,7 +200,7 @@ void dnodeSendMeterCfgMsg(int32_t vnode, int32_t sid) {
...
@@ -212,7 +200,7 @@ void dnodeSendMeterCfgMsg(int32_t vnode, int32_t sid) {
}
}
cfg
->
vnode
=
htonl
(
vnode
);
cfg
->
vnode
=
htonl
(
vnode
);
taos
SendMsgToMnode
(
cfg
,
sizeof
(
SMeterCfgMsg
));
dnode
SendMsgToMnode
(
cfg
,
sizeof
(
SMeterCfgMsg
));
}
}
void
dnodeInitProcessShellMsg
()
{
void
dnodeInitProcessShellMsg
()
{
...
...
src/inc/dnode.h
浏览文件 @
3aef011d
...
@@ -45,22 +45,21 @@ extern uint32_t tsRebootTime;
...
@@ -45,22 +45,21 @@ extern uint32_t tsRebootTime;
extern
void
(
*
dnodeStartModules
)();
extern
void
(
*
dnodeStartModules
)();
extern
void
(
*
dnodeParseParameterK
)();
extern
void
(
*
dnodeParseParameterK
)();
extern
int32_t
(
*
dnodeCheckSystem
)();
extern
int32_t
(
*
dnodeCheckSystem
)();
extern
char
*
(
*
taosBuildRspMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
extern
char
*
(
*
taosBuildReqMsgToMnodeWithSize
)(
SMgmtObj
*
pObj
,
char
type
,
int
size
);
extern
char
*
(
*
taosBuildRspMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
extern
char
*
(
*
taosBuildReqMsgToMnode
)(
SMgmtObj
*
pObj
,
char
type
);
extern
int
(
*
taosSendSimpleRspToMnode
)(
SMgmtObj
*
pObj
,
char
rsptype
,
char
code
);
extern
void
(
*
dnodeInitMgmtIp
)();
extern
void
(
*
dnodeInitMgmtIp
)();
extern
int
(
*
dnodeInitMgmt
)();
extern
int
(
*
dnodeInitMgmt
)();
int32_t
(
*
dnodeSendMsgToMnode
)(
int8_t
*
pCont
,
int32_t
contLen
,
int8_t
msgType
);
int32_t
(
*
dnodeSendSimpleRspToMnode
)(
int32_t
msgType
,
int32_t
code
);
// multilevelStorage
// multilevelStorage
extern
int32_t
(
*
dnodeInitStorage
)();
extern
int32_t
(
*
dnodeInitStorage
)();
extern
void
(
*
dnodeCleanupStorage
)();
extern
void
(
*
dnodeCleanupStorage
)();
void
dnodeCheckDataDirOpenned
(
const
char
*
dir
);
void
dnodeCheckDataDirOpenned
(
const
char
*
dir
);
void
dnodeProcessMsgFromMgmt
Imp
(
SSchedMsg
*
sched
);
void
dnodeProcessMsgFromMgmt
(
int8_t
*
pCont
,
int32_t
contLen
,
int32_t
msgType
,
void
*
pConn
);
void
dnodeLockVnodes
();
void
dnodeLockVnodes
();
...
...
src/inc/trpc.h
浏览文件 @
3aef011d
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
extern
"C"
{
extern
"C"
{
#endif
#endif
#include <stdbool.h>
#include <stdint.h>
#define TAOS_CONN_UDPS 0
#define TAOS_CONN_UDPS 0
#define TAOS_CONN_UDPC 1
#define TAOS_CONN_UDPC 1
#define TAOS_CONN_TCPS 2
#define TAOS_CONN_TCPS 2
...
...
src/mnode/inc/mgmtDnodeInt.h
浏览文件 @
3aef011d
...
@@ -38,14 +38,11 @@ int mgmtSendOneFreeVnodeMsg(SVnodeGid *pVnodeGid);
...
@@ -38,14 +38,11 @@ int mgmtSendOneFreeVnodeMsg(SVnodeGid *pVnodeGid);
char
*
taosBuildRspMsgToDnode
(
SDnodeObj
*
pObj
,
char
type
);
char
*
taosBuildRspMsgToDnode
(
SDnodeObj
*
pObj
,
char
type
);
char
*
taosBuildReqMsgToDnode
(
SDnodeObj
*
pObj
,
char
type
);
char
*
taosBuildReqMsgToDnode
(
SDnodeObj
*
pObj
,
char
type
);
extern
char
*
(
*
taosBuildRspMsgToDnodeWithSize
)(
SDnodeObj
*
pObj
,
char
type
,
int32_t
size
);
extern
int32_t
(
*
mgmtSendSimpleRspToDnode
)(
int32_t
msgType
,
int32_t
code
);
extern
char
*
(
*
taosBuildReqMsgToDnodeWithSize
)(
SDnodeObj
*
pObj
,
char
type
,
int32_t
size
);
extern
int32_t
(
*
mgmtSendMsgToDnode
)(
SDnodeObj
*
pObj
,
char
*
msg
,
int
msgLen
);
extern
int32_t
(
*
taosSendSimpleRspToDnode
)(
SDnodeObj
*
pObj
,
char
rsptype
,
char
code
);
extern
int32_t
(
*
taosSendMsgToDnode
)(
SDnodeObj
*
pObj
,
char
*
msg
,
int32_t
msgLen
);
extern
int32_t
(
*
mgmtInitDnodeInt
)();
extern
int32_t
(
*
mgmtInitDnodeInt
)();
extern
void
(
*
mgmtCleanUpDnodeInt
)();
extern
void
(
*
mgmtCleanUpDnodeInt
)();
extern
void
(
*
mgmtProcessDnodeStatus
)(
void
*
handle
,
void
*
tmrId
);
extern
void
(
*
mgmtProcessDnodeStatus
)(
void
*
handle
,
void
*
tmrId
);
extern
void
(
*
mgmtProcessMsgFromDnodeSpec
)(
SSchedMsg
*
sched
);
#ifdef __cplusplus
#ifdef __cplusplus
...
...
src/mnode/src/mgmtDnodeInt.c
浏览文件 @
3aef011d
...
@@ -50,7 +50,7 @@ int mgmtProcessMeterCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
...
@@ -50,7 +50,7 @@ int mgmtProcessMeterCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
SVgObj
*
pVgroup
;
SVgObj
*
pVgroup
;
if
(
!
sdbMaster
)
{
if
(
!
sdbMaster
)
{
taos
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_TABLE_CFG_RSP
,
TSDB_CODE_REDIRECT
);
mgmt
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_TABLE_CFG_RSP
,
TSDB_CODE_REDIRECT
);
return
0
;
return
0
;
}
}
...
@@ -59,7 +59,7 @@ int mgmtProcessMeterCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
...
@@ -59,7 +59,7 @@ int mgmtProcessMeterCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
pStart
=
taosBuildRspMsgToDnodeWithSize
(
pObj
,
TSDB_MSG_TYPE_TABLE_CFG_RSP
,
64000
);
pStart
=
taosBuildRspMsgToDnodeWithSize
(
pObj
,
TSDB_MSG_TYPE_TABLE_CFG_RSP
,
64000
);
if
(
pStart
==
NULL
)
{
if
(
pStart
==
NULL
)
{
taos
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_TABLE_CFG_RSP
,
TSDB_CODE_SERV_OUT_OF_MEMORY
);
mgmt
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_TABLE_CFG_RSP
,
TSDB_CODE_SERV_OUT_OF_MEMORY
);
return
0
;
return
0
;
}
}
...
@@ -88,7 +88,7 @@ int mgmtProcessMeterCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
...
@@ -88,7 +88,7 @@ int mgmtProcessMeterCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
}
}
msgLen
=
pMsg
-
pStart
;
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
return
0
;
return
0
;
}
}
...
@@ -100,7 +100,7 @@ int mgmtProcessVpeerCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
...
@@ -100,7 +100,7 @@ int mgmtProcessVpeerCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
SVgObj
*
pVgroup
=
NULL
;
SVgObj
*
pVgroup
=
NULL
;
if
(
!
sdbMaster
)
{
if
(
!
sdbMaster
)
{
taos
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_VNODE_CFG_RSP
,
TSDB_CODE_REDIRECT
);
mgmt
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_VNODE_CFG_RSP
,
TSDB_CODE_REDIRECT
);
return
0
;
return
0
;
}
}
...
@@ -108,7 +108,7 @@ int mgmtProcessVpeerCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
...
@@ -108,7 +108,7 @@ int mgmtProcessVpeerCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
pStart
=
taosBuildRspMsgToDnode
(
pObj
,
TSDB_MSG_TYPE_VNODE_CFG_RSP
);
pStart
=
taosBuildRspMsgToDnode
(
pObj
,
TSDB_MSG_TYPE_VNODE_CFG_RSP
);
if
(
pStart
==
NULL
)
{
if
(
pStart
==
NULL
)
{
taos
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_VNODE_CFG_RSP
,
TSDB_CODE_SERV_OUT_OF_MEMORY
);
mgmt
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_VNODE_CFG_RSP
,
TSDB_CODE_SERV_OUT_OF_MEMORY
);
return
0
;
return
0
;
}
}
pMsg
=
pStart
;
pMsg
=
pStart
;
...
@@ -129,7 +129,7 @@ int mgmtProcessVpeerCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
...
@@ -129,7 +129,7 @@ int mgmtProcessVpeerCfgMsg(char *cont, int contLen, SDnodeObj *pObj) {
}
}
msgLen
=
pMsg
-
pStart
;
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
return
0
;
return
0
;
}
}
...
@@ -142,7 +142,7 @@ int mgmtProcessVPeersRsp(char *msg, int msgLen, SDnodeObj *pObj) {
...
@@ -142,7 +142,7 @@ int mgmtProcessVPeersRsp(char *msg, int msgLen, SDnodeObj *pObj) {
STaosRsp
*
pRsp
=
(
STaosRsp
*
)
msg
;
STaosRsp
*
pRsp
=
(
STaosRsp
*
)
msg
;
if
(
!
sdbMaster
)
{
if
(
!
sdbMaster
)
{
taos
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_DNODE_VPEERS_RSP
,
TSDB_CODE_REDIRECT
);
mgmt
SendSimpleRspToDnode
(
pObj
,
TSDB_MSG_TYPE_DNODE_VPEERS_RSP
,
TSDB_CODE_REDIRECT
);
return
0
;
return
0
;
}
}
...
@@ -251,7 +251,7 @@ int32_t mgmtSendCreateChildTableMsg(SChildTableObj *pTable, SVgObj *pVgroup, int
...
@@ -251,7 +251,7 @@ int32_t mgmtSendCreateChildTableMsg(SChildTableObj *pTable, SVgObj *pVgroup, int
int8_t
*
pMsg
=
mgmtBuildCreateChildTableMsg
(
pTable
,
pStart
,
pVgroup
->
vnodeGid
[
index
].
vnode
,
tagDataLen
,
pTagData
);
int8_t
*
pMsg
=
mgmtBuildCreateChildTableMsg
(
pTable
,
pStart
,
pVgroup
->
vnodeGid
[
index
].
vnode
,
tagDataLen
,
pTagData
);
int32_t
msgLen
=
pMsg
-
pStart
;
int32_t
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
}
}
pVgroup
->
lastCreate
=
timeStamp
;
pVgroup
->
lastCreate
=
timeStamp
;
...
@@ -275,7 +275,7 @@ int32_t mgmtSendCreateStreamTableMsg(SStreamTableObj *pTable, SVgObj *pVgroup) {
...
@@ -275,7 +275,7 @@ int32_t mgmtSendCreateStreamTableMsg(SStreamTableObj *pTable, SVgObj *pVgroup) {
int8_t
*
pMsg
=
mgmtBuildCreateStreamTableMsg
(
pTable
,
pStart
,
pVgroup
->
vnodeGid
[
index
].
vnode
);
int8_t
*
pMsg
=
mgmtBuildCreateStreamTableMsg
(
pTable
,
pStart
,
pVgroup
->
vnodeGid
[
index
].
vnode
);
int32_t
msgLen
=
pMsg
-
pStart
;
int32_t
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
}
}
pVgroup
->
lastCreate
=
timeStamp
;
pVgroup
->
lastCreate
=
timeStamp
;
...
@@ -299,7 +299,7 @@ int32_t mgmtSendCreateNormalTableMsg(SNormalTableObj *pTable, SVgObj *pVgroup) {
...
@@ -299,7 +299,7 @@ int32_t mgmtSendCreateNormalTableMsg(SNormalTableObj *pTable, SVgObj *pVgroup) {
int8_t
*
pMsg
=
mgmtBuildCreateNormalTableMsg
(
pTable
,
pStart
,
pVgroup
->
vnodeGid
[
index
].
vnode
);
int8_t
*
pMsg
=
mgmtBuildCreateNormalTableMsg
(
pTable
,
pStart
,
pVgroup
->
vnodeGid
[
index
].
vnode
);
int32_t
msgLen
=
pMsg
-
pStart
;
int32_t
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
}
}
pVgroup
->
lastCreate
=
timeStamp
;
pVgroup
->
lastCreate
=
timeStamp
;
...
@@ -334,7 +334,7 @@ int mgmtSendRemoveMeterMsgToDnode(STabObj *pTable, SVgObj *pVgroup) {
...
@@ -334,7 +334,7 @@ int mgmtSendRemoveMeterMsgToDnode(STabObj *pTable, SVgObj *pVgroup) {
pMsg
+=
sizeof
(
SDRemoveTableMsg
);
pMsg
+=
sizeof
(
SDRemoveTableMsg
);
msgLen
=
pMsg
-
pStart
;
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
tinet_ntoa
(
ipstr
,
pVgroup
->
vnodeGid
[
i
].
ip
);
tinet_ntoa
(
ipstr
,
pVgroup
->
vnodeGid
[
i
].
ip
);
mTrace
(
"dnode:%s vid:%d, send remove meter msg, sid:%d status:%d"
,
ipstr
,
pVgroup
->
vnodeGid
[
i
].
vnode
,
mTrace
(
"dnode:%s vid:%d, send remove meter msg, sid:%d status:%d"
,
ipstr
,
pVgroup
->
vnodeGid
[
i
].
vnode
,
...
@@ -371,7 +371,7 @@ int mgmtSendAlterStreamMsgToDnode(STabObj *pTable, SVgObj *pVgroup) {
...
@@ -371,7 +371,7 @@ int mgmtSendAlterStreamMsgToDnode(STabObj *pTable, SVgObj *pVgroup) {
pMsg
+=
sizeof
(
SAlterStreamMsg
);
pMsg
+=
sizeof
(
SAlterStreamMsg
);
msgLen
=
pMsg
-
pStart
;
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pObj
,
pStart
,
msgLen
);
}
}
return
0
;
return
0
;
...
@@ -433,7 +433,7 @@ int mgmtSendVPeersMsg(SVgObj *pVgroup) {
...
@@ -433,7 +433,7 @@ int mgmtSendVPeersMsg(SVgObj *pVgroup) {
pMsg
=
mgmtBuildVpeersIe
(
pStart
,
pVgroup
,
pVgroup
->
vnodeGid
[
i
].
vnode
);
pMsg
=
mgmtBuildVpeersIe
(
pStart
,
pVgroup
,
pVgroup
->
vnodeGid
[
i
].
vnode
);
msgLen
=
pMsg
-
pStart
;
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pDnode
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pDnode
,
pStart
,
msgLen
);
}
}
}
}
...
@@ -467,7 +467,7 @@ int mgmtSendOneFreeVnodeMsg(SVnodeGid *pVnodeGid) {
...
@@ -467,7 +467,7 @@ int mgmtSendOneFreeVnodeMsg(SVnodeGid *pVnodeGid) {
pMsg
+=
sizeof
(
SFreeVnodeMsg
);
pMsg
+=
sizeof
(
SFreeVnodeMsg
);
msgLen
=
pMsg
-
pStart
;
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pDnode
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pDnode
,
pStart
,
msgLen
);
return
0
;
return
0
;
}
}
...
@@ -547,7 +547,7 @@ int mgmtSendCfgDnodeMsg(char *cont) {
...
@@ -547,7 +547,7 @@ int mgmtSendCfgDnodeMsg(char *cont) {
pMsg
+=
sizeof
(
SCfgMsg
);
pMsg
+=
sizeof
(
SCfgMsg
);
msgLen
=
pMsg
-
pStart
;
msgLen
=
pMsg
-
pStart
;
taos
SendMsgToDnode
(
pDnode
,
pStart
,
msgLen
);
mgmt
SendMsgToDnode
(
pDnode
,
pStart
,
msgLen
);
#else
#else
(
void
)
tsCfgDynamicOptions
(
pCfg
->
config
);
(
void
)
tsCfgDynamicOptions
(
pCfg
->
config
);
#endif
#endif
...
@@ -564,56 +564,41 @@ void * mgmtStatusTimer = NULL;
...
@@ -564,56 +564,41 @@ void * mgmtStatusTimer = NULL;
void
mgmtProcessMsgFromDnode
(
char
*
content
,
int
msgLen
,
int
msgType
,
SDnodeObj
*
pObj
);
void
mgmtProcessMsgFromDnode
(
char
*
content
,
int
msgLen
,
int
msgType
,
SDnodeObj
*
pObj
);
char
*
taosBuildRspMsgToDnodeWithSizeImp
(
SDnodeObj
*
pObj
,
char
type
,
int32_t
size
)
{
void
mgmtSendMsgToDnodeImpFp
(
SSchedMsg
*
sched
)
{
char
*
pStart
=
(
char
*
)
malloc
(
size
);
int8_t
msgType
=
*
(
sched
->
msg
-
1
);
i
f
(
pStart
==
NULL
)
{
i
nt8_t
*
pCont
=
sched
->
msg
;
return
NULL
;
int32_t
contLen
=
(
int32_t
)
sched
->
ahandle
;
}
void
*
pConn
=
NULL
;
*
pStart
=
type
;
dnodeProcessMsgFromMgmt
(
pCont
,
contLen
,
msgType
,
pConn
)
;
r
eturn
pStart
+
1
;
r
pcFreeCont
(
sched
->
msg
)
;
}
}
char
*
(
*
taosBuildRspMsgToDnodeWithSize
)(
SDnodeObj
*
pObj
,
char
type
,
int32_t
size
)
=
taosBuildRspMsgToDnodeWithSizeImp
;
char
*
taosBuildReqMsgToDnodeWithSizeImp
(
SDnodeObj
*
pObj
,
char
type
,
int32_t
size
)
{
char
*
pStart
=
(
char
*
)
malloc
(
size
);
if
(
pStart
==
NULL
)
{
return
NULL
;
}
*
pStart
=
type
;
int32_t
mgmtSendMsgToDnodeImp
(
int8_t
*
pCont
,
int32_t
contLen
,
int8_t
msgType
)
{
return
pStart
+
1
;
mTrace
(
"msg:%s is sent to dnode"
,
taosMsg
[
msgType
]);
}
*
(
pCont
-
1
)
=
msgType
;
char
*
(
*
taosBuildReqMsgToDnodeWithSize
)(
SDnodeObj
*
pObj
,
char
type
,
int32_t
size
)
=
taosBuildReqMsgToDnodeWithSizeImp
;
char
*
taosBuildRspMsgToDnode
(
SDnodeObj
*
pObj
,
char
type
)
{
SSchedMsg
schedMsg
;
return
taosBuildRspMsgToDnodeWithSize
(
pObj
,
type
,
256
);
schedMsg
.
fp
=
mgmtSendMsgToDnodeImpFp
;
}
schedMsg
.
msg
=
pCont
;
schedMsg
.
ahandle
=
(
void
*
)
contLen
;
schedMsg
.
thandle
=
NULL
;
taosScheduleTask
(
tsDnodeMgmtQhandle
,
&
schedMsg
);
char
*
taosBuildReqMsgToDnode
(
SDnodeObj
*
pObj
,
char
type
)
{
return
TSDB_CODE_SUCCESS
;
return
taosBuildReqMsgToDnodeWithSize
(
pObj
,
type
,
256
);
}
}
int32_t
taosSendSimpleRspToDnodeImp
(
SDnodeObj
*
pObj
,
char
rsptype
,
char
code
)
{
return
0
;
}
int32_t
(
*
mgmtSendMsgToDnode
)(
SDnodeObj
*
pObj
,
char
*
msg
,
int
msgLen
)
=
mgmtSendMsgToDnodeImp
;
int32_t
(
*
taosSendSimpleRspToDnode
)(
SDnodeObj
*
pObj
,
char
rsptype
,
char
code
)
=
taosSendSimpleRspToDnodeImp
;
int32_t
taosSendMsgToDnodeImp
(
SDnodeObj
*
pObj
,
char
*
msg
,
int32_t
msgLen
)
{
int32_t
mgmtSendSimpleRspToDnodeImp
(
int32_t
msgType
,
int32_t
code
)
{
mTrace
(
"msg:%s is sent to dnode"
,
taosMsg
[(
uint8_t
)(
*
(
msg
-
1
))]);
int8_t
*
pCont
=
rpcMallocCont
(
sizeof
(
int32_t
));
*
(
int32_t
*
)
pCont
=
code
;
/*
* Lite version has no message header, so minus one
*/
SSchedMsg
schedMsg
;
schedMsg
.
fp
=
dnodeProcessMsgFromMgmtImp
;
schedMsg
.
msg
=
msg
-
1
;
schedMsg
.
ahandle
=
NULL
;
schedMsg
.
thandle
=
NULL
;
taosScheduleTask
(
tsDnodeMgmtQhandle
,
&
schedMsg
);
return
0
;
mgmtSendMsgToDnodeImp
(
pCont
,
sizeof
(
int32_t
),
msgType
);
return
TSDB_CODE_SUCCESS
;
}
}
int32_t
(
*
taosSendMsgToDnode
)(
SDnodeObj
*
pObj
,
char
*
msg
,
int
msgLen
)
=
taosSendMsgToDnodeImp
;
int32_t
(
*
mgmtSendSimpleRspToDnode
)(
int32_t
msgType
,
int32_t
code
)
=
mgmtSendSimpleRspToDnodeImp
;
int32_t
mgmtInitDnodeIntImp
()
{
return
0
;
}
int32_t
mgmtInitDnodeIntImp
()
{
return
0
;
}
int32_t
(
*
mgmtInitDnodeInt
)()
=
mgmtInitDnodeIntImp
;
int32_t
(
*
mgmtInitDnodeInt
)()
=
mgmtInitDnodeIntImp
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录