未验证 提交 bafe6039 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #8039 from taosdata/feature/dnode3

TD-10430 add interface
......@@ -20,6 +20,54 @@
extern "C" {
#endif
struct SRpcMsg;
struct SRpcEpSet;
/**
* Initialize and start the dnode module
*
* @return Error Code
*/
int32_t dnodeInit();
/**
* Stop and cleanup dnode module
*/
void dnodeCleanup();
/**
* Send messages to other dnodes, such as create vnode message.
*
* @param epSet The endpoint list of the dnodes.
* @param rpcMsg Message to be sent.
*/
void dnodeSendMsgToDnode(SRpcEpSet *epSet, SRpcMsg *rpcMsg);
/**
* Send messages to mnode, such as config message.
*
* @param rpcMsg Message to be sent.
*/
void dnodeSendMsgToMnode(SRpcMsg *rpcMsg);
/**
* Get the corresponding endpoint information from dnodeId.
*
* @param dnodeId
* @param ep The endpoint of dnode
* @param fqdn The fqdn of dnode
* @param port The port of dnode
*/
void dnodeGetDnodeEp(int32_t dnodeId, char *ep, char *fqdn, uint16_t *port);
/**
* Report to dnode the start-up steps of other modules
*
* @param name Name of the start-up phase.
* @param desc Description of the start-up phase.
*/
void dnodeReportStartup(char *name, char *desc);
#ifdef __cplusplus
}
#endif
......
......@@ -20,6 +20,47 @@
extern "C" {
#endif
struct SRpcMsg;
/**
* Deploy Mnode instances in Dnode.
*
* @return Error Code.
*/
int32_t mnodeDeploy();
/**
* Delete the Mnode instance deployed in Dnode.
*/
void mnodeUnDeploy();
/**
* Start Mnode service.
*
* @return Error Code.
*/
int32_t mnodeStart();
/**
* Stop Mnode service.
*/
int32_t mnodeStop();
/**
* Interface for processing messages.
*
* @param pMsg Message to be processed.
* @return Error code
*/
int32_t mnodeProcessMsg(SRpcMsg *pMsg);
/**
* Whether the Mnode is in service.
*
* @return Server status.
*/
bool mnodeIsServing();
#ifdef __cplusplus
}
#endif
......
......@@ -11,4 +11,52 @@
*
* 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/>.
*/
\ No newline at end of file
*/
#ifndef _TD_VNODE_H_
#define _TD_VNODE_H_
#ifdef __cplusplus
extern "C" {
#endif
struct SRpcMsg;
/**
* Start Initialize Vnode module.
*
* @return Error Code.
*/
int32_t vnodeInit();
/**
* Cleanup Vnode module.
*/
void vnodeCleanup();
typedef struct {
int64_t queryMsgCount;
int64_t writeMsgCount;
} SVnodeStat;
/**
* Get the statistical information of Vnode
*
* @param stat Statistical information.
* @return Error Code.
*/
int32_t vnodeGetStatistics(SVnodeStat *stat);
/**
* Interface for processing messages.
*
* @param pMsg Message to be processed.
* @return Error code
*/
int32_t vnodeProcessMsg(SRpcMsg *pMsg);
#ifdef __cplusplus
}
#endif
#endif /*_TD_VNODE_H_*/
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册