Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4b7baac9
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看板
提交
4b7baac9
编写于
3月 16, 2022
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shm
上级
58b64fcf
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
176 addition
and
193 deletion
+176
-193
source/dnode/mgmt/container/inc/dndInt.h
source/dnode/mgmt/container/inc/dndInt.h
+1
-1
source/dnode/mgmt/dnode/inc/dmWorker.h
source/dnode/mgmt/dnode/inc/dmWorker.h
+1
-1
source/dnode/mgmt/dnode/src/dmMsg.c
source/dnode/mgmt/dnode/src/dmMsg.c
+19
-19
source/dnode/mgmt/dnode/src/dmWorker.c
source/dnode/mgmt/dnode/src/dmWorker.c
+1
-3
source/dnode/mgmt/mnode/inc/mmWorker.h
source/dnode/mgmt/mnode/inc/mmWorker.h
+3
-3
source/dnode/mgmt/mnode/src/mmMsg.c
source/dnode/mgmt/mnode/src/mmMsg.c
+68
-68
source/dnode/mgmt/mnode/src/mmWorker.c
source/dnode/mgmt/mnode/src/mmWorker.c
+3
-6
source/dnode/mgmt/vnode/inc/vmWorker.h
source/dnode/mgmt/vnode/inc/vmWorker.h
+4
-4
source/dnode/mgmt/vnode/src/vmMsg.c
source/dnode/mgmt/vnode/src/vmMsg.c
+37
-37
source/dnode/mgmt/vnode/src/vmWorker.c
source/dnode/mgmt/vnode/src/vmWorker.c
+39
-51
未找到文件。
source/dnode/mgmt/container/inc/dndInt.h
浏览文件 @
4b7baac9
...
...
@@ -72,7 +72,7 @@ typedef struct SQnodeMgmt SQnodeMgmt;
typedef
struct
SSnodeMgmt
SSnodeMgmt
;
typedef
struct
SBnodeMgmt
SBnodeMgmt
;
typedef
int32_t
(
*
NodeMsgFp
)(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
typedef
int32_t
(
*
NodeMsgFp
)(
void
*
pMgmt
,
SNodeMsg
*
pMsg
);
typedef
int32_t
(
*
OpenNodeFp
)(
SMgmtWrapper
*
pWrapper
);
typedef
void
(
*
CloseNodeFp
)(
SMgmtWrapper
*
pWrapper
);
typedef
bool
(
*
RequireNodeFp
)(
SMgmtWrapper
*
pWrapper
);
...
...
source/dnode/mgmt/dnode/inc/dmWorker.h
浏览文件 @
4b7baac9
...
...
@@ -24,7 +24,7 @@ extern "C" {
int32_t
dmStartWorker
(
SDnodeMgmt
*
pMgmt
);
void
dmStopWorker
(
SDnodeMgmt
*
pMgmt
);
int32_t
dmProcessMgmtMsg
(
S
MgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
dmProcessMgmtMsg
(
S
DnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/dnode/src/dmMsg.c
浏览文件 @
4b7baac9
...
...
@@ -104,25 +104,25 @@ int32_t dmProcessConfigReq(SDnode *pDnode, SRpcMsg *pReq) {
void
dmInitMsgHandles
(
SMgmtWrapper
*
pWrapper
)
{
// Requests handled by DNODE
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_MNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_MNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_MNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_QNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_QNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_SNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_SNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_BNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_BNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_VNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_VNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_VNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_SYNC_VNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_COMPACT_VNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CONFIG_DNODE
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_NETWORK_TEST
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_MNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_MNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_MNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_QNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_QNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_SNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_SNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_BNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_BNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_VNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_VNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_VNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_SYNC_VNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_COMPACT_VNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CONFIG_DNODE
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_NETWORK_TEST
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
// Requests handled by MNODE
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_STATUS_RSP
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_GRANT_RSP
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_AUTH_RSP
,
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_STATUS_RSP
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_GRANT_RSP
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_AUTH_RSP
,
(
NodeMsgFp
)
dmProcessMgmtMsg
);
}
source/dnode/mgmt/dnode/src/dmWorker.c
浏览文件 @
4b7baac9
...
...
@@ -151,9 +151,7 @@ void dmStopWorker(SDnodeMgmt *pMgmt) {
}
}
int32_t
dmProcessMgmtMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SDnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
int32_t
dmProcessMgmtMsg
(
SDnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
SDnodeWorker
*
pWorker
=
&
pMgmt
->
mgmtWorker
;
if
(
pMsg
->
rpcMsg
.
msgType
==
TDMT_MND_STATUS_RSP
)
{
pWorker
=
&
pMgmt
->
statusWorker
;
...
...
source/dnode/mgmt/mnode/inc/mmWorker.h
浏览文件 @
4b7baac9
...
...
@@ -24,9 +24,9 @@ extern "C" {
int32_t
mmStartWorker
(
SMnodeMgmt
*
pMgmt
);
void
mmStopWorker
(
SMnodeMgmt
*
pMgmt
);
int32_t
mmProcessWriteMsg
(
SM
gmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessSyncMsg
(
SM
gmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessReadMsg
(
SM
gmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessWriteMsg
(
SM
nodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessSyncMsg
(
SM
nodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmProcessReadMsg
(
SM
nodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
mmPutMsgToWriteQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
int32_t
mmPutMsgToReadQueue
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpcMsg
);
...
...
source/dnode/mgmt/mnode/src/mmMsg.c
浏览文件 @
4b7baac9
...
...
@@ -122,76 +122,76 @@ int32_t mmProcessDropReq(SDnode *pDnode, SRpcMsg *pReq) {
void
mmInitMsgHandles
(
SMgmtWrapper
*
pWrapper
)
{
// Requests handled by DNODE
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_MNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_MNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_MNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_QNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_QNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_SNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_SNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_BNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_BNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_VNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_VNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_VNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_SYNC_VNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_COMPACT_VNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CONFIG_DNODE_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_MNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_MNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_MNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_QNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_QNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_SNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_SNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_BNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_BNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_VNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_VNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_VNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_SYNC_VNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_COMPACT_VNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CONFIG_DNODE_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
// Requests handled by MNODE
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CONNECT
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_ACCT
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_ACCT
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_ACCT
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_USER
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_USER
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_USER
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_GET_USER_AUTH
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_DNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CONFIG_DNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_DNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_MNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_MNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_QNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_QNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_SNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_SNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_BNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_BNODE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_DB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_DB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_USE_DB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_DB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_SYNC_DB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_COMPACT_DB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_FUNC
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_RETRIEVE_FUNC
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_FUNC
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_STB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_STB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_STB
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_TABLE_META
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_VGROUP_LIST
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_QUERY
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_CONN
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_HEARTBEAT
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_SHOW
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_SHOW_RETRIEVE
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_STATUS
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_TRANS
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_GRANT
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_AUTH
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_TOPIC
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_TOPIC
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_TOPIC
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_SUBSCRIBE
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_MQ_COMMIT_OFFSET
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_GET_SUB_EP
,
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CONNECT
,
(
NodeMsgFp
)
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_ACCT
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_ACCT
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_ACCT
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_USER
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_USER
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_USER
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_GET_USER_AUTH
,
(
NodeMsgFp
)
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_DNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CONFIG_DNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_DNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_MNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_MNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_QNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_QNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_SNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_SNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_BNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_BNODE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_DB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_DB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_USE_DB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_DB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_SYNC_DB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_COMPACT_DB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_FUNC
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_RETRIEVE_FUNC
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_FUNC
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_STB
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_TABLE_META
,
(
NodeMsgFp
)
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_VGROUP_LIST
,
(
NodeMsgFp
)
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_QUERY
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_CONN
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_HEARTBEAT
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_SHOW
,
(
NodeMsgFp
)
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_SHOW_RETRIEVE
,
(
NodeMsgFp
)
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_STATUS
,
(
NodeMsgFp
)
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_KILL_TRANS
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_GRANT
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_AUTH
,
(
NodeMsgFp
)
mmProcessReadMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_CREATE_TOPIC
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_ALTER_TOPIC
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_DROP_TOPIC
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_SUBSCRIBE
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_MQ_COMMIT_OFFSET
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_MND_GET_SUB_EP
,
(
NodeMsgFp
)
mmProcessReadMsg
);
// Requests handled by VNODE
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_SET_CONN_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_REB_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_STB_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_STB_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_STB_RSP
,
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_SET_CONN_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_REB_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_STB_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_STB_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_STB_RSP
,
(
NodeMsgFp
)
mmProcessWriteMsg
);
}
source/dnode/mgmt/mnode/src/mmWorker.c
浏览文件 @
4b7baac9
...
...
@@ -94,18 +94,15 @@ static int32_t mmPutMsgToWorker(SMnodeMgmt *pMgmt, SDnodeWorker *pWorker, SNodeM
return
code
;
}
int32_t
mmProcessWriteMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
int32_t
mmProcessWriteMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutMsgToWorker
(
pMgmt
,
&
pMgmt
->
writeWorker
,
pMsg
);
}
int32_t
mmProcessSyncMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
int32_t
mmProcessSyncMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutMsgToWorker
(
pMgmt
,
&
pMgmt
->
syncWorker
,
pMsg
);
}
int32_t
mmProcessReadMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
SMnodeMgmt
*
pMgmt
=
pWrapper
->
pMgmt
;
int32_t
mmProcessReadMsg
(
SMnodeMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
return
mmPutMsgToWorker
(
pMgmt
,
&
pMgmt
->
readWorker
,
pMsg
);
}
...
...
source/dnode/mgmt/vnode/inc/vmWorker.h
浏览文件 @
4b7baac9
...
...
@@ -30,10 +30,10 @@ void vmFreeQueue(SVnodesMgmt *pMgmt, SVnodeObj *pVnode);
int32_t
vmPutMsgToQueryQueue
(
SVnodesMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
);
int32_t
vmPutMsgToApplyQueue
(
SVnodesMgmt
*
pMgmt
,
int32_t
vgId
,
SRpcMsg
*
pMsg
);
int32_t
vmProcessWriteMsg
(
S
MgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
vmProcessSyncMsg
(
S
MgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
vmProcessQueryMsg
(
S
MgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
vmProcessFetchMsg
(
S
MgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
);
int32_t
vmProcessWriteMsg
(
S
VnodesMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
vmProcessSyncMsg
(
S
VnodesMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
vmProcessQueryMsg
(
S
VnodesMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
int32_t
vmProcessFetchMsg
(
S
VnodesMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
);
#ifdef __cplusplus
}
...
...
source/dnode/mgmt/vnode/src/vmMsg.c
浏览文件 @
4b7baac9
...
...
@@ -232,41 +232,41 @@ int32_t vmProcessCompactVnodeReq(SVnodesMgmt *pMgmt, SRpcMsg *pReq) {
void
vmInitMsgHandles
(
SMgmtWrapper
*
pWrapper
)
{
// Requests handled by VNODE
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_SUBMIT
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY
,
vmProcessQueryMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_CONTINUE
,
vmProcessQueryMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH_RSP
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_TABLE
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_UPDATE_TAG_VAL
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_TABLE_META
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_TABLES_META
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_CONSUME
,
vmProcessQueryMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_QUERY
,
vmProcessQueryMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_CONNECT
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_DISCONNECT
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_SET_CUR
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_RES_READY
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_TASKS_STATUS
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CANCEL_TASK
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_TASK
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_STB
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_STB
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_STB
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_TABLE
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_TABLE
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_TABLE
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_SHOW_TABLES
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_SHOW_TABLES_FETCH
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_SET_CONN
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_REB
,
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_SET_CUR
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CONSUME
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_HEARTBEAT
,
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_VNODE
,
vmProcessCreateVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_VNODE
,
vmProcessAlterVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_VNODE
,
vmProcessDropVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_SYNC_VNODE
,
vmProcessSyncVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_COMPACT_VNODE
,
vmProcessCompactVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_SUBMIT
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY
,
(
NodeMsgFp
)
vmProcessQueryMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_CONTINUE
,
(
NodeMsgFp
)
vmProcessQueryMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_FETCH_RSP
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_TABLE
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_UPDATE_TAG_VAL
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_TABLE_META
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_TABLES_META
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_CONSUME
,
(
NodeMsgFp
)
vmProcessQueryMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_QUERY
,
(
NodeMsgFp
)
vmProcessQueryMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_CONNECT
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_DISCONNECT
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_SET_CUR
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_RES_READY
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_TASKS_STATUS
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CANCEL_TASK
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_TASK
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_STB
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_STB
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_STB
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CREATE_TABLE
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_ALTER_TABLE
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_DROP_TABLE
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_SHOW_TABLES
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_SHOW_TABLES_FETCH
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_SET_CONN
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_REB
,
(
NodeMsgFp
)
vmProcessWriteMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_MQ_SET_CUR
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_CONSUME
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_VND_QUERY_HEARTBEAT
,
(
NodeMsgFp
)
vmProcessFetchMsg
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_CREATE_VNODE
,
(
NodeMsgFp
)
vmProcessCreateVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_ALTER_VNODE
,
(
NodeMsgFp
)
vmProcessAlterVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_DROP_VNODE
,
(
NodeMsgFp
)
vmProcessDropVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_SYNC_VNODE
,
(
NodeMsgFp
)
vmProcessSyncVnodeReq
);
dndSetMsgHandle
(
pWrapper
,
TDMT_DND_COMPACT_VNODE
,
(
NodeMsgFp
)
vmProcessCompactVnodeReq
);
}
source/dnode/mgmt/vnode/src/vmWorker.c
浏览文件 @
4b7baac9
...
...
@@ -80,35 +80,23 @@ static void vmProcessSyncQueue(SVnodeObj *pVnode, STaosQall *qall, int32_t numOf
}
}
static
int32_t
vmWriteMsgToQueue
(
STaosQueue
*
pQueue
,
SRpcMsg
*
pRpcMsg
,
bool
sendRsp
)
{
int32_t
code
=
0
;
if
(
pQueue
==
NULL
)
{
code
=
TSDB_CODE_MSG_NOT_PROCESSED
;
}
else
{
SRpcMsg
*
pMsg
=
taosAllocateQitem
(
sizeof
(
SRpcMsg
));
if
(
pMsg
==
NULL
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
else
{
*
pMsg
=
*
pRpcMsg
;
if
(
taosWriteQitem
(
pQueue
,
pMsg
)
!=
0
)
{
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
}
}
static
int32_t
vmWriteMsgToQueue
(
STaosQueue
*
pQueue
,
SNodeMsg
*
pMsg
,
bool
sendRsp
)
{
int32_t
code
=
taosWriteQitem
(
pQueue
,
pMsg
);
if
(
code
!=
TSDB_CODE_SUCCESS
&&
sendRsp
)
{
if
(
p
RpcMsg
->
msgType
&
1u
)
{
SRpcMsg
rsp
=
{.
handle
=
p
RpcMsg
->
handle
,
.
code
=
code
};
if
(
p
Msg
->
rpcMsg
.
msgType
&
1u
)
{
SRpcMsg
rsp
=
{.
handle
=
p
Msg
->
rpcMsg
.
handle
,
.
code
=
code
};
rpcSendResponse
(
&
rsp
);
}
rpcFreeCont
(
p
RpcMsg
->
pCont
);
rpcFreeCont
(
p
Msg
->
rpcMsg
.
pCont
);
}
return
code
;
}
static
SVnodeObj
*
vmAcquireFromMsg
(
SVnodesMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
static
SVnodeObj
*
vmAcquireFromMsg
(
SVnodesMgmt
*
pMgmt
,
SNodeMsg
*
pNodeMsg
)
{
SRpcMsg
*
pMsg
=
&
pNodeMsg
->
rpcMsg
;
SMsgHead
*
pHead
=
pMsg
->
pCont
;
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
pHead
->
vgId
=
htonl
(
pHead
->
vgId
);
...
...
@@ -126,50 +114,50 @@ static SVnodeObj *vmAcquireFromMsg(SVnodesMgmt *pMgmt, SRpcMsg *pMsg) {
return
pVnode
;
}
int32_t
vmProcessWriteMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
// SVnodeObj *pVnode = vmAcquireFromMsg(pDnode, pMsg);
// if (pVnode != NULL) {
// (void)vmWriteMsgToQueue(pVnode->pWriteQ, pMsg, true);
// vmReleaseVnode(pMgmt, pVnode);
// }
return
0
;
int32_t
vmProcessWriteMsg
(
SVnodesMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
vmAcquireFromMsg
(
pMgmt
,
pMsg
);
if
(
pVnode
!=
NULL
)
{
(
void
)
vmWriteMsgToQueue
(
pVnode
->
pWriteQ
,
pMsg
,
true
);
vmReleaseVnode
(
pMgmt
,
pVnode
);
}
}
int32_t
vmProcessSyncMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
// SVnodeObj *pVnode = vmAcquireFromMsg(pDnode, pMsg);
// if (pVnode != NULL) {
// (void)vmWriteMsgToQueue(pVnode->pSyncQ, pMsg, true);
// vmReleaseVnode(pMgmt, pVnode);
// }
return
0
;
int32_t
vmProcessSyncMsg
(
SVnodesMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
vmAcquireFromMsg
(
pMgmt
,
pMsg
);
if
(
pVnode
!=
NULL
)
{
(
void
)
vmWriteMsgToQueue
(
pVnode
->
pSyncQ
,
pMsg
,
true
);
vmReleaseVnode
(
pMgmt
,
pVnode
);
}
}
int32_t
vmProcessQueryMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
)
{
// SVnodeObj *pVnode = vmAcquireFromMsg(pDnode, pMsg);
// if (pVnode != NULL) {
// (void)vmWriteMsgToQueue(pVnode->pQueryQ, pMsg, true);
// vmReleaseVnode(pMgmt, pVnode);
// }
return
0
;
int32_t
vmProcessQueryMsg
(
SVnodesMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
vmAcquireFromMsg
(
pMgmt
,
pMsg
);
if
(
pVnode
!=
NULL
)
{
(
void
)
vmWriteMsgToQueue
(
pVnode
->
pQueryQ
,
pMsg
,
true
);
vmReleaseVnode
(
pMgmt
,
pVnode
);
}
}
int32_t
vmProcessFetchMsg
(
SMgmtWrapper
*
pWrapper
,
SNodeMsg
*
pMsg
){
// SVnodeObj *pVnode = vmAcquireFromMsg(pDnode, pMsg);
// if (pVnode != NULL) {
// (void)vmWriteMsgToQueue(pVnode->pFetchQ, pMsg, true);
// vmReleaseVnode(pMgmt, pVnode);
// }
return
0
;
int32_t
vmProcessFetchMsg
(
SVnodesMgmt
*
pMgmt
,
SNodeMsg
*
pMsg
)
{
SVnodeObj
*
pVnode
=
vmAcquireFromMsg
(
pMgmt
,
pMsg
);
if
(
pVnode
!=
NULL
)
{
(
void
)
vmWriteMsgToQueue
(
pVnode
->
pFetchQ
,
pMsg
,
true
);
vmReleaseVnode
(
pMgmt
,
pVnode
);
}
}
int32_t
vmPutMsgToQueryQueue
(
SVnodesMgmt
*
pMgmt
,
SRpcMsg
*
pMsg
)
{
SMsgHead
*
pHead
=
pMsg
->
pCont
;
int32_t
vmPutMsgToQueryQueue
(
SVnodesMgmt
*
pMgmt
,
SRpcMsg
*
pRpc
)
{
int32_t
code
=
-
1
;
SMsgHead
*
pHead
=
pRpc
->
pCont
;
// pHead->vgId = htonl(pHead->vgId);
SVnodeObj
*
pVnode
=
vmAcquireVnode
(
pMgmt
,
pHead
->
vgId
);
if
(
pVnode
==
NULL
)
return
-
1
;
int32_t
code
=
vmWriteMsgToQueue
(
pVnode
->
pQueryQ
,
pMsg
,
false
);
SNodeMsg
*
pMsg
=
taosAllocateQitem
(
sizeof
(
SNodeMsg
));
if
(
pMsg
!=
NULL
)
{
code
=
vmWriteMsgToQueue
(
pVnode
->
pQueryQ
,
pMsg
,
false
);
}
vmReleaseVnode
(
pMgmt
,
pVnode
);
return
code
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录