提交 fe655245 编写于 作者: S Shengliang

refactor: node mgmt

上级 1b15f93b
......@@ -73,7 +73,7 @@ int32_t bmOpen(SMgmtWrapper *pWrapper) {
return 0;
}
void bmSetMgmtFp(SMgmtWrapper *pWrapper) {
void bmInitWrapper(SMgmtWrapper *pWrapper) {
SMgmtFp mgmtFp = {0};
mgmtFp.openFp = bmOpen;
mgmtFp.closeFp = bmClose;
......
......@@ -209,7 +209,7 @@ static void mmStop(SMgmtWrapper *pWrapper) {
}
}
void mmSetMgmtFp(SMgmtWrapper *pWrapper) {
void mmInitWrapper(SMgmtWrapper *pWrapper) {
SMgmtFp mgmtFp = {0};
mgmtFp.openFp = mmOpen;
mgmtFp.closeFp = mmClose;
......
......@@ -77,7 +77,7 @@ static int32_t qmOpen(SMgmtWrapper *pWrapper) {
return 0;
}
void qmSetMgmtFp(SMgmtWrapper *pWrapper) {
void qmInitWrapper(SMgmtWrapper *pWrapper) {
SMgmtFp mgmtFp = {0};
mgmtFp.openFp = qmOpen;
mgmtFp.closeFp = qmClose;
......
......@@ -79,7 +79,7 @@ int32_t smOpen(SMgmtWrapper *pWrapper) {
return 0;
}
void smSetMgmtFp(SMgmtWrapper *pWrapper) {
void smInitWrapper(SMgmtWrapper *pWrapper) {
SMgmtFp mgmtFp = {0};
mgmtFp.openFp = smOpen;
mgmtFp.closeFp = smClose;
......
......@@ -371,7 +371,7 @@ static void vmStop(SMgmtWrapper *pWrapper) {
// process inside the vnode
}
void vmSetMgmtFp(SMgmtWrapper *pWrapper) {
void vmInitWrapper(SMgmtWrapper *pWrapper) {
SMgmtFp mgmtFp = {0};
mgmtFp.openFp = vmInit;
mgmtFp.closeFp = vmCleanup;
......
......@@ -80,13 +80,13 @@ typedef enum {
} EDndProcType;
typedef int32_t (*NodeMsgFp)(struct SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
typedef int32_t (*OpenNodeFp)(struct SMgmtWrapper *pWrapper);
typedef void (*CloseNodeFp)(struct SMgmtWrapper *pWrapper);
typedef int32_t (*StartNodeFp)(struct SMgmtWrapper *pWrapper);
typedef void (*StopNodeFp)(struct SMgmtWrapper *pWrapper);
typedef int32_t (*CreateNodeFp)(struct SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
typedef int32_t (*DropNodeFp)(struct SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
typedef int32_t (*RequireNodeFp)(struct SMgmtWrapper *pWrapper, bool *required);
typedef int32_t (*NodeOpenFp)(struct SMgmtWrapper *pWrapper);
typedef void (*NodeCloseFp)(struct SMgmtWrapper *pWrapper);
typedef int32_t (*NodeStartFp)(struct SMgmtWrapper *pWrapper);
typedef void (*NodeStopFp)(struct SMgmtWrapper *pWrapper);
typedef int32_t (*NodeCreateFp)(struct SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
typedef int32_t (*NodeDropFp)(struct SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
typedef int32_t (*NodeRequireFp)(struct SMgmtWrapper *pWrapper, bool *required);
typedef struct {
EDndNodeType defaultNtype;
......@@ -94,13 +94,13 @@ typedef struct {
} SMsgHandle;
typedef struct {
OpenNodeFp openFp;
CloseNodeFp closeFp;
StartNodeFp startFp;
StopNodeFp stopFp;
CreateNodeFp createFp;
DropNodeFp dropFp;
RequireNodeFp requiredFp;
NodeOpenFp openFp;
NodeCloseFp closeFp;
NodeStartFp startFp;
NodeStopFp stopFp;
NodeCreateFp createFp;
NodeDropFp dropFp;
NodeRequireFp requiredFp;
} SMgmtFp;
typedef struct SMgmtWrapper {
......
......@@ -65,12 +65,12 @@ int32_t dmProcessMgmtMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
int32_t dmProcessStatusMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
// mgmt nodes
void dmSetMgmtFp(SMgmtWrapper *pWrapper);
void bmSetMgmtFp(SMgmtWrapper *pWrapper);
void qmSetMgmtFp(SMgmtWrapper *pWrapper);
void smSetMgmtFp(SMgmtWrapper *pWrapper);
void vmSetMgmtFp(SMgmtWrapper *pWrapper);
void mmSetMgmtFp(SMgmtWrapper *pWrapper);
void dmInitWrapper(SMgmtWrapper *pWrapper);
void bmInitWrapper(SMgmtWrapper *pWrapper);
void qmInitWrapper(SMgmtWrapper *pWrapper);
void smInitWrapper(SMgmtWrapper *pWrapper);
void vmInitWrapper(SMgmtWrapper *pWrapper);
void mmInitWrapper(SMgmtWrapper *pWrapper);
void vmGetVnodeLoads(SMgmtWrapper *pWrapper, SMonVloadInfo *pInfo);
void mmGetMnodeLoads(SMgmtWrapper *pWrapper, SMonMloadInfo *pInfo);
......
......@@ -295,7 +295,7 @@ static int32_t dmRequireMgmt(SMgmtWrapper *pWrapper, bool *required) {
return 0;
}
void dmSetMgmtFp(SMgmtWrapper *pWrapper) {
void dmInitWrapper(SMgmtWrapper *pWrapper) {
SMgmtFp mgmtFp = {0};
mgmtFp.openFp = dmInitMgmt;
mgmtFp.closeFp = dmCleanupMgmt;
......
......@@ -91,12 +91,12 @@ SDnode *dmCreate(const SDnodeOpt *pOption) {
}
dmSetStatus(pDnode, DND_STAT_INIT);
dmSetMgmtFp(&pDnode->wrappers[DNODE]);
mmSetMgmtFp(&pDnode->wrappers[MNODE]);
vmSetMgmtFp(&pDnode->wrappers[VNODE]);
qmSetMgmtFp(&pDnode->wrappers[QNODE]);
smSetMgmtFp(&pDnode->wrappers[SNODE]);
bmSetMgmtFp(&pDnode->wrappers[BNODE]);
dmInitWrapper(&pDnode->wrappers[DNODE]);
mmInitWrapper(&pDnode->wrappers[MNODE]);
vmInitWrapper(&pDnode->wrappers[VNODE]);
qmInitWrapper(&pDnode->wrappers[QNODE]);
smInitWrapper(&pDnode->wrappers[SNODE]);
bmInitWrapper(&pDnode->wrappers[BNODE]);
for (EDndNodeType ntype = DNODE; ntype < NODE_END; ++ntype) {
SMgmtWrapper *pWrapper = &pDnode->wrappers[ntype];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册