dmImp.h 3.1 KB
Newer Older
S
Shengliang Guan 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

S
Shengliang Guan 已提交
16 17
#ifndef _TD_DND_IMP_H_
#define _TD_DND_IMP_H_
S
Shengliang Guan 已提交
18

S
Shengliang Guan 已提交
19
#include "dmInt.h"
S
Shengliang Guan 已提交
20 21 22 23 24

#ifdef __cplusplus
extern "C" {
#endif

S
Shengliang Guan 已提交
25 26
int32_t dmOpenNode(SMgmtWrapper *pWrapper);
void    dmCloseNode(SMgmtWrapper *pWrapper);
S
Shengliang Guan 已提交
27

S
Shengliang Guan 已提交
28
// dmTransport.c
S
Shengliang Guan 已提交
29
int32_t  dmInitTrans(SDnode *pDnode);
S
Shengliang Guan 已提交
30 31
void     dmCleanupTrans(SDnode *pDnode);
SProcCfg dmGenProcCfg(SMgmtWrapper *pWrapper);
S
Shengliang Guan 已提交
32
SMsgCb   dmGetMsgcb(SMgmtWrapper *pWrapper);
S
Shengliang Guan 已提交
33 34
int32_t  dmInitMsgHandle(SDnode *pDnode);
void     dmSendRecv(SDnode *pDnode, SEpSet *pEpSet, SRpcMsg *pReq, SRpcMsg *pRsp);
S
Shengliang Guan 已提交
35
void     dmSendToMnodeRecv(SDnode *pDnode, SRpcMsg *pReq, SRpcMsg *pRsp);
S
Shengliang Guan 已提交
36

S
Shengliang Guan 已提交
37 38 39 40
// dmEps.c
int32_t dmReadEps(SDnode *pDnode);
int32_t dmWriteEps(SDnode *pDnode);
void    dmUpdateEps(SDnode *pDnode, SArray *pDnodeEps);
S
Shengliang Guan 已提交
41 42

// dmHandle.c
S
Shengliang Guan 已提交
43 44 45 46
void    dmSendStatusReq(SDnode *pDnode);
int32_t dmProcessConfigReq(SDnode *pDnode, SNodeMsg *pMsg);
int32_t dmProcessAuthRsp(SDnode *pDnode, SNodeMsg *pMsg);
int32_t dmProcessGrantRsp(SDnode *pDnode, SNodeMsg *pMsg);
S
Shengliang Guan 已提交
47 48
int32_t dmProcessCreateNodeReq(SDnode *pDnode, EDndNodeType ntype, SNodeMsg *pMsg);
int32_t dmProcessDropNodeReq(SDnode *pDnode, EDndNodeType ntype, SNodeMsg *pMsg);
S
Shengliang Guan 已提交
49 50

// dmMonitor.c
S
Shengliang Guan 已提交
51
void dmGetVnodeLoads(SDnode *pDnode, SMonVloadInfo *pInfo);
S
Shengliang Guan 已提交
52
void dmGetMnodeLoads(SDnode *pDnode, SMonMloadInfo *pInfo);
S
Shengliang Guan 已提交
53 54 55
void dmSendMonitorReport(SDnode *pDnode);

// dmWorker.c
S
Shengliang Guan 已提交
56 57 58 59 60 61
int32_t dmStartStatusThread(SDnode *pDnode);
void    dmStopStatusThread(SDnode *pDnode);
int32_t dmStartMonitorThread(SDnode *pDnode);
void    dmStopMonitorThread(SDnode *pDnode);
int32_t dmStartWorker(SDnode *pDnode);
void    dmStopWorker(SDnode *pDnode);
S
Shengliang Guan 已提交
62
int32_t dmProcessMgmtMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
S
Shengliang Guan 已提交
63
int32_t dmProcessStatusMsg(SMgmtWrapper *pWrapper, SNodeMsg *pMsg);
S
Shengliang Guan 已提交
64

S
Shengliang Guan 已提交
65 66 67 68 69 70 71 72 73
// 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 vmGetVnodeLoads(SMgmtWrapper *pWrapper, SMonVloadInfo *pInfo);
S
Shengliang Guan 已提交
74
void mmGetMnodeLoads(SMgmtWrapper *pWrapper, SMonMloadInfo *pInfo);
S
Shengliang Guan 已提交
75 76 77 78 79 80
void mmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonMmInfo *mmInfo);
void vmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonVmInfo *vmInfo);
void qmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonQmInfo *qmInfo);
void smGetMonitorInfo(SMgmtWrapper *pWrapper, SMonSmInfo *smInfo);
void bmGetMonitorInfo(SMgmtWrapper *pWrapper, SMonBmInfo *bmInfo);

S
Shengliang Guan 已提交
81 82 83 84
#ifdef __cplusplus
}
#endif

S
Shengliang Guan 已提交
85
#endif /*_TD_DND_IMP_H_*/