Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6296188f
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
6296188f
编写于
5月 11, 2022
作者:
S
Shengliang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: node mgmt
上级
ace5940c
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
219 addition
and
248 deletion
+219
-248
include/common/tmsgcb.h
include/common/tmsgcb.h
+4
-3
source/common/src/tmsgcb.c
source/common/src/tmsgcb.c
+2
-2
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
+18
-20
source/dnode/mgmt/mgmt_mnode/src/mmFile.c
source/dnode/mgmt/mgmt_mnode/src/mmFile.c
+3
-5
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
+114
-105
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
+51
-64
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
+27
-49
未找到文件。
include/common/tmsgcb.h
浏览文件 @
6296188f
...
...
@@ -37,8 +37,8 @@ typedef enum {
QUEUE_MAX
,
}
EQueueType
;
typedef
int32_t
(
*
PutToQueueFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
GetQueueSizeFp
)(
SMgmtWrapper
*
pWrapper
,
int32_t
vgId
,
EQueueType
qtype
);
typedef
int32_t
(
*
PutToQueueFp
)(
void
*
pMgmt
,
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
GetQueueSizeFp
)(
void
*
pMgmt
,
int32_t
vgId
,
EQueueType
qtype
);
typedef
int32_t
(
*
SendReqFp
)(
SMgmtWrapper
*
pWrapper
,
const
SEpSet
*
epSet
,
SRpcMsg
*
pReq
);
typedef
int32_t
(
*
SendMnodeReqFp
)(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pReq
);
typedef
void
(
*
SendRspFp
)(
SMgmtWrapper
*
pWrapper
,
const
SRpcMsg
*
pRsp
);
...
...
@@ -49,6 +49,8 @@ typedef void (*ReportStartup)(SMgmtWrapper* pWrapper, const char* name, const ch
typedef
struct
{
SMgmtWrapper
*
pWrapper
;
void
*
pMgmt
;
void
*
clientRpc
;
PutToQueueFp
queueFps
[
QUEUE_MAX
];
GetQueueSizeFp
qsizeFp
;
SendReqFp
sendReqFp
;
...
...
@@ -57,7 +59,6 @@ typedef struct {
RegisterBrokenLinkArgFp
registerBrokenLinkArgFp
;
ReleaseHandleFp
releaseHandleFp
;
ReportStartup
reportStartupFp
;
void
*
clientRpc
;
}
SMsgCb
;
void
tmsgSetDefaultMsgCb
(
const
SMsgCb
*
pMsgCb
);
...
...
source/common/src/tmsgcb.c
浏览文件 @
6296188f
...
...
@@ -24,7 +24,7 @@ void tmsgSetDefaultMsgCb(const SMsgCb* pMsgCb) { tsDefaultMsgCb = *pMsgCb; }
int32_t
tmsgPutToQueue
(
const
SMsgCb
*
pMsgCb
,
EQueueType
qtype
,
SRpcMsg
*
pReq
)
{
PutToQueueFp
fp
=
pMsgCb
->
queueFps
[
qtype
];
if
(
fp
!=
NULL
)
{
return
(
*
fp
)(
pMsgCb
->
p
Wrapper
,
pReq
);
return
(
*
fp
)(
pMsgCb
->
p
Mgmt
,
pReq
);
}
else
{
terrno
=
TSDB_CODE_INVALID_PTR
;
return
-
1
;
...
...
@@ -34,7 +34,7 @@ int32_t tmsgPutToQueue(const SMsgCb* pMsgCb, EQueueType qtype, SRpcMsg* pReq) {
int32_t
tmsgGetQueueSize
(
const
SMsgCb
*
pMsgCb
,
int32_t
vgId
,
EQueueType
qtype
)
{
GetQueueSizeFp
fp
=
pMsgCb
->
qsizeFp
;
if
(
fp
!=
NULL
)
{
return
(
*
fp
)(
pMsgCb
->
p
Wrapper
,
vgId
,
qtype
);
return
(
*
fp
)(
pMsgCb
->
p
Mgmt
,
vgId
,
qtype
);
}
else
{
terrno
=
TSDB_CODE_INVALID_PTR
;
return
-
1
;
...
...
source/dnode/mgmt/mgmt_mnode/inc/mmInt.h
浏览文件 @
6296188f
...
...
@@ -17,7 +17,6 @@
#define _TD_DND_MNODE_INT_H_
#include "dmInt.h"
#include "mnode.h"
#ifdef __cplusplus
...
...
@@ -26,9 +25,10 @@ extern "C" {
typedef
struct
SMnodeMgmt
{
SMnode
*
pMnode
;
SDnode
*
pDnode
;
SMgmtWrapper
*
pWrapper
;
SMsgCb
msgCb
;
const
char
*
path
;
const
char
*
name
;
int32_t
dnodeId
;
SSingleWorker
queryWorker
;
SSingleWorker
readWorker
;
SSingleWorker
writeWorker
;
...
...
@@ -41,33 +41,31 @@ typedef struct SMnodeMgmt {
// mmFile.c
int32_t
mmReadFile
(
SMnodeMgmt
*
pMgmt
,
bool
*
pDeployed
);
int32_t
mmWriteFile
(
SM
gmtWrapper
*
pWrapper
,
SDCreateMnodeReq
*
pReq
,
bool
deployed
);
int32_t
mmWriteFile
(
SM
nodeMgmt
*
pMgmt
,
SDCreateMnodeReq
*
pReq
,
bool
deployed
);
// mmInt.c
int32_t
mmAlter
(
SMnodeMgmt
*
pMgmt
,
SDAlterMnodeReq
*
pReq
);
// mmHandle.c
void
mmInitMsgHandle
(
SMgmtWrapper
*
pWrapper
);
int32_t
mmProcessCreateReq
(
SM
gmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessDropReq
(
SM
gmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
SArray
*
mmGetMsgHandles
(
);
int32_t
mmProcessCreateReq
(
SM
nodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessDropReq
(
SM
nodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessAlterReq
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessGetMonMmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
);
int32_t
mmProcessGetMnodeLoadsReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
);
void
mmGetMnodeLoads
(
SMgmtWrapper
*
pWrapper
,
SMonMloadInfo
*
pInfo
);
int32_t
mmProcessGetMonitorInfoReq
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pReq
);
int32_t
mmProcessGetLoadsReq
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pReq
);
// mmWorker.c
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
);
void
mmStopWorker
(
SMnodeMgmt
*
pMgmt
);
int32_t
mmProcessWriteMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessSyncMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessReadMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessQueryMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessMonitorMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmPutMsgToQueryQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
);
int32_t
mmPutMsgToReadQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
);
int32_t
mmPutMsgToWriteQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
);
int32_t
mmPutMsgToSyncQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
);
int32_t
mmPutNodeMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmPutNodeMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmPutNodeMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmPutNodeMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmPutNodeMsgToMonitorQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmPutRpcMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
);
int32_t
mmPutRpcMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
);
int32_t
mmPutRpcMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
);
int32_t
mmPutRpcMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/mgmt_mnode/src/mmFile.c
浏览文件 @
6296188f
...
...
@@ -28,7 +28,6 @@ int32_t mmReadFile(SMnodeMgmt *pMgmt, bool *pDeployed) {
snprintf
(
file
,
sizeof
(
file
),
"%s%smnode.json"
,
pMgmt
->
path
,
TD_DIRSEP
);
pFile
=
taosOpenFile
(
file
,
TD_FILE_READ
);
if
(
pFile
==
NULL
)
{
// dDebug("file %s not exist", file);
code
=
0
;
goto
_OVER
;
}
...
...
@@ -105,11 +104,11 @@ _OVER:
return
code
;
}
int32_t
mmWriteFile
(
SM
gmtWrapper
*
pWrapper
,
SDCreateMnodeReq
*
pReq
,
bool
deployed
)
{
int32_t
mmWriteFile
(
SM
nodeMgmt
*
pMgmt
,
SDCreateMnodeReq
*
pReq
,
bool
deployed
)
{
char
file
[
PATH_MAX
]
=
{
0
};
char
realfile
[
PATH_MAX
]
=
{
0
};
snprintf
(
file
,
sizeof
(
file
),
"%s%smnode.json.bak"
,
p
Wrapper
->
path
,
TD_DIRSEP
);
snprintf
(
realfile
,
sizeof
(
realfile
),
"%s%smnode.json"
,
p
Wrapper
->
path
,
TD_DIRSEP
);
snprintf
(
file
,
sizeof
(
file
),
"%s%smnode.json.bak"
,
p
Mgmt
->
path
,
TD_DIRSEP
);
snprintf
(
realfile
,
sizeof
(
realfile
),
"%s%smnode.json"
,
p
Mgmt
->
path
,
TD_DIRSEP
);
TdFilePtr
pFile
=
taosOpenFile
(
file
,
TD_FILE_CREATE
|
TD_FILE_WRITE
|
TD_FILE_TRUNC
);
if
(
pFile
==
NULL
)
{
...
...
@@ -125,7 +124,6 @@ int32_t mmWriteFile(SMgmtWrapper *pWrapper, SDCreateMnodeReq *pReq, bool deploye
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"{
\n
"
);
len
+=
snprintf
(
content
+
len
,
maxLen
-
len
,
"
\"
mnodes
\"
: [{
\n
"
);
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
if
(
pReq
!=
NULL
||
pMgmt
!=
NULL
)
{
int8_t
replica
=
(
pReq
!=
NULL
?
pReq
->
replica
:
pMgmt
->
replica
);
for
(
int32_t
i
=
0
;
i
<
replica
;
++
i
)
{
...
...
source/dnode/mgmt/mgmt_mnode/src/mmHandle.c
浏览文件 @
6296188f
...
...
@@ -16,15 +16,14 @@
#define _DEFAULT_SOURCE
#include "mmInt.h"
void
mmGetMonitorInfo
(
SMgmtWrapper
*
pWrapper
,
SMonMmInfo
*
mmInfo
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
static
void
mmGetMonitorInfo
(
SMnodeMgmt
*
pMgmt
,
SMonMmInfo
*
mmInfo
)
{
mndGetMonitorInfo
(
pMgmt
->
pMnode
,
&
mmInfo
->
cluster
,
&
mmInfo
->
vgroup
,
&
mmInfo
->
grant
);
}
int32_t
mmProcessGetMon
MmInfoReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
)
{
int32_t
mmProcessGetMon
itorInfoReq
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pReq
)
{
SMonMmInfo
mmInfo
=
{
0
};
mmGetMonitorInfo
(
p
Wrapper
,
&
mmInfo
);
dmGet
MonitorSys
Info
(
&
mmInfo
.
sys
);
mmGetMonitorInfo
(
p
Mgmt
,
&
mmInfo
);
dmGet
System
Info
(
&
mmInfo
.
sys
);
monGetLogs
(
&
mmInfo
.
log
);
int32_t
rspLen
=
tSerializeSMonMmInfo
(
NULL
,
0
,
&
mmInfo
);
...
...
@@ -46,15 +45,14 @@ int32_t mmProcessGetMonMmInfoReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq) {
return
0
;
}
void
mmGetMnodeLoads
(
SMgmtWrapper
*
pWrapper
,
SMonMloadInfo
*
pInfo
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
static
void
mmGetMnodeLoads
(
SMnodeMgmt
*
pMgmt
,
SMonMloadInfo
*
pInfo
)
{
pInfo
->
isMnode
=
1
;
mndGetLoad
(
pMgmt
->
pMnode
,
&
pInfo
->
load
);
}
int32_t
mmProcessGet
MnodeLoadsReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pReq
)
{
int32_t
mmProcessGet
LoadsReq
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pReq
)
{
SMonMloadInfo
mloads
=
{
0
};
mmGetMnodeLoads
(
p
Wrapper
,
&
mloads
);
mmGetMnodeLoads
(
p
Mgmt
,
&
mloads
);
int32_t
rspLen
=
tSerializeSMonMloadInfo
(
NULL
,
0
,
&
mloads
);
if
(
rspLen
<
0
)
{
...
...
@@ -74,8 +72,7 @@ int32_t mmProcessGetMnodeLoadsReq(SMgmtWrapper *pWrapper, SNodeMsg *pReq) {
return
0
;
}
int32_t
mmProcessCreateReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SDnode
*
pDnode
=
pWrapper
->
pDnode
;
int32_t
mmProcessCreateReq
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDCreateMnodeReq
createReq
=
{
0
};
...
...
@@ -84,14 +81,14 @@ int32_t mmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
return
-
1
;
}
if
(
createReq
.
replica
<=
1
||
createReq
.
dnodeId
!=
p
Dnode
->
data
.
dnodeId
)
{
if
(
createReq
.
replica
<=
1
||
createReq
.
dnodeId
!=
p
Mgmt
->
dnodeId
)
{
terrno
=
TSDB_CODE_INVALID_OPTION
;
dError
(
"failed to create mnode since %s"
,
terrstr
());
return
-
1
;
}
bool
deployed
=
true
;
if
(
mmWriteFile
(
p
Wrapper
,
&
createReq
,
deployed
)
!=
0
)
{
if
(
mmWriteFile
(
p
Mgmt
,
&
createReq
,
deployed
)
!=
0
)
{
dError
(
"failed to write mnode file since %s"
,
terrstr
());
return
-
1
;
}
...
...
@@ -99,8 +96,7 @@ int32_t mmProcessCreateReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
return
0
;
}
int32_t
mmProcessDropReq
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SDnode
*
pDnode
=
pWrapper
->
pDnode
;
int32_t
mmProcessDropReq
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDDropMnodeReq
dropReq
=
{
0
};
...
...
@@ -109,14 +105,14 @@ int32_t mmProcessDropReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
return
-
1
;
}
if
(
dropReq
.
dnodeId
!=
p
Dnode
->
data
.
dnodeId
)
{
if
(
dropReq
.
dnodeId
!=
p
Mgmt
->
dnodeId
)
{
terrno
=
TSDB_CODE_INVALID_OPTION
;
dError
(
"failed to drop mnode since %s"
,
terrstr
());
return
-
1
;
}
bool
deployed
=
false
;
if
(
mmWriteFile
(
p
Wrapper
,
NULL
,
deployed
)
!=
0
)
{
if
(
mmWriteFile
(
p
Mgmt
,
NULL
,
deployed
)
!=
0
)
{
dError
(
"failed to write mnode file since %s"
,
terrstr
());
return
-
1
;
}
...
...
@@ -125,7 +121,6 @@ int32_t mmProcessDropReq(SMgmtWrapper *pWrapper, SNodeMsg *pMsg) {
}
int32_t
mmProcessAlterReq
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
SDnode
*
pDnode
=
pMgmt
->
pDnode
;
SRpcMsg
*
pReq
=
&
pMsg
->
rpcMsg
;
SDAlterMnodeReq
alterReq
=
{
0
};
...
...
@@ -134,104 +129,118 @@ int32_t mmProcessAlterReq(SMnodeMgmt *pMgmt, SNodeMsg *pMsg) {
return
-
1
;
}
if
(
p
Dnode
->
data
.
dnodeId
!=
0
&&
alterReq
.
dnodeId
!=
pDnode
->
data
.
dnodeId
)
{
if
(
p
Mgmt
->
dnodeId
!=
0
&&
alterReq
.
dnodeId
!=
pMgmt
->
dnodeId
)
{
terrno
=
TSDB_CODE_INVALID_OPTION
;
dError
(
"failed to alter mnode since %s, input:%d cur:%d"
,
terrstr
(),
alterReq
.
dnodeId
,
p
Dnode
->
data
.
dnodeId
);
dError
(
"failed to alter mnode since %s, input:%d cur:%d"
,
terrstr
(),
alterReq
.
dnodeId
,
p
Mgmt
->
dnodeId
);
return
-
1
;
}
else
{
return
mmAlter
(
pMgmt
,
&
alterReq
);
}
}
void
mmInitMsgHandle
(
SMgmtWrapper
*
pWrapper
)
{
dmSetMsgHandle
(
pWrapper
,
TDMT_MON_MM_INFO
,
mmProcessMonitorMsg
,
0
);
dmSetMsgHandle
(
pWrapper
,
TDMT_MON_MM_LOAD
,
mmProcessMonitorMsg
,
0
);
SArray
*
mmGetMsgHandles
()
{
int32_t
code
=
-
1
;
SArray
*
pArray
=
taosArrayInit
(
64
,
sizeof
(
SMgmtHandle
));
if
(
pArray
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MON_MM_INFO
,
mmPutNodeMsgToMonitorQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MON_MM_LOAD
,
mmPutNodeMsgToMonitorQueue
,
0
)
==
NULL
)
goto
_OVER
;
// Requests handled by DNODE
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_MNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_MNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_MNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_QNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_QNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_SNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_SNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_BNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_BNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_VNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_VNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_CONFIG_DNODE_RSP
,
mmProcessWriteMsg
,
0
)
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_CREATE_MNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_ALTER_MNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_DROP_MNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_CREATE_QNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_DROP_QNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_CREATE_SNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_DROP_SNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_CREATE_BNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_DROP_BNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_CREATE_VNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_DROP_VNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_CONFIG_DNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
// Requests handled by MNODE
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CONNECT
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_ACCT
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_ACCT
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_ACCT
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_USER
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_USER
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_USER
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_GET_USER_AUTH
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_DNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CONFIG_DNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_DNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_MNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_MNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_QNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_QNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_QNODE_LIST
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_SNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_SNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_BNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_BNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_DB
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_DB
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_USE_DB
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_DB
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_COMPACT_DB
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_FUNC
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_RETRIEVE_FUNC
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_FUNC
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_STB
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_STB
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_STB
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_SMA
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_SMA
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_TABLE_META
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_VGROUP_LIST
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_QUERY
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_CONN
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_HEARTBEAT
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_SYSTABLE_RETRIEVE
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_STATUS
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_TRANS
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_GRANT
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_AUTH
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_MNODE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_TOPIC
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_TOPIC
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_TOPIC
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_SUBSCRIBE
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_MQ_COMMIT_OFFSET
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_MQ_ASK_EP
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_VG_CHANGE_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_STREAM
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_TASK_DEPLOY_RSP
,
mmProcessWriteMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_GET_DB_CFG
,
mmProcessReadMsg
,
0
)
;
dmSetMsgHandle
(
pWrapper
,
TDMT_MND_GET_INDEX
,
mmProcessReadMsg
,
0
)
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CONNECT
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_ACCT
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_ALTER_ACCT
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_ACCT
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_USER
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_ALTER_USER
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_USER
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_GET_USER_AUTH
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_DNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CONFIG_DNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_DNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_MNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_MNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_QNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_QNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_QNODE_LIST
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_SNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_SNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_BNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_BNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_DB
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_DB
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_USE_DB
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_ALTER_DB
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_COMPACT_DB
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_FUNC
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_RETRIEVE_FUNC
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_FUNC
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_STB
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_ALTER_STB
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_STB
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_SMA
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_SMA
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_TABLE_META
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_VGROUP_LIST
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_KILL_QUERY
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_KILL_CONN
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_HEARTBEAT
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_SYSTABLE_RETRIEVE
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_STATUS
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_KILL_TRANS
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_GRANT
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_AUTH
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_DND_ALTER_MNODE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_TOPIC
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_ALTER_TOPIC
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_DROP_TOPIC
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_SUBSCRIBE
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_MQ_COMMIT_OFFSET
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_MQ_ASK_EP
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_MQ_VG_CHANGE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_CREATE_STREAM
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_TASK_DEPLOY_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_GET_DB_CFG
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_MND_GET_INDEX
,
mmPutNodeMsgToReadQueue
,
0
)
==
NULL
)
goto
_OVER
;
// Requests handled by VNODE
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_STB_RSP
,
mmProcessWriteMsg
,
0
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_STB_RSP
,
mmProcessWriteMsg
,
0
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_STB_RSP
,
mmProcessWriteMsg
,
0
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_SMA_RSP
,
mmProcessWriteMsg
,
0
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_SMA_RSP
,
mmProcessWriteMsg
,
0
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY
,
mmProcessQueryMsg
,
1
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_CONTINUE
,
mmProcessQueryMsg
,
1
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH
,
mmProcessQueryMsg
,
1
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_TASK
,
mmProcessQueryMsg
,
1
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_HEARTBEAT
,
mmProcessQueryMsg
,
1
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_VNODE_RSP
,
mmProcessWriteMsg
,
0
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_SYNC_VNODE_RSP
,
mmProcessWriteMsg
,
0
);
dmSetMsgHandle
(
pWrapper
,
TDMT_VND_COMPACT_VNODE_RSP
,
mmProcessWriteMsg
,
0
);
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_CREATE_STB_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_ALTER_STB_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_DROP_STB_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_CREATE_SMA_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_DROP_SMA_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_QUERY
,
mmPutNodeMsgToQueryQueue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_QUERY_CONTINUE
,
mmPutNodeMsgToQueryQueue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_FETCH
,
mmPutNodeMsgToQueryQueue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_DROP_TASK
,
mmPutNodeMsgToQueryQueue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_QUERY_HEARTBEAT
,
mmPutNodeMsgToQueryQueue
,
1
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_ALTER_VNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_SYNC_VNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
if
(
dmSetMgmtHandle
(
pArray
,
TDMT_VND_COMPACT_VNODE_RSP
,
mmPutNodeMsgToWriteQueue
,
0
)
==
NULL
)
goto
_OVER
;
code
=
0
;
_OVER:
if
(
code
!=
0
)
{
taosArrayDestroy
(
pArray
);
return
NULL
;
}
else
{
return
pArray
;
}
}
source/dnode/mgmt/mgmt_mnode/src/mmInt.c
浏览文件 @
6296188f
...
...
@@ -17,45 +17,35 @@
#include "mmInt.h"
#include "wal.h"
static
bool
mmDeployRequired
(
SDnode
*
pDnode
)
{
if
(
p
Dnode
->
data
.
dnodeId
>
0
)
return
false
;
if
(
p
Dnode
->
data
.
clusterId
>
0
)
return
false
;
if
(
strcmp
(
p
Dnode
->
data
.
localEp
,
pDnode
->
data
.
firstEp
)
!=
0
)
return
false
;
static
bool
mmDeployRequired
(
const
SMgmtInputOpt
*
pInput
)
{
if
(
p
Input
->
dnodeId
>
0
)
return
false
;
if
(
p
Input
->
clusterId
>
0
)
return
false
;
if
(
strcmp
(
p
Input
->
localEp
,
pInput
->
firstEp
)
!=
0
)
return
false
;
return
true
;
}
static
int32_t
mmRequire
(
SMgmtWrapper
*
pWrapper
,
bool
*
required
)
{
static
int32_t
mmRequire
(
const
SMgmtInputOpt
*
pInput
,
bool
*
required
)
{
SMnodeMgmt
mgmt
=
{
0
};
mgmt
.
path
=
p
Wrapper
->
path
;
mgmt
.
path
=
p
Input
->
path
;
if
(
mmReadFile
(
&
mgmt
,
required
)
!=
0
)
{
return
-
1
;
}
if
(
!
(
*
required
))
{
*
required
=
mmDeployRequired
(
p
Wrapper
->
pDnode
);
*
required
=
mmDeployRequired
(
p
Input
);
}
return
0
;
}
static
void
mmInitOption
(
SMnodeMgmt
*
pMgmt
,
SMnodeOpt
*
pOption
)
{
SMsgCb
msgCb
=
pMgmt
->
pDnode
->
data
.
msgCb
;
msgCb
.
pWrapper
=
pMgmt
->
pWrapper
;
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
mmPutMsgToQueryQueue
;
msgCb
.
queueFps
[
READ_QUEUE
]
=
mmPutMsgToReadQueue
;
msgCb
.
queueFps
[
WRITE_QUEUE
]
=
mmPutMsgToWriteQueue
;
msgCb
.
queueFps
[
SYNC_QUEUE
]
=
mmPutMsgToWriteQueue
;
pOption
->
msgCb
=
msgCb
;
}
static
void
mmBuildOptionForDeploy
(
SMnodeMgmt
*
pMgmt
,
SMnodeOpt
*
pOption
)
{
mmInitOption
(
pMgmt
,
pOption
);
static
void
mmBuildOptionForDeploy
(
SMnodeMgmt
*
pMgmt
,
const
SMgmtInputOpt
*
pInput
,
SMnodeOpt
*
pOption
)
{
pOption
->
msgCb
=
pMgmt
->
msgCb
;
pOption
->
replica
=
1
;
pOption
->
selfIndex
=
0
;
SReplica
*
pReplica
=
&
pOption
->
replicas
[
0
];
pReplica
->
id
=
1
;
pReplica
->
port
=
p
Mgmt
->
pDnode
->
data
.
serverPort
;
tstrncpy
(
pReplica
->
fqdn
,
p
Mgmt
->
pDnode
->
data
.
localFqdn
,
TSDB_FQDN_LEN
);
pReplica
->
port
=
p
Input
->
serverPort
;
tstrncpy
(
pReplica
->
fqdn
,
p
Input
->
localFqdn
,
TSDB_FQDN_LEN
);
pOption
->
deploy
=
true
;
pMgmt
->
selfIndex
=
pOption
->
selfIndex
;
...
...
@@ -64,7 +54,7 @@ static void mmBuildOptionForDeploy(SMnodeMgmt *pMgmt, SMnodeOpt *pOption) {
}
static
void
mmBuildOptionForOpen
(
SMnodeMgmt
*
pMgmt
,
SMnodeOpt
*
pOption
)
{
mmInitOption
(
pMgmt
,
pOption
)
;
pOption
->
msgCb
=
pMgmt
->
msgCb
;
pOption
->
selfIndex
=
pMgmt
->
selfIndex
;
pOption
->
replica
=
pMgmt
->
replica
;
memcpy
(
&
pOption
->
replicas
,
pMgmt
->
replicas
,
sizeof
(
SReplica
)
*
TSDB_MAX_REPLICA
);
...
...
@@ -72,8 +62,7 @@ static void mmBuildOptionForOpen(SMnodeMgmt *pMgmt, SMnodeOpt *pOption) {
}
static
int32_t
mmBuildOptionFromReq
(
SMnodeMgmt
*
pMgmt
,
SMnodeOpt
*
pOption
,
SDCreateMnodeReq
*
pCreate
)
{
mmInitOption
(
pMgmt
,
pOption
);
pOption
->
msgCb
=
pMgmt
->
msgCb
;
pOption
->
replica
=
pCreate
->
replica
;
pOption
->
selfIndex
=
-
1
;
for
(
int32_t
i
=
0
;
i
<
pCreate
->
replica
;
++
i
)
{
...
...
@@ -81,7 +70,7 @@ static int32_t mmBuildOptionFromReq(SMnodeMgmt *pMgmt, SMnodeOpt *pOption, SDCre
pReplica
->
id
=
pCreate
->
replicas
[
i
].
id
;
pReplica
->
port
=
pCreate
->
replicas
[
i
].
port
;
memcpy
(
pReplica
->
fqdn
,
pCreate
->
replicas
[
i
].
fqdn
,
TSDB_FQDN_LEN
);
if
(
pReplica
->
id
==
pMgmt
->
pDnode
->
data
.
dnodeId
)
{
if
(
pReplica
->
id
==
pMgmt
->
dnodeId
)
{
pOption
->
selfIndex
=
i
;
}
}
...
...
@@ -109,7 +98,7 @@ int32_t mmAlter(SMnodeMgmt *pMgmt, SDAlterMnodeReq *pReq) {
}
bool
deployed
=
true
;
if
(
mmWriteFile
(
pMgmt
->
pWrapper
,
pReq
,
deployed
)
!=
0
)
{
if
(
mmWriteFile
(
pMgmt
,
pReq
,
deployed
)
!=
0
)
{
dError
(
"failed to write mnode file since %s"
,
terrstr
());
return
-
1
;
}
...
...
@@ -117,10 +106,7 @@ int32_t mmAlter(SMnodeMgmt *pMgmt, SDAlterMnodeReq *pReq) {
return
0
;
}
static
void
mmClose
(
SMgmtWrapper
*
pWrapper
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
if
(
pMgmt
==
NULL
)
return
;
static
void
mmClose
(
SMnodeMgmt
*
pMgmt
)
{
dInfo
(
"mnode-mgmt start to cleanup"
);
if
(
pMgmt
->
pMnode
!=
NULL
)
{
mmStopWorker
(
pMgmt
);
...
...
@@ -128,12 +114,11 @@ static void mmClose(SMgmtWrapper *pWrapper) {
pMgmt
->
pMnode
=
NULL
;
}
pWrapper
->
pMgmt
=
NULL
;
taosMemoryFree
(
pMgmt
);
dInfo
(
"mnode-mgmt is cleaned up"
);
}
static
int32_t
mmOpen
(
SMgmtWrapper
*
pWrapper
)
{
static
int32_t
mmOpen
(
const
SMgmtInputOpt
*
pInput
,
SMgmtOutputOpt
*
pOutput
)
{
dInfo
(
"mnode-mgmt start to init"
);
if
(
walInit
()
!=
0
)
{
dError
(
"failed to init wal since %s"
,
terrstr
());
...
...
@@ -146,23 +131,28 @@ static int32_t mmOpen(SMgmtWrapper *pWrapper) {
return
-
1
;
}
pMgmt
->
path
=
pWrapper
->
path
;
pMgmt
->
pDnode
=
pWrapper
->
pDnode
;
pMgmt
->
pWrapper
=
pWrapper
;
pWrapper
->
pMgmt
=
pMgmt
;
pMgmt
->
path
=
pInput
->
path
;
pMgmt
->
name
=
pInput
->
name
;
pMgmt
->
dnodeId
=
pInput
->
dnodeId
;
pMgmt
->
msgCb
=
pInput
->
msgCb
;
pMgmt
->
msgCb
.
queueFps
[
QUERY_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToQueryQueue
;
pMgmt
->
msgCb
.
queueFps
[
READ_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToReadQueue
;
pMgmt
->
msgCb
.
queueFps
[
WRITE_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToWriteQueue
;
pMgmt
->
msgCb
.
queueFps
[
SYNC_QUEUE
]
=
(
PutToQueueFp
)
mmPutRpcMsgToWriteQueue
;
pMgmt
->
msgCb
.
pMgmt
=
pMgmt
;
bool
deployed
=
false
;
if
(
mmReadFile
(
pMgmt
,
&
deployed
)
!=
0
)
{
dError
(
"failed to read file since %s"
,
terrstr
());
mmClose
(
p
Wrapper
);
mmClose
(
p
Mgmt
);
return
-
1
;
}
SMnodeOpt
option
=
{
0
};
if
(
!
deployed
)
{
dInfo
(
"mnode start to deploy"
);
p
Wrapper
->
pDnode
->
data
.
dnodeId
=
1
;
mmBuildOptionForDeploy
(
pMgmt
,
&
option
);
p
Mgmt
->
dnodeId
=
1
;
mmBuildOptionForDeploy
(
pMgmt
,
pInput
,
&
option
);
}
else
{
dInfo
(
"mnode start to open"
);
mmBuildOptionForOpen
(
pMgmt
,
&
option
);
...
...
@@ -171,55 +161,52 @@ static int32_t mmOpen(SMgmtWrapper *pWrapper) {
pMgmt
->
pMnode
=
mndOpen
(
pMgmt
->
path
,
&
option
);
if
(
pMgmt
->
pMnode
==
NULL
)
{
dError
(
"failed to open mnode since %s"
,
terrstr
());
mmClose
(
p
Wrapper
);
mmClose
(
p
Mgmt
);
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"mnode-impl"
,
"initialized"
);
tmsgReportStartup
(
"mnode-impl"
,
"initialized"
);
if
(
mmStartWorker
(
pMgmt
)
!=
0
)
{
dError
(
"failed to start mnode worker since %s"
,
terrstr
());
mmClose
(
p
Wrapper
);
mmClose
(
p
Mgmt
);
return
-
1
;
}
dmReportStartup
(
pWrapper
->
pDnode
,
"mnode-worker"
,
"initialized"
);
tmsgReportStartup
(
"mnode-worker"
,
"initialized"
);
if
(
!
deployed
)
{
deployed
=
true
;
if
(
mmWriteFile
(
p
Wrapper
,
NULL
,
deployed
)
!=
0
)
{
if
(
mmWriteFile
(
p
Mgmt
,
NULL
,
deployed
)
!=
0
)
{
dError
(
"failed to write mnode file since %s"
,
terrstr
());
return
-
1
;
}
}
pOutput
->
dnodeId
=
pMgmt
->
dnodeId
;
pOutput
->
pMgmt
=
pMgmt
;
dInfo
(
"mnode-mgmt is initialized"
);
return
0
;
}
static
int32_t
mmStart
(
SM
gmtWrapper
*
pWrapper
)
{
static
int32_t
mmStart
(
SM
nodeMgmt
*
pMgmt
)
{
dDebug
(
"mnode-mgmt start to run"
);
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
return
mndStart
(
pMgmt
->
pMnode
);
}
static
void
mmStop
(
SM
gmtWrapper
*
pWrapper
)
{
static
void
mmStop
(
SM
nodeMgmt
*
pMgmt
)
{
dDebug
(
"mnode-mgmt start to stop"
);
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
if
(
pMgmt
!=
NULL
)
{
mndStop
(
pMgmt
->
pMnode
);
}
mndStop
(
pMgmt
->
pMnode
);
}
void
mmInitWrapper
(
SMgmtWrapper
*
pWrapper
)
{
SMgmtFp
mgmtFp
=
{
0
};
mgmtFp
.
openFp
=
mmOpen
;
mgmtFp
.
closeFp
=
mmClose
;
mgmtFp
.
startFp
=
mmStart
;
mgmtFp
.
stopFp
=
mmStop
;
mgmtFp
.
createFp
=
mmProcessCreateReq
;
mgmtFp
.
dropFp
=
mmProcessDropReq
;
mgmtFp
.
requiredFp
=
mmRequire
;
mmInitMsgHandle
(
pWrapper
);
pWrapper
->
name
=
"mnode"
;
pWrapper
->
fp
=
mgmtFp
;
SMgmtFunc
mmGetMgmtFunc
()
{
SMgmtFunc
mgmtFunc
=
{
0
};
mgmtFunc
.
openFp
=
mmOpen
;
mgmtFunc
.
closeFp
=
(
NodeCloseFp
)
mmClose
;
mgmtFunc
.
startFp
=
(
NodeStartFp
)
mmStart
;
mgmtFunc
.
stopFp
=
(
NodeStopFp
)
mmStop
;
mgmtFunc
.
createFp
=
(
NodeCreateFp
)
mmProcessCreateReq
;
mgmtFunc
.
dropFp
=
(
NodeDropFp
)
mmProcessDropReq
;
mgmtFunc
.
requiredFp
=
mmRequire
;
mgmtFunc
.
getHandlesFp
=
mmGetMsgHandles
;
return
mgmtFunc
;
}
source/dnode/mgmt/mgmt_mnode/src/mmWorker.c
浏览文件 @
6296188f
...
...
@@ -30,9 +30,9 @@ static inline void mmSendRsp(SNodeMsg *pMsg, int32_t code) {
static
void
mmProcessQueue
(
SQueueInfo
*
pInfo
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
tmsg_t
msgType
=
pMsg
->
rpcMsg
.
msgType
;
int32_t
code
=
-
1
;
tmsg_t
msgType
=
pMsg
->
rpcMsg
.
msgType
;
bool
isRequest
=
msgType
&
1U
;
dTrace
(
"msg:%p, get from mnode queue"
,
pMsg
);
switch
(
msgType
)
{
...
...
@@ -40,17 +40,17 @@ static void mmProcessQueue(SQueueInfo *pInfo, SNodeMsg *pMsg) {
code
=
mmProcessAlterReq
(
pMgmt
,
pMsg
);
break
;
case
TDMT_MON_MM_INFO
:
code
=
mmProcessGetMon
MmInfoReq
(
pMgmt
->
pWrapper
,
pMsg
);
code
=
mmProcessGetMon
itorInfoReq
(
pMgmt
,
pMsg
);
break
;
case
TDMT_MON_MM_LOAD
:
code
=
mmProcessGet
MnodeLoadsReq
(
pMgmt
->
pWrapper
,
pMsg
);
code
=
mmProcessGet
LoadsReq
(
pMgmt
,
pMsg
);
break
;
default:
pMsg
->
pNode
=
pMgmt
->
pMnode
;
code
=
mndProcessMsg
(
pMsg
);
}
if
(
msgType
&
1U
)
{
if
(
isRequest
)
{
if
(
pMsg
->
rpcMsg
.
handle
!=
NULL
&&
code
!=
TSDB_CODE_MND_ACTION_IN_PROGRESS
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
mmSendRsp
(
pMsg
,
code
);
...
...
@@ -64,62 +64,46 @@ static void mmProcessQueue(SQueueInfo *pInfo, SNodeMsg *pMsg) {
static
void
mmProcessQueryQueue
(
SQueueInfo
*
pInfo
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pInfo
->
ahandle
;
int32_t
code
=
-
1
;
tmsg_t
msgType
=
pMsg
->
rpcMsg
.
msgType
;
bool
isRequest
=
msgType
&
1U
;
dTrace
(
"msg:%p, get from mnode-query queue"
,
pMsg
);
SRpcMsg
*
pRpc
=
&
pMsg
->
rpcMsg
;
int32_t
code
=
-
1
;
pMsg
->
pNode
=
pMgmt
->
pMnode
;
code
=
mndProcessMsg
(
pMsg
);
if
(
pRpc
->
msgType
&
1U
)
{
if
(
p
Rpc
->
handle
!=
NULL
&&
code
!=
0
)
{
dError
(
"msg:%p, failed to process since %s"
,
pMsg
,
terrstr
())
;
if
(
isRequest
)
{
if
(
p
Msg
->
rpcMsg
.
handle
!=
NULL
&&
code
!=
0
)
{
if
(
code
!=
0
&&
terrno
!=
0
)
code
=
terrno
;
mmSendRsp
(
pMsg
,
code
);
}
}
dTrace
(
"msg:%p, is freed, result:0x%04x:%s"
,
pMsg
,
code
&
0XFFFF
,
tstrerror
(
code
));
rpcFreeCont
(
p
Rpc
->
pCont
);
rpcFreeCont
(
p
Msg
->
rpcMsg
.
pCont
);
taosFreeQitem
(
pMsg
);
}
static
void
mmPutNodeMsgToWorker
(
SSingleWorker
*
pWorker
,
SNodeMsg
*
pMsg
)
{
dTrace
(
"msg:%p, put into worker %s
"
,
pMsg
,
pWorker
->
name
);
static
int32_t
mmPutNodeMsgToWorker
(
SSingleWorker
*
pWorker
,
SNodeMsg
*
pMsg
)
{
dTrace
(
"msg:%p, put into worker %s
, type:%s"
,
pMsg
,
pWorker
->
name
,
TMSG_INFO
(
pMsg
->
rpcMsg
.
msgType
)
);
taosWriteQitem
(
pWorker
->
queue
,
pMsg
);
}
int32_t
mmProcessWriteMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
mmPutNodeMsgToWorker
(
&
pMgmt
->
writeWorker
,
pMsg
);
return
0
;
}
int32_t
mmProcessSyncMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
mmPutNodeMsgToWorker
(
&
pMgmt
->
syncWorker
,
pMsg
);
return
0
;
}
int32_t
mmPutNodeMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
writeWorker
,
pMsg
);
}
int32_t
mmProcessReadMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
mmPutNodeMsgToWorker
(
&
pMgmt
->
readWorker
,
pMsg
);
return
0
;
}
int32_t
mmPutNodeMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
syncWorker
,
pMsg
);
}
int32_t
mmProcessQueryMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
mmPutNodeMsgToWorker
(
&
pMgmt
->
queryWorker
,
pMsg
);
return
0
;
int32_t
mmPutNodeMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
readWorker
,
pMsg
);
}
int32_t
mmPutNodeMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
queryWorker
,
pMsg
);
}
int32_t
mmProcessMonitorMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
mmPutNodeMsgToWorker
(
&
pMgmt
->
monitorWorker
,
pMsg
);
return
0
;
int32_t
mmPutNodeMsgToMonitorQueue
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutNodeMsgToWorker
(
&
pMgmt
->
monitorWorker
,
pMsg
);
}
static
int32_t
mmPutRpcMsgToWorker
(
SSingleWorker
*
pWorker
,
SRpcMsg
*
pRpc
)
{
static
in
line
in
t32_t
mmPutRpcMsgToWorker
(
SSingleWorker
*
pWorker
,
SRpcMsg
*
pRpc
)
{
SNodeMsg
*
pMsg
=
taosAllocateQitem
(
sizeof
(
SNodeMsg
));
if
(
pMsg
==
NULL
)
return
-
1
;
...
...
@@ -129,25 +113,19 @@ static int32_t mmPutRpcMsgToWorker(SSingleWorker *pWorker, SRpcMsg *pRpc) {
return
0
;
}
int32_t
mmPutMsgToQueryQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
int32_t
mmPutRpcMsgToQueryQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
queryWorker
,
pRpc
);
}
int32_t
mmPutMsgToWriteQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
int32_t
mmPutRpcMsgToWriteQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
writeWorker
,
pRpc
);
}
int32_t
mmPutMsgToReadQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
int32_t
mmPutRpcMsgToReadQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
readWorker
,
pRpc
);
}
int32_t
mmPutMsgToSyncQueue
(
SMgmtWrapper
*
pWrapper
,
SRpcMsg
*
pRpc
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
syncWorker
,
pRpc
);
}
int32_t
mmPutMsgToSyncQueue
(
SMnodeMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
)
{
return
mmPutRpcMsgToWorker
(
&
pMgmt
->
syncWorker
,
pRpc
);
}
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
)
{
SSingleWorkerCfg
qCfg
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录