[TD-10430] header file for the dnode module

This commit is contained in:
Shengliang Guan 2021-09-29 13:48:55 +08:00
parent b04ab19be4
commit 26a96ba78d
1 changed files with 23 additions and 20 deletions

View File

@ -20,53 +20,56 @@
extern "C" { extern "C" {
#endif #endif
struct SRpcMsg;
struct SRpcEpSet;
/** /**
* Initialize and start the dnode module * Initialize and start the dnode module
* *
* @return Error Code * @return Instance of dnode module
*/ */
int32_t dnodeInit(); struct Dnode *dnodeCreateInstance();
/** /**
* Stop and cleanup dnode module * Stop and cleanup dnode module
*
* @param dnode Instance of dnode module
*/ */
void dnodeCleanup(); void dnodeCleanupInstance(struct Dnode *dnode);
/** /**
* Send messages to other dnodes, such as create vnode message. * Send messages to other dnodes, such as create vnode message.
* *
* @param dnode The instance of Dnode module
* @param epSet The endpoint list of the dnodes. * @param epSet The endpoint list of the dnodes.
* @param rpcMsg Message to be sent. * @param rpcMsg Message to be sent.
*/ */
void dnodeSendMsgToDnode(SRpcEpSet *epSet, SRpcMsg *rpcMsg); void dnodeSendMsgToDnode(struct Dnode *dnode, struct SRpcEpSet *epSet, struct SRpcMsg *rpcMsg);
/** /**
* Send messages to mnode, such as config message. * Send messages to mnode, such as config message.
* *
* @param dnode The instance of dnode module
* @param rpcMsg Message to be sent. * @param rpcMsg Message to be sent.
*/ */
void dnodeSendMsgToMnode(SRpcMsg *rpcMsg); void dnodeSendMsgToMnode(struct Dnode *dnode, struct SRpcMsg *rpcMsg);
/**
* Send redirect message to dnode or shell.
*
* @param dnode The instance of dnode module
* @param rpcMsg Message to be sent.
* @param forShell Used to identify whether to send to shell or dnode.
*/
void dnodeSendRedirectMsg(struct Dnode *dnode, struct SRpcMsg *rpcMsg, bool forShell);
/** /**
* Get the corresponding endpoint information from dnodeId. * Get the corresponding endpoint information from dnodeId.
* *
* @param dnodeId * @param dnode The instance of Dnode module
* @param dnodeId The id ot dnode
* @param ep The endpoint of dnode * @param ep The endpoint of dnode
* @param fqdn The fqdn of dnode * @param fqdn The fqdn of dnode
* @param port The port of dnode * @param port The port of dnode
*/ */
void dnodeGetDnodeEp(int32_t dnodeId, char *ep, char *fqdn, uint16_t *port); void dnodeGetDnodeEp(struct Dnode *dnode, 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 #ifdef __cplusplus
} }